Would please clear this, Docker or Nginx Server Blocks ?


I just moving from shared host to here, I have 4 small WP sites, I need to host them in one droplet, I googled a lot, and got too many answers with many versions, I thought most of them are out dated.

So, I know that I can create virtual host with Nginx/Apache, but I came to know about Docker, and that confusing me, I do not need different DB and environment for each site since am the owner for all the sites, so should use docker, and virtual host will good for me?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Great, this cleared the picture. However, using Docker would require more RAM and CPU to setup the environment, right? Becuase I just set it up MySQL, and it takes around 150Mb of the 500.



Docker is used to package an application and all its dependencies in one package called docker image which can be ran on any Linux machine and get your application up and running, it could be used to create development environments and also it can be used in production environment too with help from tools such as Kubernetes.

In your case, if your different sites do not have conflicting dependencies and all of them use the same version of PHP and all of its extensions then it is safe to host them using virtual hosts, however if you would like more control over the PHP version used in each one and all its dependencies then you can create multiple docker containers and host your code in each one of them separately and at the same time use nginx reverse proxy to serve your application from each docker container on a specific port.

Hope this helps.

Thank you for being helpful.