Hello, fellow geeks and curious clickers,
Today we’re diving into something cool (and useful): running multiple WordPress sites on a single VPS. I’ve done this many times, and honestly, it’s saved me money, time, and even a bit of sanity.
If you’re like me, maybe you’ve got more than one idea for a website. Or you run blogs for a few friends, or maybe you just want to try new WordPress themes without paying for 10 different hosting plans. That’s where a VPS comes in handy.
Let’s break it down and go step by step—no complicated lingo, no sales pitch, just a straight-up, practical guide. And yes, I promise to throw in a few puns here and there. Because what’s life without some byte-sized humor?
What is a VPS?
VPS stands for Virtual Private Server. Imagine a big apartment building (the physical server), and you have your own private apartment (the VPS). You get your own space, your own keys, and you don’t have to share your closet with noisy neighbors.
Unlike shared hosting (where many websites use the same resources), a VPS gives you more control. You can install whatever you want, tweak settings, and reboot things if needed. It’s like having your own little web lab.
Why Run Multiple WordPress Sites on One VPS?
Here’s why I like doing it:
- It saves money. One VPS, multiple sites. Simple math.
- You learn a lot. You’ll get better at Linux, Nginx or Apache, and file management.
- It’s more flexible. Add sites, remove them, try new plugins—all in one place.
Sound interesting? Let’s get to it.
What You’ll Need
Before you begin, make sure you have:
- A VPS with at least 2 GB RAM (more is better).
- Ubuntu 20.04 or newer (that’s what I’m using).
- A domain name (or two, or five).
- Basic knowledge of Linux commands.
- A good attitude—because sometimes things don’t go right the first time.
Step 1: Set Up the VPS
When you first get your VPS, you’ll usually log in using SSH like this:
ssh root@your-server-ip
The first thing I do (and you should too) is update the system:
sudo apt update && sudo apt upgrade -y
Then install some important stuff:
sudo apt install nginx mysql-server php-fpm php-mysql unzip -y
These tools are the base. Nginx serves your websites. MySQL stores your site data. PHP runs WordPress. Unzip helps you unzip (duh).
Step 2: Set Up MySQL
WordPress needs a database. Let’s create one:
sudo mysql
Inside the MySQL prompt, run this (change names if you want):
CREATE DATABASE site1_db;
CREATE USER 'site1_user'@'localhost' IDENTIFIED BY 'strongpassword';
GRANT ALL PRIVILEGES ON site1_db.* TO 'site1_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Repeat this later for each new site.
Yes, you’ll have one database per site. It’s like giving each site its own locker. No mix-ups.
Step 3: Download WordPress
I like to keep my sites in /var/www/
. So for the first site:
cd /var/www/
sudo wget https://wordpress.org/latest.zip
sudo unzip latest.zip
sudo mv wordpress site1.com
Now the files are in a folder called site1.com
. Replace that with your real domain name.
Set the right file permissions:
sudo chown -R www-data:www-data /var/www/site1.com
sudo chmod -R 755 /var/www/site1.com
Step 4: Set Up Nginx for the First Site
Now we tell Nginx how to serve this site.
Create a new config file:
sudo nano /etc/nginx/sites-available/site1.com
Paste this in:
server {
listen 80;
server_name site1.com www.site1.com;
root /var/www/site1.com;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
Now link it to the active sites:
sudo ln -s /etc/nginx/sites-available/site1.com /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
If everything checks out, your first site is ready on the web (once DNS is set up—more on that below).
Step 5: Set Up DNS for Each Site
Go to your domain registrar (like Namecheap or GoDaddy). Set the A record for each domain to your VPS IP.
It might take a few minutes (or hours, depending on your registrar).
While you wait, maybe grab a snack. I recommend cookies. Because… you know, browser cookies. 🍪
Step 6: Install WordPress for the First Site
Now go to http://site1.com
in your browser.
You’ll see the WordPress setup screen.
Fill in the database info you created earlier:
- DB Name: site1_db
- Username: site1_user
- Password: (the one you typed earlier)
- DB Host: localhost
Then finish the setup.
Boom, your first site is live.
Step 7: Add More Sites
Repeat steps 2–6 for each site:
- New folder in
/var/www/
(e.g.,site2.com
) - New database and user in MySQL
- New Nginx config file for
site2.com
- New DNS A record for
site2.com
Each site is separate. Think of them as roommates. They live on the same server but have their own rooms and passwords.
Benefits of Hosting Multiple WordPress Sites
Here’s why this setup rocks:
- You save cash. No need to pay for five different hosting plans.
- You control everything. Install plugins, themes, even weird ones.
- Great for testing. Want to try a new design without breaking your main site? Create a sandbox site.
Things to Keep in Mind
Running multiple sites is cool, but you need to stay organized. Here are some tips:
- Backups matter. Use tools like rsync, UpdraftPlus, or mysqldump regularly.
- Watch your resources. More sites = more RAM and CPU. Use
htop
to monitor. - Security counts. Keep everything updated. Install a firewall like
ufw
.
Quick Recap Checklist
Here’s a summary to help you remember the steps:
- ✅ Set up your VPS with Nginx, MySQL, PHP
- ✅ Create a folder and database for each site
- ✅ Configure Nginx for each domain
- ✅ Set up DNS and install WordPress
Funny Pun Time (Because You Earned It)
- What’s a web server’s favorite dance move? The cache shuffle.
- Why did the PHP file go to therapy? Too many unresolved requests.
- I tried to tell my WordPress site a joke, but it timed out.
Final Thoughts
Running multiple WordPress sites on one VPS is like hosting a party with many guests who all get along. It takes a bit of planning, but once it’s up and running, it’s smooth and efficient.
I’ve run up to 15 small sites on one $10 VPS. It felt like hosting a tiny city.
If something breaks, don’t stress. Mistakes are part of the learning. You’ll pick up new tricks, and maybe even fall in love with managing your own server (like I did).
Got questions? Want to see a follow-up about using HTTPS with Let’s Encrypt or managing updates? Let me know.
Happy hosting, friend. May your logs be short and your sites be snappy.