Host multiple websites in one droplet

Posted September 7, 2014 156.6k views

Hello guys, Is it possible to run like 2 or 3 websites on 1 droplet or do I need to buy another droplet with for each website? If its possible how do I manage this? Does it work like virtual hosts ? Any tutorial or feedback would be nice :)

  • Yes, it’s just like virtual hosts. Just point the second domain to the DigitalOcean nameservers and follow this tutorial:

    If you’re using Apache, it’s pretty much the same. You can follow this tutorial:

    by Justin Ellingwood
    The Apache web server is the most popular way to serve web content on the internet. Apache has the ability to serve multiple domains from a single server by using a mechanism called "virtual hosts". If a virtual host is configured correctly for each domain, the web server can correctly route traffic to the appropriate files based on the domain name requested. In this guide, we'll demonstrate how to configure Apache virtual hosts on an Ubuntu 14.04 VPS.
  • If you have a nice fat droplet you can put quite a few domains on there and give them a gig of memory each. 1 gb of memory with fast computing and aws route 53 or google cloud to manage dns records - you can literally run (IMO) 1 application/domain per GB of ram and a half of a cpu. NGINX all the way - DO is how we started. That’s what got my wheels turning and it’s so easy to spin up a droplet. Security precautions have to be taken - but get apparmor and some ssl certs, you will be just fine. I don’t even mess with Apache at all. NGINX is so much simpler - anyone that says otherwise is nuts! Comodo (no I’m not an affiliate and their certs are a real pain to install - but once you do it once, it’s easy). They have multidomain certs (sans) and they actually cover subdomains too so it’s like having one cert that covers everything. 29 bucks! That’s for 3 but it’s like 2 dollars for each additional domain which is not bad at all.

  • Nobody pays for certificates no more, check out LetsEncrypt for a free one… You can include sub-domains too.

  • by Justin Ellingwood
    Nginx is an incredibly powerful web server and reverse proxy. In this guide, we'll discuss how to set up server blocks on Ubuntu 14.04 in order to server multiple domains from a single server.
  • Show 2 more comments

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
9 answers
by Etel Sverdlov
This tutorial shows you how to set up a new directory, how to grant the correct permissions, how to add content to a new page, how to turn on virtual hosting, and how to, if needed, set up local hosts. Virtual Hosts are used to run more than one domain off of a single IP address and allows you to run multiple sites off of a single DigitalOcean droplet. This tutorial describes how to set up virtual hosts with Apache.

My curiousity though is getting https on multiple domains on a single IP. Also choosing whether or not pages are server via secure port or 80. I’m trying nginx plus - but I’m not feeling any difference between that and mainline or stable.

What about MX records, how do you set up for multiple domains hosted on one droplet?

I would just like to add this helped me just now. Thanks :)

Here is complete tutorial for hosting Multiple websites in single VPS server without purchasing amazon route53 check this link for full tutorial

Guys. All the links seems not to work. Do you have a new link with a tutorial?
Thanks for your help