Getting Started

Docker4WordPress is a set of docker containers optimized for WordPress. Use docker-compose.yml file from docker4wordpress repository to spin up local environment on Linux, Mac OS X and Windows.

Docker4WordPress is designed to be used for local development, if you're looking for a production solution see using in production.


The WordPress stack consist of the following containers:

Container Versions Service name Image Enabled by default
Nginx 1.13, 1.12 nginx wodby/wordpress-nginx
Apache 2.4 apache wodby/php-apache
WordPress 4 php wodby/wordpress
PHP 7.1, 7.0 php wodby/wordpress-php
MariaDB 10.1 mariadb wodby/mariadb
Redis 3.2 redis wodby/redis
Varnish 4.1 varnish wodby/wordpress-varnish
Webgrind 1.5 webgrind wodby/webgrind
Blackfire latest blackfire blackfire/blackfire
AthenaPDF 2.10.0 athenapdf arachnysdocker/athenapdf-service
phpMyAdmin latest pma phpmyadmin/phpmyadmin
Mailhog latest mailhog mailhog/mailhog
Portainer latest portainer portainer/portainer
Traefik latest traefik _/traefik

Supported WordPress versions: 4


Must know before you start

  1. To make sure you don't lose your MariaDB data DO NOT use docker-compose down (Docker will destroy volumes), instead use docker-compose stop. Alternatively, you can specify manual volume for /var/lib/mysql (see compose file), this way your data will always persist
  2. To avoid potential problems with permissions between your host and containers please follow this instructions
  3. For macOS users: Out of box Docker for Mac has poor performance on macOS. However there's a workaround based on docker-sync project, read instructions here
  4. For better reliability we release images with stability tags (e.g. wodby/wordpress-php:7.1-X.X.X) which correspond to git tags. We strongly recommend using images only with stability tags.


There 2 options how to use docker4wordpress – you can either run vanilla WordPress from the image or mount your own WordPress codebase:

1. Run Vanilla WordPress from Image (default)

  1. Download docker-compose.yml file from the latest stable release
  2. Run containers: docker-compose up -d (it may take some time for them to initialize)
  3. Configure domains
  4. That's it! Proceed with WordPress installation at http://wp.docker.localhost:8000. Default database user, password and database name are all wordpress, database host is mariadb
  5. You can see status of your containers and their logs via portainer: http://portainer.wp.docker.localhost:8000

2. Mount my WordPress Codebase

  1. Read must know before you start
  2. Download docker-compose.yml file from the latest stable release to your WordPress project root
  3. Replace php image from wodby/wordpress (PHP + vanilla WordPress) to wodby/wordpress-php (just PHP)
  4. Update nginx/apache and php volumes to - ./:/var/www/html to mount your codebase
  5. Ensure your wp-config.php has the same credentials as mariadb service
  6. Optional: import existing database
  7. Optional: uncomment lines in the compose file to run redis, varnish, phpmyadmin (pma)
  8. Configure domains
  9. Run containers: docker-compose up -d
  10. That's it! Your WordPress website should be up and running at http://wp.docker.localhost:8000. If you need to run multiple projects simultaneously see this article
  11. You can see status of your containers and their logs via portainer: http://portainer.wp.docker.localhost:8000

You can stop containers by executing:

docker-compose stop

Also, read how to access containers and how to get logs


We're actively working on this instructions and containers. More options will be added soon. If you have a feature request or found a bug please submit an issue on GitHub or Wodby Slack join us on Slack

We update containers from time to time by releasing new images tags.


This project is licensed under the MIT open source license.