MirrorNest
← すべてのガイド

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.

このガイドは上記リンク先にあるWordPress (Docker)公式ドキュメントをもとに作成されています。ディストリビューションやプロジェクトのバージョンは時間とともに変わるため、本番サーバーでこれらのコマンドを実行する前に、必ず公式ドキュメントで正確なパッケージ名・バージョン名を確認してください。
  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.