Automated MODX CMS deployment from source in Docker containers.
- Automatic installation — no browser wizard required
- Ready-to-use environment — Nginx + PHP-FPM + MySQL + phpMyAdmin
- Reproducibility — single command deploys identical environment
- Git-based installation — fresh code from MODX repository
| Service | Port | Description |
|---|---|---|
| nginx | 8080 | Web server |
| php-fpm | — | PHP 8.2 |
| mysql | 3306 | Database |
| pma | 8090 | phpMyAdmin |
You must create an empty www folder before starting:
mkdir wwwIf you skip this step, Docker will create it as root and PHP won't be able to write files.
-
Copy
.env.sampleto.env:cp .env.sample .env
-
Edit
.envif needed (passwords, MODX version, etc.) -
Create empty
wwwfolder:mkdir www
-
Start containers:
docker-compose up -d
-
Wait for installation to complete (watch logs):
docker-compose logs -f php-fpm
-
Open:
- Site: http://localhost:8080
- Admin panel: http://localhost:8080/manager/
- phpMyAdmin: http://localhost:8090
| Variable | Description | Default |
|---|---|---|
| PUID/PGID | User UID/GID | 1000 |
| MODX_GIT_BRANCH | MODX version | v3.0.5-pl |
| MYSQL_PASSWORD | Database password | modx |
| MODX_ADMIN_USER | Admin login | admin |
| MODX_ADMIN_PASSWORD | Admin password | admin123 |
- www directory permissions: If the
wwwdirectory does not exist when the container is created, Docker will mount it as root. The PHP process will not be able to create files in it. You must create thewwwdirectory beforehand with the correct user permissions. - Empty www directory required: You cannot create a non-empty
wwwdirectory beforehand, as the git clone operation will fail if the directory is not empty. Ensure the directory exists but is empty before starting the container.