Skip to content

How to host WordPress on a VPS (and why it's faster)

By Onehost Team1 min read

Moving WordPress from cheap shared hosting to a VPS gives you your own allocated RAM, full control, and noticeably faster page loads. Here's how to host it on a fast LEMP stack (Linux, Nginx, MySQL/MariaDB, PHP).

Why a VPS is faster for WordPress

On shared hosting your site competes with many others for resources. A VPS gives you your own allocated RAM and storage and your own server configuration, plus the freedom to add caching and tune PHP — which is where the real speed gains come from.

1. Install the LEMP stack

sudo apt update
sudo apt install nginx mariadb-server php-fpm php-mysql php-curl php-gd php-xml php-mbstring -y

2. Create the database

sudo mysql
CREATE DATABASE wordpress;
CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'strong-password';
GRANT ALL ON wordpress.* TO 'wpuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;

3. Download and configure WordPress

cd /var/www
sudo curl -O https://wordpress.org/latest.tar.gz
sudo tar xzf latest.tar.gz

Point an Nginx server block at /var/www/wordpress, set the PHP-FPM socket, then finish the install in your browser.

4. Add HTTPS and caching

Secure the site with Certbot (Let's Encrypt), then add caching — FastCGI cache in Nginx or a plugin backed by Redis — for a big speed boost.

5. Harden it

Keep WordPress, themes and plugins updated, use strong passwords, limit login attempts, and take regular backups.

On a Onehost VPS you can run one or many WordPress sites with full root access and SSD storage (NVMe on High Performance plans).

Put it into practice

Let our engineers set up, patch and monitor your web server.

Managed Linux VPS