{"id":34787891,"url":"https://github.com/serversideup/docker-wordpress","last_synced_at":"2025-12-25T09:33:40.362Z","repository":{"id":73851138,"uuid":"433935079","full_name":"serversideup/docker-wordpress","owner":"serversideup","description":"Learn how to run WordPress with Docker. Read about our experiences and start off with an easy boilerplate.","archived":false,"fork":false,"pushed_at":"2021-12-01T19:49:22.000Z","size":94,"stargazers_count":23,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-04-14T22:48:59.492Z","etag":null,"topics":["docker","docker-compose","php","wordpress"],"latest_commit_sha":null,"homepage":"https://serversideup.net","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serversideup.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":"serversideup"}},"created_at":"2021-12-01T18:09:49.000Z","updated_at":"2024-03-18T10:16:03.000Z","dependencies_parsed_at":"2023-09-24T17:56:20.888Z","dependency_job_id":"49f5904f-4243-4192-8cea-2c679480548d","html_url":"https://github.com/serversideup/docker-wordpress","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"661a5b51a1bdcb463af65bffff61698ff0cf20e2"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/serversideup/docker-wordpress","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serversideup%2Fdocker-wordpress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serversideup%2Fdocker-wordpress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serversideup%2Fdocker-wordpress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serversideup%2Fdocker-wordpress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serversideup","download_url":"https://codeload.github.com/serversideup/docker-wordpress/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serversideup%2Fdocker-wordpress/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28025629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-25T02:00:05.988Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","php","wordpress"],"created_at":"2025-12-25T09:33:36.192Z","updated_at":"2025-12-25T09:33:40.352Z","avatar_url":"https://github.com/serversideup.png","language":"PHP","funding_links":["https://github.com/sponsors/serversideup"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\t\t\u003cimg src=\".github/header.png\" width=\"1200\" alt=\"Docker WordPress Logo\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\t\u003ca href=\"https://github.com/serversideup/docker-php/blob/main/LICENSE\" target=\"_blank\"\u003e\u003cimg src=\"https://badgen.net/github/license/serversideup/docker-wordpress\" alt=\"License\"\u003e\u003c/a\u003e\n\t\u003ca href=\"https://github.com/sponsors/serversideup\"\u003e\u003cimg src=\"https://badgen.net/badge/icon/Support%20Us?label=GitHub%20Sponsors\u0026color=orange\" alt=\"Support us\"\u003e\u003c/a\u003e\n  \u003cbr /\u003e\n  \u003ca href=\"https://community.serversideup.net\"\u003e\u003cimg alt=\"Discourse users\" src=\"https://img.shields.io/discourse/users?color=blue\u0026server=https%3A%2F%2Fcommunity.serversideup.net\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://serversideup.net/discord\"\u003e\u003cimg alt=\"Discord\" src=\"https://img.shields.io/discord/910287105714954251?color=blueviolet\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# Running WordPress on Docker\nReady to take the dive and modernize WordPress with Docker?\n\nLong story short, it can be definitely be worth it depending on your use case. From our experience, you can save yourself hours, or really over-engineer and dig yourself a hole.\n\n## 👉 \"The WordPress Way\"\nWe're very grateful for WordPress, and it even runs our blog for [Server Side Up](https://serversideup.net/). The only downside with WordPress is it has a lot of history with it. That means the core was written with in a mindset before all of the fancy and flashy methods that we have today.\n\nThe most important thing you need to remember is always try to do things _\"The WordPress Way\"_.\n\nThe more you work with it, the less you are fighting the platform.\n\n#### What do you mean by \"fighting the platform\"?\nIntroducing modern toolsets to WordPress may allow you to get WordPress up and running, but severely limit you to the rest of the community tools.\n\nThis could be things like (but not limited to):\n* Using NGINX as the web server\n* Deploying updates by packaging WordPress into a Docker Image\n* Using too new of a PHP version\n* Using [Roots Bedrock](https://roots.io/) to modernize your development flow\n\nWe've tried all of these above and we learned that most of the plugins that we relied on had issues with this.\n\n# So how does Server Side Up run WordPress?\nWe embrace these principals:\n1. Always do things \"The WordPress Way\"\n1. Keep plugin installation to a minimum\n1. Always use Apache as the web server (too many plugins expect Apache)\n1. Only commit _your own_ source code (not WordPress core or another plugin)\n\n### The structure\nWe run WordPress in production on Docker Swarm using:\n1. [Traefik](https://traefik.io/traefik/) (handles SSL automatically with Let's Encrypt)\n2. [Our PHP-Apache image](https://hub.docker.com/r/serversideup/php/tags?name=fpm-apache\u0026page=1\u0026ordering=-name) (this is optimized for WordPress)\n3. [MariaDB](https://hub.docker.com/_/mariadb) (the \"non-Oracle\" alternative to MySQL)\n\n### Deploying updates\nWe attempted to deploy WordPress with rolling updates (like we do with Laravel) by packaging WordPress into a Docker image use the[Roots Bedrock](https://roots.io/) framework, but we ran into a ton of issues with community plugins.\n\nOur most stable solution (following \"The WordPress Way\") is to:\n1. Mount `/var/www/html` of the container to the host\n2. At the host container, run an SSH `git pull` from our CI system\n\nUgly, but it works 🤷‍♂️\n\n# Running WordPress Locally with this method\nIn this repository, you will find a basic boilerplate of what we use when we start a new WordPress project.\n\n### Clone this repo down\n```sh\ngit@github.com:serversideup/docker-wordpress.git\n```\n### Install WordPress\n```sh\n# Make sure you are in the project folder\ncd docker-wordpress\n\n# Download and extract WordPress\nwget -c https://wordpress.org/latest.tar.gz -O - | tar -xz -C public/ --strip=1 wordpress/\n```\n\n### Configure your `hosts` file\nThis example uses \"wordpress.dev.test\" for the URL, so we would add this to our hosts file:\n```\n127.0.0.1 wordpress.dev.test\n```\n\n### Bring up your containers\nWe use [Docker Overrides](https://docs.docker.com/compose/extends/) to separate our environments.\n\nFor now use this ugly command, but we are working on open sourcing a tool called [Spin](https://github.com/serversideup/spin) that will greatly shorten this:\n```sh\ndocker compose -f docker-compose.yml -f docker-compose.dev.yml up\n```\n\n**⚠️ Make sure you allow MariaDB to provision the user the first time.**\nYou'll see something like this in the logs:\n```txt\ndocker-wordpress-mariadb-1  | [Note] [Entrypoint]: Creating database wordpress\ndocker-wordpress-mariadb-1  | [Note] [Entrypoint]: Creating user wordpress_database_user\n```\n\n### Visit your WordPress site\nJust go to [https://wordpress.dev.test/](https://wordpress.dev.test/) in your browser. You should see the WordPress install wizard.\n\nThe credentials are set in `docker-compose.dev.yml`. By default they are:\n* **Database Name**: wordpress\n* **Database Username**: wordpress_database_user\n* **Database Password**: wordpress_database_password\n* **Database Host**: mariadb (the name of the mariadb service in the docker-compose.yml file)\n\n# Running WordPress in production\nWe use Docker Swarm for running WordPress in production (just because it is so much simpler than Kubernetes).I  left our `docker-compose.prod.yml` file in there, but there are a number of things that we do in production that would take longer than writing this document 😅\n\nIf there is interest on how we do this, just let us know. [Hit me up on Twitter](https://twitter.com/jaydrogers) and express your interest on learning more.\n\nFor this first commit, I  just wanted to at least give you a perspective on how we run things.\n\nAs always, if you know of a better way, let us know!!\n\n## About Us\nWe're [Dan](https://twitter.com/danpastori) and [Jay](https://twitter.com/jaydrogers) - a two person team with a passion for open source products. We created [Server Side Up](https://serversideup.net) to help share what we learn.\n\n\u003cdiv align=\"center\"\u003e\n\n| \u003cdiv align=\"center\"\u003eDan Pastori\u003c/div\u003e                  | \u003cdiv align=\"center\"\u003eJay Rogers\u003c/div\u003e                                 |\n| ----------------------------- | ------------------------------------------ |\n| \u003cdiv align=\"center\"\u003e\u003ca href=\"https://twitter.com/danpastori\"\u003e\u003cimg src=\"https://serversideup.net/wp-content/uploads/2023/08/dan.jpg\" title=\"Dan Pastori\" width=\"150px\"\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://twitter.com/danpastori\"\u003e\u003cimg src=\"https://serversideup.net/wp-content/themes/serversideup/images/open-source/twitter.svg\" title=\"Twitter\" width=\"24px\"\u003e\u003c/a\u003e\u003ca href=\"https://github.com/danpastori\"\u003e\u003cimg src=\"https://serversideup.net/wp-content/themes/serversideup/images/open-source/github.svg\" title=\"GitHub\" width=\"24px\"\u003e\u003c/a\u003e\u003c/div\u003e                        | \u003cdiv align=\"center\"\u003e\u003ca href=\"https://twitter.com/jaydrogers\"\u003e\u003cimg src=\"https://serversideup.net/wp-content/uploads/2023/08/jay.jpg\" title=\"Jay Rogers\" width=\"150px\"\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://twitter.com/jaydrogers\"\u003e\u003cimg src=\"https://serversideup.net/wp-content/themes/serversideup/images/open-source/twitter.svg\" title=\"Twitter\" width=\"24px\"\u003e\u003c/a\u003e\u003ca href=\"https://github.com/jaydrogers\"\u003e\u003cimg src=\"https://serversideup.net/wp-content/themes/serversideup/images/open-source/github.svg\" title=\"GitHub\" width=\"24px\"\u003e\u003c/a\u003e\u003c/div\u003e                                       |\n\n\u003c/div\u003e\n\n### Find us at:\n\n* **📖 [Blog](https://serversideup.net)** - Get the latest guides and free courses on all things web/mobile development.\n* **🙋 [Community](https://community.serversideup.net)** - Get friendly help from our community members.\n* **🤵‍♂️ [Get Professional Help](https://serversideup.net/professional-support)** - Get video + screen-sharing support from the core contributors.\n* **💻 [GitHub](https://github.com/serversideup)** - Check out our other open source projects.\n* **📫 [Newsletter](https://serversideup.net/subscribe)** - Skip the algorithms and get quality content right to your inbox.\n* **🐥 [Twitter](https://twitter.com/serversideup)** - You can also follow [Dan](https://twitter.com/danpastori) and [Jay](https://twitter.com/jaydrogers).\n* **❤️ [Sponsor Us](https://github.com/sponsors/serversideup)** - Please consider sponsoring us so we can create more helpful resources.\n\n## Our products\nIf you appreciate this project, be sure to check out our other projects.\n\n### 📚 Books\n- **[The Ultimate Guide to Building APIs \u0026 SPAs](https://serversideup.net/ultimate-guide-to-building-apis-and-spas-with-laravel-and-nuxt3/)**: Build web \u0026 mobile apps from the same codebase.\n- **[Building Multi-Platform Browser Extensions](https://serversideup.net/building-multi-platform-browser-extensions/)**: Ship extensions to all browsers from the same codebase.\n\n### 🛠️ Software-as-a-Service\n- **[Bugflow](https://bugflow.io/)**: Get visual bug reports directly in GitHub, GitLab, and more.\n- **[SelfHost Pro](https://selfhostpro.com/)**: Connect Stripe or Lemonsqueezy to a private docker registry for self-hosted apps.\n\n### 🌍 Open Source\n- **[AmplitudeJS](https://521dimensions.com/open-source/amplitudejs)**: Open-source HTML5 \u0026 JavaScript Web Audio Library.\n- **[Spin](https://serversideup.net/open-source/spin/)**: Laravel Sail alternative for running Docker from development → production.\n- **[Financial Freedom](https://github.com/serversideup/financial-freedom)**: Open source alternative to Mint, YNAB, \u0026 Monarch Money.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserversideup%2Fdocker-wordpress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserversideup%2Fdocker-wordpress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserversideup%2Fdocker-wordpress/lists"}