How to Install Roadiz CMS 2 on Debian 13 with Docker
Create a Roadiz 2 project on Debian 13 from the official skeleton, start its Docker Compose stack, install the database and log in to the back office.
Roadiz is an open-source CMS built on Symfony and Doctrine that lets you define your own content types. Version 2 is a headless CMS: it provides a back office and a JSON API (through API Platform), and your front end consumes that API. This guide creates a Roadiz 2 project on Debian 13 from the official skeleton and runs it with Docker Compose, which is the installation route the project documents. At the end you can log in to the back office at /rz-admin.
Older tutorials install Roadiz 1 from the roadiz/standard-edition package on a hand-built Nginx and PHP 7 stack. That package belongs to the 1.x series; new projects start from roadiz/skeleton.
Requirements
- A Debian 13 server and a non-root user with
sudorights (this guide calls itdeploy). The stack runs several containers (PHP, Nginx, MariaDB/MySQL, Redis, Varnish, Solr), so plan for at least 2 GB of RAM. - Composer, Git and a command-line PHP on the host to create the project. The current skeleton requires PHP 8.3 or newer. Debian 13 meets that from its own repositories; Debian 12 ships PHP 8.2, which is too old, so on Debian 12 create the project on another machine or upgrade first.
- Docker Engine with the Compose plugin.
If you prefer to run without Docker, Roadiz needs PHP 8.2+ (8.3 recommended) with the intl, curl, mbstring, zip, simplexml and OPcache extensions, MariaDB 10.11+ or MySQL 8.0+, and Nginx or Apache with a dedicated virtual host. The console commands below are then run without the docker compose exec app prefix.
Step 1: Install Docker Engine
Add Docker's official repository, as described in the Docker documentation for Debian:
sudo apt update
sudo apt install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.ascsudo tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://download.docker.com/linux/debian
Suites: $(. /etc/os-release && echo "$VERSION_CODENAME")
Components: stable
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/docker.asc
EOFInstall the engine and the Compose plugin:
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-pluginAllow your user to run Docker without sudo, then log out and back in:
sudo usermod -aG docker deployStep 2: Install Composer and Git
Composer only runs once on the host, to download the skeleton and its dependencies:
sudo apt install git unzip composer php-cli php-xml php-intl php-curl php-mbstring php-zipCheck that PHP is 8.3 or newer:
php --versionStep 3: Create the project
Create the project in your home directory. Replace my-website with your project name:
cd ~
COMPOSER_MEMORY_LIMIT=-1 composer create-project roadiz/skeleton my-website
cd my-websiteWhen Composer asks whether to remove the existing version history, answer yes: the project should live in your own Git repository, not in the skeleton's.
Create your local configuration files:
cp .env .env.local
cp compose.override.yml.dist compose.override.yml.env is meant to be committed and must not contain secrets; put passwords and other local changes in .env.local, which Git ignores. compose.override.yml publishes the container ports on the host, using the PUBLIC_* variables defined in .env (for example PUBLIC_NGINX_PORT and PUBLIC_VARNISH_PORT). Open both files and adjust the ports to your needs; on a public server, remove the port mappings for the database, Redis and phpMyAdmin so they are not reachable from the internet.
Step 4: Build and start the containers
docker compose build
docker compose up -d --force-recreateThe first start takes a while because the database has to initialise. Check that the application container answers:
docker compose ps
docker compose exec app bin/consoleThe second command should print the list of Symfony console commands.
Step 5: Generate secrets
composer create-project normally generates the secret keys and the JWT key pair for you. If it did not, or if you want fresh values, run:
docker compose exec app bin/console secrets:generate-keys
docker compose exec app bin/console secrets:set APP_SECRET --random
docker compose exec app bin/console secrets:set JWT_PASSPHRASE --random
docker compose exec app bin/console lexik:jwt:generate-keypairAfter storing APP_SECRET and JWT_PASSPHRASE as Symfony secrets, remove those two variables from .env and .env.local; otherwise the plain values override the encrypted ones.
Step 6: Install the database and create an administrator
Run the migrations, install the node types, fixtures, roles and settings, then clear the cache:
docker compose exec app bin/console doctrine:migrations:migrate
docker compose exec app bin/console app:install
docker compose exec app bin/console install
docker compose exec app bin/console messenger:stop-workers
docker compose exec app bin/console cache:clearThe skeleton's make install target runs the same sequence if you have make installed.
Create the first back-office user. The -b and -s options give it back-office access and super-admin rights; a random password is generated and printed unless you pass one with -p:
docker compose exec app bin/console users:create -m admin@example.com -b -s admin@example.comStep 7: Log in to the back office
Open http://203.0.113.10:PORT/rz-admin, where PORT is the value of PUBLIC_NGINX_PORT in your .env, and sign in with the account you just created. If a firewall is active, allow that port first, or better, keep it closed and reach it through an SSH tunnel while you are setting things up.
From here you define node types in the back office or as JSON files in src/Resources/node-types. The skeleton ships with four: Menu, MenuLink, Page and AliasBlock.
Before you go public
- The Compose stack you just started is the skeleton's development setup. For a public site, put a reverse proxy with a TLS certificate in front of it (the skeleton's
.envcontains host rules for Traefik), set the application environment to production in.env.localand read the deployment notes in the Roadiz documentation. - Back up the database volume and the uploaded files. The skeleton's
.envhas placeholders for Restic backups to S3-compatible storage. - Update with
composer updateinside the project, rebuild the image, and rundoctrine:migrations:migrateagain.
Frequently asked questions
Does Roadiz 2 still render a website with themes?
Not by default. Roadiz 2 is designed as a headless CMS: content is exposed through API Platform endpoints and a separate front end, for example a JavaScript framework, renders it. The skeleton exposes shared data such as menus at /api/common_content.
Can I run the console commands without typing the Docker prefix?
Open a shell in the container with docker compose exec app sh and run bin/console commands directly from there.
Which database can I use?
Roadiz requires MariaDB 10.11 or newer, or MySQL 8.0 or newer, because it relies on JSON functions. The Compose stack already contains a database container, so nothing needs to be installed on the host.