nezhar/wordpress-docker-compose
nezhar/wordpress-docker-compose has 2,036 GitHub stars and 1,361 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-07 23:23 UTC. Last push 2026-08-09.
Easy Wordpress development with Docker and Docker Compose
Measured star growth
- in 24h
- 0
- in 7 days
- Update delayed
- in 15 days
- Update delayed
- in 1 month
- Update delayed
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalWPDC - WordPress Docker Compose
Easy WordPress development with Docker and Docker Compose.
With this project you can quickly run the following:
Contents:
Requirements
Make sure you have the latest versions of Docker and Docker Compose installed on your machine. The commands in this README use the Compose V2 syntax (docker compose), which ships with Docker Desktop and is available as the docker-compose-plugin package on Linux.
Clone this repository or copy the files from this repository into a new folder. In the docker-compose.yml file you may change the IP address (in case you run multiple containers) or the database from MySQL to MariaDB.
Make sure to add your user to the docker group when using Linux.
Configuration
Copy the example environment into .env
cp env.example .env
Edit the .env file to change the default IP address, MySQL root password and WordPress database name.
Installation
Open a terminal and cd to the folder in which docker-compose.yml is saved and run:
docker compose up
This creates two new folders next to your docker-compose.yml file.
wp-data– used to store and restore database dumpswp-app– the location of your WordPress application
The containers are now built and running. You should be able to access the WordPress installation with the configured IP in the browser address. By default it is http://127.0.0.1.
For convenience you may add a new entry into your hosts file.
Usage
Starting containers
You can start the containers with the up command in daemon mode (by adding -d as an argument) or by using the start command:
docker compose start
Stopping containers
docker compose stop
Removing containers
To stop and remove all the containers use thedown command:
docker compose down
Use -v if you need to remove the database volume which is used to persist the database:
docker compose down -v
Project from existing source
Copy the docker-compose.yml file into a new directory. In the directory you create two folders:
wp-data– here you add the database dumpwp-app– here you copy your existing WordPress code
You can now use the up command:
docker compose up
This will create the containers and populate the database with the given dump. You may set your host entry and change it in the database, or you simply overwrite it in wp-config.php by adding:
define('WP_HOME','http://wp-app.local');
define('WP_SITEURL','http://wp-app.local');
Creating database dumps
./export.sh
Developing a Theme
Configure the volume to load the theme in the container in the docker-compose.yml:
volumes:
- ./theme-name/trunk/:/var/www/html/wp-content/themes/theme-name
Developing a Plugin
Configure the volume to load the plugin in the container in the docker-compose.yml:
volumes:
- ./plugin-name/trunk/:/var/www/html/wp-content/plugins/plugin-name
WP CLI
The docker compose configuration also provides a service for using the WordPress CLI.
Sample command to install WordPress:
docker compose run --rm wpcli core install --url=http://localhost --title=test --admin_user=admin [email protected]
Or to list installed plugins:
docker compose run --rm wpcli plugin list
For an easier usage you may consider adding an alias for the CLI:
alias wp="docker compose run --rm wpcli"
This way you can use the CLI command above as follows:
wp plugin list
phpMyAdmin
You can also visit http://127.0.0.1:8080 to access phpMyAdmin after starting the containers.
The default username is root, and the password is the same as supplied in the .env file.
Explore related projects
n8n-io/n8n
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
209,824 starslanggenius/dify
Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
160,627 starsmicrosoft/PowerToys
Microsoft PowerToys is a collection of utilities that supercharge productivity and customization on Windows
140,710 starsstablyai/orca
Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.
119,095 stars