How do I Host 3 static sites in 1 Droplet

Posted October 23, 2016 4.2k views
UbuntuConfiguration ManagementUbuntu 16.04

I have 3 different domains and I want to host them in the same droplet. Any idea how can I do it? My idea is create a droplet with 16.04.1 x64 but then I have not idea what I have to do. Any suggestion? thanks.

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.

Submit an Answer
2 answers

That depends on web server you are using. To host anything you will need to have web server. You can chose between Apache or Nginx.

How to install LAMP stack will get you covered for Apache (and PHP/MySQL).
There is also How to install LEMP stack. Only difference between LAMP and LEMP is that LAMP is based on Apache Web server and LEMP is based on Nginx (Engine-X) Web server.
Also you can use One-Click Apps, which you can learn more about it - here.
Keep in mind, you chose only LAMP OR only LEMP

To setup multiple sites you will also have to setup virtual host (or also called server blocks on Nginx).
To setup Virtual Hosts on Apache - follow this tutorial.
If you decided to use Nginx, you must follow How To Set Up Server Blocks on Nginx.

by Brennen Bearnes
A "LAMP" stack is a group of open source software that is typically installed together to enable a server to host dynamic websites and web apps. This term is actually an acronym which represents the Linux operating system, with the Apache web server. The site data is...

I recommend using nginx instead of apache as it uses less memory. Does your websites use mysql??? Is yes the go for LEMP. Send me a message if you need help.

  • i am hosting only html page, not using any database

    • Then NGINX should be the way to go. In general, you will need to learn how to

      1.- Do a basic setup for an UBUNTU 16.04 server
      2.- Install Nginx on ubuntu 16.04 and setup virtual hosts for all your domains. (that implies how to create folders)
      3.- Create an SFTP account to upload your files to your website folders
      4.- Point your domains to your droplet’s IP

      There are many tutorials on how to do this on Digital Ocean, i recommend using those written by justin ellingwood.