Wordpress Dockerized Environment.
Clone or download


Wordpress Dockerized Environment

PRs Welcome

This repository aims to simplify the setting up of a docker-compose development environment.


First, make sure you have the latest versions of Docker and Docker Compose installed on your machine.

From a new project

  • Download latest WordPress version.
  • Unzip wordpress-x.x.x.zip archive.
  • Move all files present in the unzipped folder to src/
  • Run docker-compose up.

From an existing project

  • Move all your files to src/.
  • Copy the SQL dump file to docker/dump/.
  • Update database credentials in docker-compose.yml with your own values.
  • Run docker-compose up.


There are two ways to access to your local WordPress:

# Directly from your local machine IP.

# From a local domain (cf: Utils/WordPress section), add below line in your /etc/hosts file. wordpress.local

Docker Compose

# To start/restart your containers
$ docker-compose up

# To start/restart your containers in background
$ docker-compose up -d

# To stop all containers
$ docker-compose stop

# To stop and remove all containers
$ sudo docker-compose down

# To remove all stoped containers
$ docker-compose rm --all

# To connect you into wordpress container
$ docker-compose exec wordpress /bin/bash

# To connect you into mysql container
$ docker-compose exec mydb.mysql.db /bin/bash


To override the hostname without changing any data in your database add in your wp-config.php the below lines:



# To dump MySQL 
$ bash utils/dump.sh