Build a solid WordPress dev environment with Docker

#wordpress erste schritte –>


By loading the video, you agree to YouTube's privacy policy.
Learn more

Load video

In this 25 minute video, I’ll show you how to create and use a basic WordPress development environment built with Docker and Docker Compose.

Follow me on Twitter for more web development tips, news, and tutorials:

You’ll learn how to:

– Install and setup Docker
– Create a Docker Compose file to scaffold out containers
– Enable HTTPS and keep MySQL data persistent
– Use the wp-cli tool without having to install it locally

– 0:00 Intro and Setup
– 2:50 Scaffolding Containers
– 6:10 Configuring Nginx
– 10:10 Installing WordPress
– 15:06 Adding HTTPS
– 19:00 Persistent MySQL Data
– 20:58 Adding wp-cli
– 24:42 Conclusion

Docker documentation about delegated volumes for MacOS:

Andrew Schmelyun



  1. If you'd like to see the full code along with some additional helper items, check out the GitHub repo here:

  2. Nice explanation, really appreciate what you have done but there are issues with the new M1 chip.
    Thank again

  3. Excellent video. Could not be better explained. Thanks for sharing this.

  4. Excelent! Thank you. Unfortunately, I get a 403 Forbidden after setting up the default.conf file. Has anyone gotten the same error?

  5. Thank you very much Andrew! You can't imagine how much you've helped me understand how docker and docker -compose work. The configurations inside the containers is something I did not find anywhere else … thank you so much for your generosity!

  6. thanks!

  7. thanks, Andrew! I learn a lot!

  8. An excellent and informative lesson, Thank you so much.

  9. thanks for the great tutorial. I am following along, checked 100 times, and maybe there has been some changes with docker. 

    01. When I try to perform the setup I get the error "Error establishing a database connection". I used everything as you have it.

    Is there a solution that you may recommend, please?

    02. It seems that it redirected automatically from "localhost" to "wordpress-docker.test", it doesn't do this automatically for me. Was there something that you did in between?

  10. Just awesome buddy! Keep going. I have watched lots of videos on Docker but your way of explanation is super easy. Thanks a lot to make things easier.

  11. Hey Andrew, thank you for the great video, im learning a lot. However i did run into a problem. When i try to copy the nginx/default.conf into the container the container shows as Exited (1) when running docker ps. Do you happen to know why ? thank you.

  12. Hi Thank you for the video, very helpful. What is entrypoint: ['wp', '–allow-root'] for?

  13. Hello Andrew, I have just started getting into Docker and I was following along on this video when I ran into a snag. I got up to about the 9:50 mark, when I started the container that went fine, but when I tried refreshing the browser to start WordPress I am getting a 403 Forbidden error. I carefully looked over the code, and I am not seeing anything amiss. Hoping for some advice. Thank you

  14. how to run it into digital ocean now.

  15. awesome tutorial, thanks

  16. Great, thanks a lot. The only think I'm not getting right is the certs. Chrome says it's not good. Cheers.

  17. This might be the best dev. tutuorial on the internet – the simplicity of the start that leads the viewer to an explanation of very complex solution while solving problems as they arrive is so gratifying to watch, combined with clear spoken Engish and being on point.

  18. Great video! I hope i can see more like this;) … But i have a problem, when i will change my port e.g. localhost:8090, i can't understand, where i make the config change, when i made only the change at the docker-compose ports-8090:80, i recieved an error on the browser (EMPTY_RESPONSE)… Can anyone help me?

  19. Hi Andrew, thank you for the great video!
    Unfortunately there is a problem, after I added an /nginx folder to store default.conf and make docker-compose up -d again, what I see is not WP's installation page but '403 Forbidden' page by nginx, could you tell me what happen? I use WSL on Windows 11. Thanks!

  20. how can i clone my current wordpress live site to this new docker wordpress

  21. All good until 9:50 … Then all I get is a "403 Forbidden" response from server. Any one else encountered this?

  22. Great tutorial, thanks.
    If one would like to use this with apache server, how would default.conf file Look like for apache?
    Thank you

  23. I am having problems with permissions. It would appear as if the container uses a user called "82 [82]". It is breaking a lot of things in WordPress like media and plugins, along with updates. If anyone has the time to help please give it. I don't know how to share permissions with a user that is in a docker container.

Comments are closed.