MirrorNest
← Tous les 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.

Système : Any Docker hostCMSWebSite officiel ↗Documentation officielle ↗
Ce guide est élaboré à partir de la documentation officielle de WordPress (Docker), dont le lien figure ci-dessus — vérifiez toujours les noms exacts des paquets/versions avant d'exécuter ces commandes sur un serveur de production, car les versions de la distribution et du projet évoluent avec le temps.
  1. 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: EOF

    Replace changeme-root and changeme-db with real passwords before starting.

  2. 2Start it

    docker compose up -d
  3. 3Complete 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>:8080
  4. 4Put 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.