← All guides
WordPress (Docker)
The world's most widely-used CMS, self-hosted via the official Docker images alongside a MySQL database -- the same software powering a large share of the web, running on your own server.
This guide is synthesized from WordPress (Docker)'s own official documentation, linked above — always cross-check exact package/version names there before running these commands on a production server, since distro and project versions move over time.
1Create a Docker Compose file
cat > docker-compose.yml <<'EOF' services: db: image: mysql:8 restart: unless-stopped environment: MYSQL_ROOT_PASSWORD: changeme-root MYSQL_DATABASE: wordpress MYSQL_USER: wordpress MYSQL_PASSWORD: changeme-db volumes: - db_data:/var/lib/mysql wordpress: image: wordpress:latest restart: unless-stopped ports: - "8080:80" environment: WORDPRESS_DB_HOST: db WORDPRESS_DB_NAME: wordpress WORDPRESS_DB_USER: wordpress WORDPRESS_DB_PASSWORD: changeme-db volumes: - wp_data:/var/www/html depends_on: - db volumes: db_data: wp_data: EOFReplace changeme-root and changeme-db with real passwords before starting.
2Start it
docker compose up -d3Complete the WordPress setup wizard
Choose a language, then create the admin account -- the database connection is already configured via the environment variables above.
http://<the-server's-ip>:80804Put it behind HTTPS before real use
See the Nginx + Let's Encrypt guide in this section to expose it on a real domain with a proper certificate instead of plain HTTP.