Shared Hosting vs VPS: Signs It Is Time to Upgrade
Shared hosting is the right start for most sites, but there comes a point when a VPS is the better value. How the two compare and the signals that tell you it is time to…
A complete, beginner-friendly guide to installing WordPress on your own Ubuntu VPS with Nginx, PHP-FPM and MariaDB, then securing it with HTTPS, caching and sensible hardening.
Installing WordPress on your own VPS gives you full control over performance, PHP settings and security, and lets you host several sites on one server. It takes about 30 to 45 minutes the first time. This guide uses Ubuntu 24.04 with Nginx, PHP-FPM and MariaDB, a popular and efficient combination.
If you want WordPress without managing a server, shared hosting is simpler: Cloud Grow ($3.58 a month) includes cPanel, LiteSpeed, free SSL and daily backups for up to five sites. Choose a VPS when you need more resources, custom configuration or root access. Our shared vs VPS guide helps you decide.
Each component has a clear job. Nginx receives web requests, serves static files such as images and stylesheets directly, and passes PHP requests on. PHP-FPM runs WordPress's PHP code in a pool of worker processes. MariaDB, a drop-in MySQL replacement, stores posts, settings, users and orders. Knowing this helps with troubleshooting: a 502 error points to PHP-FPM, a database connection error to MariaDB, and a 404 on every page except the homepage to the Nginx rewrite rules.
On a 2 GB VPS, this stack typically uses a few hundred megabytes at idle, leaving plenty of room for PHP workers and database buffers. As traffic grows, the number of PHP-FPM workers and the MariaDB buffer pool are the two settings most worth tuning.
Log in as root, then create a user, set up SSH keys, enable the firewall and update packages:
adduser deploy
usermod -aG sudo deploy
apt update && apt upgrade -y
ufw allow OpenSSH
ufw enable
Our VPS security checklist covers SSH keys, disabling password login and automatic updates.
Create an A record for example.com and www pointing to your VPS IPv4 address, and an AAAA record for IPv6 if you use it. Doing this early gives DNS time to propagate before you request SSL. See how to point a domain to your server.
sudo apt install nginx mariadb-server php-fpm php-mysql php-curl php-gd \
php-intl php-mbstring php-xml php-zip php-imagick
sudo ufw allow "Nginx Full"
Secure MariaDB:
sudo mariadb-secure-installation
Answer the prompts to remove anonymous users, disallow remote root login and remove the test database.
sudo mariadb
CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'use-a-long-random-password';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wpuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
cd /tmp
curl -O https://wordpress.org/latest.tar.gz
tar xzf latest.tar.gz
sudo mkdir -p /var/www/example.com
sudo cp -a wordpress/. /var/www/example.com/
sudo chown -R www-data:www-data /var/www/example.com
cd /var/www/example.com
sudo -u www-data cp wp-config-sample.php wp-config.php
sudo -u www-data nano wp-config.php
Set DB_NAME, DB_USER and DB_PASSWORD. Replace the authentication keys and salts with fresh values from the official WordPress secret-key generator. Add define('DISALLOW_FILE_EDIT', true); to disable the built-in theme and plugin editor.
Create /etc/nginx/sites-available/example.com (adjust the PHP socket to match your installed version, for example php8.3-fpm.sock):
server {
listen 80;
listen [::]:80;
server_name example.com www.example.com;
root /var/www/example.com;
index index.php;
client_max_body_size 64M;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
}
location ~ /\.(?!well-known) {
deny all;
}
location ~* \.(css|js|jpg|jpeg|png|gif|webp|svg|ico|woff2)$ {
expires 30d;
access_log off;
}
}
sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d example.com -d www.example.com
Choose to redirect HTTP to HTTPS. Certbot sets up automatic renewal; test it with sudo certbot renew --dry-run.
Visit https://example.com, choose your language, and create the admin account. Use a unique username (not "admin") and a strong password, and use an email address you check.
Edit /etc/php/8.3/fpm/php.ini and adjust:
upload_max_filesize = 64M and post_max_size = 64Mmemory_limit = 256Mopcache.memory_consumption=128Restart with sudo systemctl restart php8.3-fpm.
sudo apt install redis-server php-redis) and a Redis object cache plugin to speed up database-heavy sites.define('DISABLE_WP_CRON', true); and a system cron entry to run wp-cron.php every five minutes.wp-login.php and xmlrpc.php with Nginx rules or fail2ban.www-data and avoid 777 permissions.Back up the database (with mysqldump) and the wp-content directory daily, and keep copies off-site. Test restores. Our 3-2-1 backup guide shows a complete approach.
| Problem | Likely cause | Fix |
|---|---|---|
| 502 Bad Gateway | Wrong PHP-FPM socket path or PHP-FPM stopped | Check socket in Nginx config; restart php-fpm |
| Database connection error | Wrong credentials in wp-config.php | Check DB name, user and password |
| Permalinks return 404 | Missing try_files rule | Use the location / block above |
| Upload size error | Limits too low | Raise PHP limits and client_max_body_size |
| Plugin asks for FTP details | File ownership incorrect | chown files to www-data |
Updates fix security issues, so delaying them is risky, but an update can occasionally break a theme or plugin. A safe routine is to enable automatic minor core updates, review plugin updates weekly, and take a quick backup before applying them. For important sites, clone the site to a staging subdomain on the same VPS, apply updates there first and check key pages before updating production. WP-CLI makes this faster: wp plugin update --all and wp core update can be scripted after a backup step.
Set up an external uptime monitor that checks your homepage for a specific word, so you catch both outages and PHP errors. Watch disk space and memory with simple alerts, and review the Nginx error log and PHP-FPM log after updates. WordPress's built-in Site Health screen also flags outdated PHP versions, missing extensions and failed scheduled events.
Repeat steps 4 to 8 for each site with its own database, user, directory and Nginx server block. Keep an eye on RAM as you add sites, and resize the VPS when usage regularly exceeds about 75 percent.
Deploy a Linux VPS with Ubuntu 24.04 in one of ten Standard locations, pay with crypto, and follow these steps to have WordPress running in under an hour.
No. Shared hosting with LiteSpeed handles most WordPress sites with less maintenance. A VPS makes sense for busy sites, custom stacks or several sites with full control.
1 GB can run a small site with careful tuning, 2 GB is comfortable for one or two sites, and 4 GB suits WooCommerce or several busy sites.
Use a currently supported PHP version that WordPress recommends. Ubuntu 24.04 ships PHP 8.3.
Both work well. Nginx with PHP-FPM is efficient and popular on VPS. Apache is simpler if you rely heavily on .htaccess rules.
Use Certbot with Let's Encrypt once your domain points to the server. It installs and renews certificates automatically.
Plans in this article
Keep reading
Shared hosting is the right start for most sites, but there comes a point when a VPS is the better value. How the two compare and the signals that tell you it is time to…
Store hosting is different from blog hosting: carts and checkouts cannot be cached, databases are busier and downtime costs money. How to pick and size the right plan fo…
Three popular hosting control panels, three different strengths. A fair comparison to help you choose, plus when shared hosting with cPanel included is the smarter route.