How to Speed Up WordPress on a VPS (2026)
Moving WordPress from shared hosting to a VPS fixes the resource contention problem but does not automatically make your site fast. A poorly configured VPS can actually be slower than a well-tuned shared host. Here is how to squeeze real performance out of WordPress on a Linux VPS.
⚡ WordPress VPS from $5/mo — Use code LAUNCH2026 for 50% offStep 1: Use Nginx Instead of Apache
Apache is fine but Nginx handles concurrent connections more efficiently and uses less RAM. If you set up WordPress with a LEMP stack (Linux + Nginx + MySQL + PHP), you are starting in a better position than LAMP.
The key Nginx setting for WordPress is the try_files directive that handles pretty permalinks:
location / {
try_files $uri $uri/ /index.php?$args;
}
Step 2: Tune PHP-FPM
PHP-FPM's default settings are conservative. For a VPS with 1GB or more of RAM, increase the pool size:
sudo nano /etc/php/8.3/fpm/pool.d/www.conf
Change these values:
pm = dynamic
pm.max_children = 20
pm.start_servers = 5
pm.min_spare_servers = 3
pm.max_spare_servers = 8
pm.max_requests = 500
sudo systemctl restart php8.3-fpm
Step 3: Enable OPcache
OPcache stores compiled PHP bytecode in memory so PHP does not have to reparse your files on every request. It is one of the highest-impact changes you can make:
sudo nano /etc/php/8.3/fpm/php.ini
Add or update these lines:
opcache.enable=1
opcache.memory_consumption=256
opcache.interned_strings_buffer=16
opcache.max_accelerated_files=10000
opcache.revalidate_freq=0
opcache.validate_timestamps=0
sudo systemctl restart php8.3-fpm
Step 4: Install a Caching Plugin
Server-side caching stores generated HTML pages so PHP and MySQL do not run on every request. WP Super Cache and W3 Total Cache are the most common options. For the best performance on Nginx, use WP Fastest Cache or LiteSpeed Cache with the disk caching method.
The goal is to serve cached HTML files directly from Nginx without hitting PHP at all for repeat visitors. Configure your caching plugin to generate static files and add this to your Nginx config:
set $cache_uri $request_uri;
if ($request_method = POST) { set $cache_uri 'null cache'; }
if ($query_string != "") { set $cache_uri 'null cache'; }
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
set $cache_uri 'null cache';
}
location / {
try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php?$args;
}
Step 5: Use a CDN for Static Assets
Images, CSS, and JavaScript files do not need to be served from your VPS on every request. Cloudflare's free plan caches and serves these files from their global network. Point your domain through Cloudflare, enable caching, and your static assets load from the nearest Cloudflare edge location instead of your server.
Step 6: Optimize Your Database
WordPress databases accumulate post revisions, spam comments, and transients over time. Clean these up with WP-Optimize or run these MySQL queries directly:
DELETE FROM wp_posts WHERE post_status = 'auto-draft';
DELETE FROM wp_postmeta WHERE post_id NOT IN (SELECT id FROM wp_posts);
DELETE FROM wp_options WHERE option_name LIKE '_transient_%';
OPTIMIZE TABLE wp_options, wp_posts, wp_postmeta, wp_comments;
What to Expect
A properly configured WordPress installation on a $5 VPS with OPcache, PHP-FPM tuning, and page caching should serve cached pages in under 100ms and handle hundreds of concurrent visitors without breaking a sweat. Uncached PHP pages on a 1GB VPS will be slower under heavy load — the caching layer is what makes the difference.
One-click WordPress installer included
Galaxy Cloud Solutions VPS plans include a one-click WordPress installer with Nginx, PHP 8.3-FPM, and MySQL pre-configured. Plans from $5/mo — use code LAUNCH2026 for 50% off your first month.
Get Started