VPS hosting for WordPress means running your site on a virtual server with guaranteed CPU, RAM and disk, where you install and tune the web stack yourself instead of sharing one server account with hundreds of other sites. It is worth the extra work once your site is slow under traffic, runs WooCommerce, or needs settings that shared hosting will not allow. This guide covers sizing, a working Nginx, PHP-FPM and MariaDB stack, caching, backups and security, with the India-specific points to check.
Start from a prepared server. If yours is brand new, do the first 30 minutes of VPS setup (non-root user, SSH keys, firewall) before anything below.
When a VPS makes sense for WordPress
A VPS is not automatically better. It gives you control and predictable resources, and in return you own updates, backups and security. Move to one when at least one of these is true:
- Pages are slow when several people visit at once. Shared plans throttle CPU and PHP workers. A VPS gives you dedicated resources. The shared hosting versus VPS comparison covers the signs in more detail.
- You run WooCommerce, memberships or a booking plugin. Logged-in and cart pages cannot be fully page-cached, so they need real PHP and database capacity.
- You need custom software. Redis, a specific PHP version, command-line tools such as WP-CLI, or cron jobs that run on a schedule you choose.
- You host several sites. One VPS can run a handful of small WordPress sites, each in its own web root and database.
If you do not want to patch servers at all, a managed service may suit you better. Managed cloud hosting explained lists what that responsibility split looks like.
Sizing a VPS for WordPress
Sizing depends on traffic that actually reaches PHP, not on page views. With full-page caching, most visitors never touch PHP or the database. These are starting points, not guarantees. Measure and adjust.
| Site type | Starting point | Notes |
|---|---|---|
| Brochure or blog, caching on | 1 vCPU, 2 GB RAM | Comfortable for a single site. Swap is a safety net, not a plan. |
| Busy blog or a few small sites | 2 vCPU, 4 GB RAM | Room for Redis and image processing. |
| WooCommerce with steady orders | 4 vCPU, 8 GB RAM | Cart and checkout bypass the page cache. Give MariaDB memory. |
Choose SSD or NVMe storage and leave at least 30 percent of the disk free for backups and updates. A Linux VPS in a Delhi data centre also keeps latency low for visitors in India. Check any plan against how to choose a Linux VPS plan before you buy.
Install the stack: Nginx, PHP-FPM and MariaDB
The commands below target Ubuntu 22.04 or 24.04. Run them as a sudo user. The package names are for the Ubuntu default PHP version, so check the PHP version your WordPress release recommends on the official WordPress requirements page before you install.
sudo apt update && sudo apt upgrade -y
sudo apt install -y nginx mariadb-server php-fpm php-mysql php-curl php-gd \
php-intl php-mbstring php-xml php-zip php-imagick php-redis redis-server unzip
sudo mysql_secure_installation
Create a database and a dedicated user. Use a long random password and never reuse your admin password.
sudo mysql
CREATE DATABASE wp_site CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'wp_user'@'localhost' IDENTIFIED BY 'REPLACE_WITH_LONG_RANDOM_PASSWORD';
GRANT ALL PRIVILEGES ON wp_site.* TO 'wp_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Download WordPress and set ownership. WP-CLI makes this repeatable:
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar && sudo mv wp-cli.phar /usr/local/bin/wp
sudo mkdir -p /var/www/example.in && sudo chown $USER:www-data /var/www/example.in
cd /var/www/example.in
wp core download
wp config create --dbname=wp_site --dbuser=wp_user --prompt=dbpass
wp core install --url=https://example.in --title="My Site" \
--admin_user=siteadmin --admin_email=you@example.in --prompt=admin_password
Use an admin username that is not "admin". Then add an Nginx server block at /etc/nginx/sites-available/example.in:
server {
listen 80;
server_name example.in www.example.in;
root /var/www/example.in;
index index.php;
location / { try_files $uri $uri/ /index.php?$args; }
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php-fpm.sock;
}
location ~* \.(jpg|jpeg|png|gif|webp|avif|css|js|woff2|svg|ico)$ {
expires 30d; add_header Cache-Control "public";
}
location ~ /\.ht { deny all; }
}
The socket path varies by PHP version, for example /run/php/php8.3-fpm.sock. Check with ls /run/php/. Enable the site with a symlink into sites-enabled, run sudo nginx -t, then reload Nginx. Point your DNS A record at the server IP and add HTTPS with Certbot. The full certificate and reverse-proxy walkthrough is in deploy Nginx, PHP and Node with HTTPS on an Ubuntu cloud server, so it is not repeated here.
Speed: cache in layers
Most WordPress slowness comes from running PHP and database queries for every request. Fix it in layers, and measure before and after with a tool such as PageSpeed Insights or curl -w timings.
- PHP OPcache. It is bundled and usually on by default in PHP-FPM. Confirm with
php -i | grep opcache.enable. - Page cache. Either Nginx FastCGI cache or a plugin that writes static HTML. Serving a static file avoids PHP and MariaDB entirely, which is the biggest single gain for anonymous visitors.
- Object cache with Redis. Install an object-cache plugin that supports Redis. It cuts repeated database queries, which matters most for logged-in users and WooCommerce.
- PHP-FPM workers. In
/etc/php/*/fpm/pool.d/www.conf, setpm.max_childrenfrom available memory. As a rule of thumb, divide the RAM you can spare for PHP by the average size of a PHP process (often 50 to 120 MB for WordPress). Setting it too high causes swapping, which is slower than queueing. - MariaDB memory. On a dedicated database workload raise
innodb_buffer_pool_size, but on a shared 2 GB server keep it modest, often 256 to 512 MB. - Images and assets. Serve WebP or AVIF, set long cache headers (already in the block above) and remove plugins you do not use. A heavy page builder can cost more than all the server tuning combined.
Whatever you tune, change one thing at a time and keep notes. The numbers above are starting rules, not a benchmark of any specific plan.
Backups you have actually restored
A WordPress backup needs two parts: the database and the wp-content directory (uploads, themes, plugins), plus wp-config.php. Here is a minimal nightly script:
#!/bin/bash
set -e
D=$(date +%F)
B=/var/backups/wp
mkdir -p $B
cd /var/www/example.in
wp db export $B/db-$D.sql
gzip -f $B/db-$D.sql
tar -czf $B/files-$D.tar.gz wp-content wp-config.php
find $B -type f -mtime +14 -delete
Run it from cron, then copy the files off the server with rsync or an object store so one failed disk or one compromised server cannot take the copies with it. Take a snapshot before major updates too. The cloud server backup guide explains snapshots versus file copies and how to run a restore test. Do that test: restore to a spare server or a new directory and load the site. A backup you have never restored is only a hope.
Security checklist for a WordPress VPS
Most WordPress compromises come from outdated plugins and weak logins, not from the server itself. Cover both layers.
- Server: SSH keys only, password login off, a firewall that allows only ports 22, 80 and 443 (
ufw), and automatic security updates (unattended-upgrades). Consider Fail2ban for SSH and for repeated login failures. - Files: files owned by your deploy user and readable by
www-data, with the web server unable to write to code directories. Setdefine('DISALLOW_FILE_EDIT', true);inwp-config.phpto disable the in-dashboard code editor. - Logins: two-factor authentication for every administrator, limited login attempts, and no shared accounts. Block or rate-limit
xmlrpc.phpif you do not use it. - Updates: keep WordPress core, themes and plugins current, and delete the ones you do not use. Run
wp plugin list --update=availableon a schedule. - Database: MariaDB listens on localhost only (
bind-address = 127.0.0.1), and the WordPress user has rights on its own database alone. - Isolation for multiple sites: give each site its own PHP-FPM pool and database user so one hacked site is not an open door to the others.
Then keep a monthly routine. The monthly cloud server management checklist fits a WordPress VPS well.
India-specific points
- Latency. If most visitors are in India, host in India. A server in a Delhi data centre shortens the round trip compared with a faraway region, and it helps most on dynamic pages that cannot be cached at a CDN edge.
- Personal data. A WordPress site that collects names, phone numbers, order details or form submissions holds personal data. Know where it is stored, who can access it and how you would delete it on request. The DPDP Act hosting guide explains why many businesses keep data in India. For the legal text, read the official sources on the MeitY website, and take legal advice for your own case.
- Billing. If your accounts team wants INR billing and GST invoices, confirm that before you commit. Also confirm how renewal and overage work.
- Email. Contact-form and order emails from a fresh VPS often land in spam. Send through an authenticated SMTP or transactional email service instead of PHP
mail(), and set SPF, DKIM and DMARC records.
How AvertHost can help
AvertHost offers Linux cloud VPS hosting in a Delhi data centre, in a Tier-IV facility (Yotta), with a 99.9% uptime SLA. You can choose Ubuntu, Debian or CentOS, which are all suitable for the stack in this guide. On a standard VPS you administer the operating system and WordPress yourself, so the updates, backups and security steps above are your responsibility. Confirm what support covers before you rely on it. See the services overview for the current plans, and check the pricing page for today's rates rather than relying on any article.
FAQ
How much RAM does a WordPress VPS need?
For one small site with page caching, 2 GB RAM is a workable start. WooCommerce stores, several sites on one server, or heavy page builders usually need 4 to 8 GB. Watch real usage with free -m and your PHP-FPM status, then resize.
Is a VPS faster than shared hosting for WordPress?
Usually yes under load, because resources are not shared with unknown neighbours and you can add Redis and page caching. A poorly tuned VPS can still be slower than good shared hosting, so the gain comes from the tuning as much as the server.
Do I need a control panel such as cPanel?
No. Nginx, PHP-FPM, MariaDB and WP-CLI work from the command line. A panel eases day-to-day tasks but uses RAM and adds its own licence cost and update burden. Choose it if the people running the site do not use a terminal.
How often should I back up WordPress?
Daily for most sites, and more often for stores that take orders all day. Keep copies off the server and test a restore at least once a quarter.
Can I run several WordPress sites on one VPS?
Yes. Use a separate web root, database, database user and PHP-FPM pool for each site, and size the server for the sum of their traffic.