Create a new Roadiz project

For new projects Roadiz can be easily setup using create-project command and our Skeleton.

# Create a new Roadiz project
composer create-project roadiz/skeleton my-website
cd my-website
# Create a local Dotenv to store your secrets
cp .env .env.local
# Edit your docker-compose parameter in .env to
# fit your development environment (OS, UID).
# .env file will be tracked by Git
#
# Initialize your Docker environment
docker-compose build
docker-compose up -d --force-recreate

Warning

Roadiz and Symfony development and production environments heavily rely on Docker and docker-compose. We recommend you to learn these awesome tools if you’re not using them yet.

Composer will prompt you if you want to can versioning history. Choose the default answer no as we definitely want to replace roadiz/skeleton Git with our own versioning. Then you will be able to customize every files in your projects and save them using Git, not only your theme. Of course we added a default .gitignore file to prevent your configuration setting and entry points to be committed in your Git history. That way you can have different configuration on development and on your production server without bothering about merge conflicts.

Generate JWT private and public keys

# Generate a strong secret
openssl rand --base64 16;
# Fill JWT_PASSPHRASE env var.
openssl genpkey -out config/jwt/private.pem -aes256 -algorithm rsa -pkeyopt rsa_keygen_bits:4096;
openssl pkey -in config/jwt/private.pem -out config/jwt/public.pem -pubout;

Install database

# Create and migrate Roadiz database schema
docker-compose exec -u www-data app bin/console doctrine:migrations:migrate
# Migrate any existing data types
docker-compose exec -u www-data app bin/console themes:migrate ./src/Resources/config.yml
# Install base Roadiz fixtures, default translation, roles and settings
docker-compose exec -u www-data app bin/console install
# Clear cache
docker-compose exec -u www-data app bin/console cache:clear
# Create your admin account
docker-compose exec -u www-data app bin/console users:create -m username@roadiz.io -b -s username

Then connect to http://localhost:${YOUR_PORT}/rz-admin to access your freshly-created Roadiz backoffice.

Note

If you setup Traefik on your local environment, you can reach your Roadiz app using your domain.test test domain name without specifying a non-default port. You have to change HOSTNAME dot-env variable and change your local DNS to point domain.test to 127.0.0.1. The easiest way is to add 127.0.0.1 domain.test to your /etc/hosts file.