Docker Community Forums

Share and learn in the Docker community.

I need a tutorial to create a web server

Good morning,
I would need a tutorial to create a web server through docker. I don’t care if it’s nginx or Apache. The important thing is that it has PHP + MySQL.
Thanks in advance.
Nicola

I haven’t yet written the step-by-step that I think you’re looking for, but… I have deployed Wordpress (which uses Apache) in a container linked to MySQL in another container, and they work very well as a web server (currently in production hosting a couple dozen individual websites).

The short and not-fleshed-out set of steps is to deploy a 5.7 (not latest) version of this:
https://hub.docker.com/_/mysql
And then deploy the latest of this:
https://hub.docker.com/_/wordpress/
And then I’d highly recommend you secure it with this:
https://hub.docker.com/r/linuxserver/letsencrypt/
Also I really like managing my MySQL from a webgui instead of CLI (YMMV) so I also deploy one of these:
https://hub.docker.com/_/adminer/

I have it on my to-do list to actually do a writeup of the entire process I used to host a bunch of sites from a single VM, but that’s the tools I used to do it.

1 Like

sorry if I’m not a docker expert. should I use two separate containers and then use docker-compose?