Local WordPress Development with Docker: 3 Easy Steps

The Quick and Dirty

https://gist.github.com/tatemz/504383c921aa5898c49b82d4ee181362#file-docker-wordpress-sh

1 - Setup docker-compose

$ mkdir wordpress-site && cd wordpress-site
$ touch docker-compose.yml

2 - Create Your Containers

my-wpdb:
image: mariadb
ports:
- "8081:3306"
environment:
MYSQL_ROOT_PASSWORD: ChangeMeIfYouWant
my-wp:
image: wordpress
volumes:
- ./:/var/www/html
ports:
- "8080:80"
links:
- my-wpdb:mysql
environment:
WORDPRESS_DB_PASSWORD: root

3 - Run and Connect

$ docker-compose up -d
$ docker-compose logs -f
$ docker-compose stop
$ docker-compose up -d

Developer, husband, and DIY farmer.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
A. Tate Barber

A. Tate Barber

Developer, husband, and DIY farmer.

More from Medium

Speed up your WordPress debugging skills using plugins, logs, and a local development environment—…

How to manage your Materialize migrations with Laravel Zero?

How to Deploy The Laravel APP on AWS EC2

macOS Monterey Port 5000