By avergara08
What would be best? A single droplet with high specs containing 4-6 websites? Or 6 droplets (1 for each)?
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!
Accepted Answer
Hello,
Great question! When considering hosting multiple domains on DigitalOcean, it’s also crucial to factor in the security implications. Let’s delve into this aspect along with the previously discussed topics.
No Hard Limits on Domains: Indeed, DigitalOcean allows you to host any number of domains on a single Droplet. This flexibility is one of the many advantages of their cloud infrastructure.
Understanding Resource Constraints: As mentioned earlier, each Droplet has limited CPU, RAM, and storage. Hosting multiple websites means these resources are shared, which can impact performance, especially if one site experiences high traffic or a resource-intensive process.
Security Considerations: When hosting multiple domains on a single Droplet, there’s an added dimension to consider: security. If one of the sites gets compromised (e.g., through a hack or a DDoS attack), it could potentially affect the other sites hosted on the same Droplet. Here’s why:
Isolation Strategy: For enhanced security, especially when dealing with high-traffic or sensitive websites, consider using separate Droplets for each domain. This isolation approach offers several advantages:
Setting Up Virtual Hosts: To host multiple domains, you’ll be setting up what’s known as virtual hosts. This is where you configure your web server to serve different content based on the requested domain name.
Apache Example: In Apache, this is done through the <VirtualHost>
directive in the configuration files. You specify the domain name and document root for each site. It looks something like this:
<VirtualHost *:80>
ServerName example.com
DocumentRoot /var/www/example
</VirtualHost>
https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-20-04
Nginx Example: With Nginx, you use the server
block. You’ll define a server block for each domain, specifying the server name and the root directory. Here’s a basic example:
server {
listen 80;
server_name example.com;
root /var/www/example;
}
While hosting multiple domains on a single Droplet is feasible and resource-efficient, it’s important to weigh the security implications. Isolating domains on separate Droplets can offer greater security and performance customization, albeit at a higher cost. Always assess your needs and the sensitivity of your websites when deciding on your hosting strategy.
I hope this provides a clearer picture of the security considerations in multi-domain hosting!
Best,
Bobby
It really depends on how busy the sites are… I personally know people who have 50+ low traffic sites on a 2GB VPS instance (including cPanel - MySQL, Apache, Mail + DNS services). <br> <br>
While its depend on use case, i suggest you to get 2 medium droplet. One for Database and one for website(nginx+X)
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.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.