Run YunCMS with Docker Compose: MySQL 8.4 Included
Run YunCMS with Docker Compose: MySQL 8.4 Included
Disclosure
Disclosure: YunCMS is developed and maintained by Yunsoft Software. This guide covers our own open-source project. It was verified against yunsoftofficial/yuncms:0.1.22 on September 12, 2026. The YunCMS 0.1.x line is pre-stable, so interfaces and behavior may change between releases.
What You Need to Know
You may not want to prepare the right Node.js version, npm and a separate MySQL server just to evaluate a CMS/backend. The YunCMS Docker Compose path shortens that first step: a constrained YunCMS container, MySQL 8.4 and persistent volumes arrive in one maintained project definition.
The Compose Stack
The official stack creates two services and two persistent volumes:
- MySQL 8.4: stores YunCMS metadata and project collections.
- YunCMS: runs the CLI, REST API and built React Studio from the same image.
mysql-data: keeps MySQL tables independent of container lifetime.yuncms-data: stores the project environment, local Files, extensions, AI settings key and local backups.
Requirements
For local use, you only need Docker Engine with the Compose plugin or Docker Desktop. An internet-facing production deployment additionally needs persistent storage suitable for its database and Files plus a reverse proxy that terminates TLS.
Download the Official Compose Files
Create an empty deployment directory and download the maintained configuration:
mkdir my-yuncms cd my-yuncms curl -fsSLO https://raw.githubusercontent.com/Yunsoft-Software/yuncms/main/compose.yaml curl -fsSL https://raw.githubusercontent.com/Yunsoft-Software/yuncms/main/docker.env.example -o .envOpen
.envand replace these two example values with different strong passwords:YUNCMS_DB_PASSWORD=replace-with-a-strong-database-password YUNCMS_DB_ROOT_PASSWORD=replace-with-a-different-strong-root-passwordNever commit the
.envfile. It contains database passwords and deployment configuration and should be readable only by people and processes that need it.
Starting YunCMS
Start MySQL first:
docker compose up -d mysql docker compose psThe stack does not consider YunCMS ready before MySQL becomes healthy. Wait for the MySQL service to report healthy in
docker compose ps.Initialize YunCMS once:
docker compose run --rm yuncms initUse these Compose values for the database prompts:
| Prompt | Value |
| --- | --- |
| MySQL host | mysql |
| MySQL port | 3306 |
| MySQL database | yuncms |
| MySQL user | yuncms |
| MySQL password | the YUNCMS_DB_PASSWORD value from .env |
| Use MySQL TLS | false for the private Compose network |
Then enter the first Administrator email and a strong password.Start YunCMS and verify readiness:
docker compose up -d yuncms docker compose ps curl http://localhost:3008/health curl http://localhost:3008/readyOpen http://localhost:3008 in a browser. Studio and the REST API share the same port.
Removing a Container is Not the Same as Removing Data
Stopping containers or running a normal docker compose down does not remove named volumes. MySQL and the YunCMS project state remain available when the stack starts again. Be careful: docker compose down -v removes both volumes. That can irreversibly destroy the database, uploaded local Files, extensions and local YunCMS state.
Creating a Backup
Stop the normal YunCMS service before maintenance:
docker compose stop yuncmsCreate a backup:
docker compose run --rm yuncms backupCopy the completed backup out of the volume and store it independently:
docker compose cp yuncms:/data/.yuncms/backups ./backups
Updating a Container Installation Safely
- Stop the service and create a verified backup with the current image:
docker compose stop yuncms docker compose run --rm yuncms backup - Change
YUNCMS_IMAGEin.envto the target version. - Pull the new image and run
bootstraponce:docker compose pull yuncms docker compose run --rm yuncms bootstrap - Start the service and verify
/ready, Administrator login, representative permissions and Files:docker compose up -d yuncms curl http://localhost:3008/ready
Before Exposing the Installation to the Internet
- Set
YUNCMS_PUBLIC_URLto the real HTTPS origin. - Match
YUNCMS_TRUST_PROXY_HOPSto the actual reverse-proxy chain. - Do not publish the MySQL port.
- Replace every example Administrator and database password.
- Design the Public role from a deny-by-default starting point.
- Test Files, backup/restore, permissions and sessions with representative users.
Comments
No comments yet. Start the discussion.