Hosting WordPress on a VPS is one of the best upgrades you can make for speed, stability, and control.
But if you’re a beginner, it can feel intimidating because VPS hosting usually involves:
- SSH
- Linux commands
- installing web servers
- databases
- security steps
The good news?
You don’t need to be a sysadmin to do it.
In this guide, you’ll learn the easiest and safest way to host WordPress on a VPS in 2026 — with beginner-friendly options and a step-by-step setup.
Quick Overview (The 3 Ways to Host WordPress on a VPS)
There are 3 common ways:
Option 1: Managed VPS (Easiest)
The provider helps with:
- setup
- security
- updates
- troubleshooting
Best for: beginners, business owners.
Recommended guide: Best Managed VPS Hosting
Option 2: VPS + Control Panel (Beginner-friendly)
You install a control panel like:
- CyberPanel
- aaPanel
- Plesk
- cPanel (paid)
Best for: beginners who want UI management.
Option 3: VPS + Manual Setup (Most control)
You install everything yourself:
- Nginx or Apache
- PHP
- MySQL/MariaDB
- WordPress
- firewall
- SSL
Best for: developers, technical users.
What You Need Before You Start
1) A VPS with enough RAM
For WordPress:
- Minimum: 2GB RAM
- Recommended: 4GB RAM
- WooCommerce: 8GB+
Read next: VPS RAM requirements
2) A domain name
You’ll need your domain pointing to your VPS IP.
3) SSH access
Most VPS providers give you:
- an IP address
- a root password (or SSH key)
4) A WordPress-friendly VPS provider
If you want the best providers for WordPress:
➡️ Best VPS for WordPress (2026)
Step-by-Step: How to Host WordPress on a VPS (Beginner Setup)
This guide uses the most beginner-friendly modern stack:
✅ Ubuntu 22.04 / 24.04
✅ Nginx
✅ PHP-FPM
✅ MariaDB
✅ Free SSL (Let’s Encrypt)
This is the most common and reliable setup in 2026.
Step 1: Connect to Your VPS Using SSH
On Mac/Linux:
ssh root@YOUR_SERVER_IP
On Windows:
- Use Windows Terminal or PuTTY
If it asks “Are you sure you want to continue connecting?” type:
yes
Then enter your password.
Step 2: Update Your Server
Always start with updates:
apt update && apt upgrade -y
Step 3: Create a New User (Recommended)
Running everything as root is not ideal.
Create a new user:
adduser wpadmin
Give it a password.
Then add it to sudo:
usermod -aG sudo wpadmin
Now you can log in as wpadmin:
su - wpadmin
Step 4: Install the Web Stack (Nginx + PHP + MariaDB)
Install Nginx:
sudo apt install nginx -y
Install MariaDB:
sudo apt install mariadb-server -y
Install PHP + extensions:
sudo apt install php-fpm php-mysql php-curl php-gd php-mbstring php-xml php-zip php-intl -y
Step 5: Secure the Database
Run:
sudo mysql_secure_installation
Recommended answers:
- Set root password → Yes
- Remove anonymous users → Yes
- Disable remote root login → Yes
- Remove test database → Yes
- Reload privileges → Yes
Step 6: Create a Database for WordPress
Login:
sudo mysql
Run:
CREATE DATABASE wordpress_db;
CREATE USER 'wordpress_user'@'localhost' IDENTIFIED BY 'StrongPasswordHere';
GRANT ALL PRIVILEGES ON wordpress_db.* TO 'wordpress_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Step 7: Download WordPress
Go to web root:
cd /var/www/
Download WordPress:
sudo wget https://wordpress.org/latest.tar.gz
sudo tar -xvzf latest.tar.gz
Rename folder (optional):
sudo mv wordpress yourdomain.com
Step 8: Set Permissions
Set ownership:
sudo chown -R www-data:www-data /var/www/yourdomain.com
Set safe permissions:
sudo find /var/www/yourdomain.com -type d -exec chmod 755 {} \;
sudo find /var/www/yourdomain.com -type f -exec chmod 644 {} \;
Step 9: Configure Nginx for Your Domain
Create a config file:
sudo nano /etc/nginx/sites-available/yourdomain.com
Paste this:
server {
listen 80;
server_name yourdomain.com www.yourdomain.com;
root /var/www/yourdomain.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/php8.1-fpm.sock;
}
location ~* \.(jpg|jpeg|png|gif|css|js|ico|svg)$ {
expires max;
log_not_found off;
}
}
Note: Your PHP version may be different (8.1 / 8.2 / 8.3).
To check:
php -v
Enable the site:
sudo ln -s /etc/nginx/sites-available/yourdomain.com /etc/nginx/sites-enabled/
Test Nginx:
sudo nginx -t
Restart:
sudo systemctl restart nginx
Step 10: Point Your Domain to the VPS IP
Go to your domain registrar and set:
- A record:
yourdomain.com→ VPS IP - A record:
www→ VPS IP
Wait 5–30 minutes (sometimes longer).
Step 11: Install Free SSL (HTTPS)
Install Certbot:
sudo apt install certbot python3-certbot-nginx -y
Run:
sudo certbot --nginx
Follow prompts and choose:
✅ redirect HTTP → HTTPS
Step 12: Finish WordPress Setup in the Browser
Go to:
https://yourdomain.com
You’ll see the WordPress installer.
Enter:
- Database name:
wordpress_db - Username:
wordpress_user - Password:
StrongPasswordHere - Host:
localhost
Done.
Beginner Security Checklist (Very Important)
WordPress on a VPS is powerful — but it’s your responsibility.
Here are the basics:
✅ Enable a firewall
Install UFW:
sudo apt install ufw -y
sudo ufw allow OpenSSH
sudo ufw allow 'Nginx Full'
sudo ufw enable
✅ Disable root login (recommended)
This is optional for beginners, but it’s a strong security improvement.
✅ Keep your server updated
Run weekly:
sudo apt update && sudo apt upgrade -y
✅ Install backups
Most beginners skip this and regret it.
Recommended guide: VPS backup strategy
✅ Secure WordPress
Use:
- strong passwords
- limit login attempts
- update plugins/themes
The Easiest Alternative (For Beginners): Managed VPS
If all the steps above feel like too much, that’s normal.
Managed VPS exists for a reason.
You get:
- VPS performance
- expert support
- help with security
- less stress
Read next: Best Managed VPS Hosting
Common Beginner Mistakes (Avoid These)
❌ Choosing 1GB RAM for WordPress
It will run… until it doesn’t.
Read next: VPS RAM requirements
❌ Not setting up backups
A VPS can fail. You need backups.
❌ Forgetting firewall + updates
Unmanaged VPS servers get attacked constantly.
❌ Using weak passwords
This is still one of the biggest security issues.
FAQ: Hosting WordPress on a VPS
Is hosting WordPress on a VPS hard?
It can be, but with the right steps it’s manageable. For most beginners, managed VPS is the easiest route.
Can I host WordPress on a $5 VPS?
Yes, but it’s not recommended for serious websites. It’s okay for testing or a small blog.
Read next: Can you trust a $5 VPS?
Is VPS better than shared hosting for WordPress?
Yes. VPS hosting is usually faster, more stable, and more secure than shared hosting.
Read next: VPS vs Shared Hosting
Final Thoughts
Hosting WordPress on a VPS gives you:
- better speed
- better uptime
- more control
- room to scale
But it also comes with responsibility.
If you want full control, manual setup is worth learning.
If you want the easiest path, managed VPS is the best option.
Next Step
If you want the best providers for WordPress VPS hosting, start here:
