Hosting Multiple Lightweight Sites on a Linux VPS
Running a few small sites should not break your budget. If you pay for a separate shared hosting plan for every single client, blog, or project, your monthly bills will go up fast. The most cost-effective solution is to host multiple websites on one VPS. By doing this, you get better control, fixed costs, and great performance.
In this guide, we will explore the cheapest way to set this up using Linux, while keeping your sites secure, fast, and properly isolated.
Table of Contents
When to host multiple websites on one VPS and when to keep them apart
Before you build the server, you need to know if combining sites is the right choice. Consolidating your hosting has clear pros and cons depending on your exact traffic and security needs.
When to host multiple websites on one VPS:
If you run local business sites, personal portfolios, or small WordPress blogs, you should absolutely host multiple websites on one VPS. These types of lightweight sites use very little RAM and CPU, so you save money, and it is easier to manage all your files and databases in one central location.
When to separate them:
As you may know, you will face a noisy neighbor problem if one of your sites suddenly gets huge traffic spikes. If a viral blog post eats up all your server’s RAM, the other sites on the same machine will slow down or crash completely. Also, if you run a large online store that handles sensitive payment data, it needs its own dedicated server for better security and strict compliance.
Here are some useful steps to build your server to host multiple websites on one VPS:
Step 1. Get the Right Linux Server for Lightweight Sites
To start, you need a proper VPS with enough resources. For one or two very lightweight sites, 2GB of RAM is an okay starting point. But if you plan to run three or four sites, or if you want to add a web control panel later, you want at least 4GB of RAM and 2 CPU cores. If you plan to isolate your sites using containerization, check out this guide on the best Linux VPS for Docker projects to understand exactly how much CPU and RAM your containers will need to run smoothly.
If you want a reliable and affordable foundation, you can consolidate your sites on a PerLod Linux VPS. This gives you the root access needed to host multiple websites on one VPS without paying high premium fees.
Ubuntu is the most popular Linux distribution for this task, so we will use Ubuntu for our examples.
Step 2. Server Preparation and Security Basics
If you plan to host multiple websites on one VPS, server security is your first priority. Remember that you never run your web apps as the main root user.
You can update your server packages, so you have the latest security patches:
sudo apt update && sudo apt upgrade -y
Next, you can enable the firewall and open ports for web traffic 80 and 443, and the SSH port 22:
sudo ufw allow 'Nginx Full'
sudo ufw allow OpenSSH
sudo ufw enable
After setting up your basic firewall rules, we highly recommend taking a few extra minutes for Linux VPS SSH hardening. Setting up SSH keys and changing the default port will protect your server from automated bot attacks.
Step 3. Nginx Reverse Proxy Setup
Nginx is a great choice because it uses fewer system resources than Apache when handling high traffic. We will use Nginx as our web server to listen for internet traffic and route it to the right website files.
Install Nginx with:
sudo apt install nginx -y
To host multiple websites on one VPS, Nginx operates as a reverse proxy and uses a system called server blocks. You create a small text file for each domain, telling the server which folder holds that specific site’s files.
To create the web directories, you can use:
sudo mkdir -p /var/www/site1.com/html
sudo mkdir -p /var/www/site2.com/html
Make sure you set the right permissions so Nginx can read the files, keeping them organized and isolated from each other.
Next, you must create a configuration file in /etc/nginx/sites-available/site1.com that points to the folder you just created.
You can repeat this quick process for every site you want to add.
Step 4. Isolation and Resource Limits
The biggest risk when you host multiple websites on one VPS is that one busy site uses all the hardware power, which starves the rest. You have two main ways to prevent this and isolate your resources:
- PHP-FPM Pools: If you run PHP sites like WordPress, create separate PHP-FPM pools for each domain. You can limit how many PHP processes each site is allowed to spawn. If Site A gets overloaded, Site B still runs perfectly.
- Docker Containers: For even stronger isolation, put each site in its own Docker container. Docker lets you set hard limits on memory and CPU. For example, you can tell Docker that Site 1 can never use more than 512MB of RAM.
For extra safety, you can configure a swap file. If your RAM gets full, the swap file acts as emergency backup memory on your hard drive, which prevents your sites from crashing entirely.
However, to keep your sites running fast, you should understand swap usage on Linux servers and adjust your swappiness value so the server prioritizes your fast physical RAM over slower disk space.
Step 5. Connect Your Domain Names
Before you can successfully host multiple websites on one VPS, your DNS settings need to point internet traffic to your new server. Your server is ready, but nobody can find it yet without a domain name.
You must log in to your domain registrar. Find the DNS settings and add an A Record for each website and point the Host to your Linux server’s public IP address.
If you need to register new domains for your projects, you can check PerLod’s Domain Management to manage your domains and your hosting hardware in the exact same ecosystem.
Once your DNS updates across the world, you are ready to secure the setup.
Step 6. Free SSL Certificates for Every Site
Every single website needs an HTTPS connection, and Let’s Encrypt provides free SSL certificates that you can install in seconds.
Install the Certbot tool for Nginx:
sudo apt install certbot python3-certbot-nginx
Then, run this command for each of your sites:
sudo certbot --nginx -d site1.com -d www.site1.com
Certbot will automatically edit your Nginx server blocks to route traffic securely. It also sets up a background task to renew the certificates automatically before they expire every 90 days. It is the easiest way to manage SSL when you host multiple websites on one VPS.
Step 7. Automated Backups and Database Management
When you host multiple websites on one VPS, a single server crash means all your client projects or blogs go down at once. You must have automated off-site backups.
Also, you isolate your databases. Never use one global database user for all your websites; instead, create a unique MySQL or PostgreSQL user and a separate database for each site. This way, if a hacker breaks into one website, they cannot access the data from your other sites.
To handle backups, write a simple bash script that does three things:
- Zips the entire /var/www/ folder.
- Creates an exact copy of your databases.
- Sends the zip file to a cheap external storage drive.
If you want to make sure your backups are completely reliable and not corrupted, you can follow this guide to build a bash automated backup integrity script. This script will automatically verify the SHA-256 checksums of your files so you know they are safe to restore. Schedule this script using a daily Cron job, so your backups happen securely while you sleep.
Conclusion
Learning how to set up a server properly is one of the best technical skills for small business owners, web agencies, and developers. It lowers your monthly bills while giving you total control over the server environment. As long as you respect the hardware limits, use Nginx for smooth traffic routing, and separate your sites with PHP pools or Docker containers, you will build a highly efficient and stable system.
When you are ready to start, grab a server, configure your domain, and host multiple websites on one VPS to maximize your technical budget.
We hope you enjoy this guide.
FAQs
Is it safe to put multiple sites on one server?
Yes, it is safe if you configure proper isolation. Using separate system user accounts, unique database credentials, and containerization ensures that if one site gets hacked, the others remain secure.
Will my websites slow down if they share hardware?
They will only slow down if they compete for limited resources. By setting up memory limits per site and caching your content, you can easily host multiple websites on one VPS without performance drops.
How much RAM do I need for 5 small WordPress sites?
For 5 small websites with low traffic, 4GB of RAM is the recommended minimum. This gives the web server, the database, and the operating system enough space without relying heavily on slow swap memory.