I am new to VPS hosting and just set up my first Droplet with Ubuntu 22.04 and Nginx. I currently have one website running fine, but I have two more small sites I want to host.
Do I need a separate Droplet for each website, or can I run all three on the same one? If yes, how does that work exactly?
Thanks
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!
Hi there,
You absolutely can run multiple websites on a single Droplet, and for small sites it makes a lot of sense. No need to spin up separate Droplets.
The way it works with Nginx is through server blocks (similar to virtual hosts in Apache). Each site gets its own config file that tells Nginx which domain to respond to and where the site files live.
A basic setup looks like this:
server {
listen 80;
server_name site2.com www.site2.com;
root /var/www/site2;
index index.html index.php;
}
You create one file like this per site in /etc/nginx/sites-available/, symlink it to sites-enabled, and reload Nginx:
sudo ln -s /etc/nginx/sites-available/site2 /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
Point each domain’s DNS to the same Droplet IP and Nginx handles routing traffic to the right site based on the domain name.
For SSL, Certbot handles multiple domains on the same server without any issues:
sudo certbot --nginx -d site2.com -d www.site2.com
A 1GB Droplet can comfortably handle several low traffic sites. Just keep an eye on memory if you are running PHP-FPM for multiple sites at once.
Heya, @473f85d1ecb2425db92bb6a5a072ce
Yep totally fine, that’s actually the normal way to do it. One Droplet, multiple sites, Nginx handles the routing via server blocks (virtual hosts).
Basic idea is each site gets its own config file in /etc/nginx/sites-available/ that tells Nginx which domain maps to which folder. Nginx looks at the incoming domain name and serves the right site.
Quick example for a second site:
nginx
server {
listen 80;
server_name site2.com www.site2.com;
root /var/www/site2;
index index.html index.php;
}
Save it, symlink to sites-enabled, reload Nginx and you’re done. Repeat for the third site.
Just make sure your DNS for each domain points to the same Droplet IP and Nginx will take care of the rest. For SSL you can run Certbot per domain - it handles multiple sites on the same server no problem.
Three small sites on a single Droplet is totally fine resource-wise unless they’re getting serious traffic.
Regards
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.