⟵ Все статьи
Читать на:

WordPress on VPS: Installation, HTTPS and Speed Configuration

WordPress on VPS: Installation, HTTPS and Speed Configuration

WordPress runs fine on cheap shared hosting — until traffic grows and the site accumulates plugins. Then the familiar problems begin: the admin panel takes several seconds to respond, and for any performance question the host replies with "you have exceeded your limits".

On a VPS there are no such limits: the resources are yours, and you choose the PHP and MySQL versions. Below is a complete installation from scratch: from ordering a server to a working site on HTTPS with caching.

Step 1. Order a Server

In the NodexGo panel click "Create Server" and go through the steps: location — your real ping is shown next to each one, choose the closest to your site's audience; plan; Ubuntu 24.04 image; server name; billing period of 1, 3, 6 or 12 months.

Regarding resources: a blog or business card site is fine with 1 vCPU and 2 GB of RAM, while a WooCommerce online store should start from 4 GB. NVMe disk matters more than CPU cores here — the WordPress admin panel is primarily bottlenecked by disk and database speed.

Within a minute after payment, the IP address and root password will appear in the panel and be sent to your email.

Ubuntu 24.04, NVMe and root access — WordPress is up and running in 20 minutes.

Create Server

Step 2. Connect and Update the System

ssh root@server-IP-address
apt update && apt upgrade -y

Step 3. Install the Web Server, PHP and Database

Install nginx, PHP-FPM with the modules WordPress needs, and MariaDB:

apt install -y nginx mariadb-server php8.3-fpm php8.3-mysql php8.3-xml php8.3-curl php8.3-gd php8.3-mbstring php8.3-zip php8.3-intl unzip

Secure the database with a basic security setup — answer Y to all questions except changing the root password if you do not need to:

mysql_secure_installation

Step 4. Create a Database for the Site

mysql -u root
CREATE DATABASE wordpress CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'wp'@'localhost' IDENTIFIED BY 'choose-a-long-password';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wp'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Step 5. Download and Deploy WordPress

cd /tmp
curl -O https://wordpress.org/latest.tar.gz
tar -xzf latest.tar.gz
mkdir -p /var/www/example.com
cp -r wordpress/* /var/www/example.com/
chown -R www-data:www-data /var/www/example.com

Step 6. Configure nginx

Create the site configuration, replacing example.com with your domain:

nano /etc/nginx/sites-available/example.com
server {
    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 ~* \.(jpg|jpeg|png|webp|gif|ico|css|js|woff2)$ {
        expires 30d;
        access_log off;
    }

    location ~ /\.ht {
        deny all;
    }
}

Enable the site and reload nginx:

ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/
rm -f /etc/nginx/sites-enabled/default
nginx -t && systemctl reload nginx

Step 7. Open Ports

Allow SSH before enabling the firewall, otherwise you will lose access:

ufw allow OpenSSH
ufw allow 'Nginx Full'
ufw enable

Step 8. Point the Domain and Issue a Certificate

In your registrar's panel set the domain's A record to the server IP. Once it propagates (usually within minutes), issue a free Let's Encrypt certificate — certbot will automatically configure HTTPS in the nginx configuration:

apt install -y certbot python3-certbot-nginx
certbot --nginx -d example.com -d www.example.com

Renewal happens automatically; you can verify the mechanism like this:

certbot renew --dry-run

Step 9. WordPress Installer

Open https://example.com in your browser — the familiar five-minute installer will launch. Enter the database name wordpress, user wp and the password from step four. Do not use admin as the administrator login, and choose a long password: brute-force attacks on wp-login.php begin within the first hours of a site going live.

Step 10. Speed Optimization

The first thing that gives a noticeable boost is page caching. Install a caching plugin from the admin panel (for example LiteSpeed Cache or W3 Total Cache) and enable page caching and compression.

Second — an in-memory object cache. Install Redis and the PHP extension for it:

apt install -y redis-server php8.3-redis
systemctl enable --now redis-server
systemctl restart php8.3-fpm

After that, enable the Redis Object Cache plugin in the admin panel — it will automatically detect the installed server.

Third — PHP limits: the default values are not enough for uploading media files and running heavy plugins.

nano /etc/php/8.3/fpm/php.ini
upload_max_filesize = 64M
post_max_size = 64M
memory_limit = 512M
max_execution_time = 120
systemctl restart php8.3-fpm

Step 11. Backups

On a VPS you are responsible for backups. The minimum approach is a daily script with a copy of the database and files:

mysqldump -u root --single-transaction wordpress | gzip > /root/wp-db-$(date +%F).sql.gz
tar -czf /root/wp-files-$(date +%F).tar.gz /var/www/example.com

Add this to cron and make sure to store copies somewhere other than the server itself.

If Something Is Not Working

A white screen is almost always a PHP error. Check the log: tail -f /var/log/nginx/error.log. It is often caused by a missing PHP module or a plugin after an update.

The error "Error establishing a database connection" means incorrect credentials in wp-config.php or a stopped database: check systemctl status mariadb.

The site became slow as traffic grew — first enable caching, then check memory with the free -h command. If memory is genuinely low, the server card has an "Upgrade Plan" button: the plan is upgraded, the disk and IP address are preserved, and WordPress does not need to be reinstalled.

Lost SSH access — open the VNC web console in the server card, it works independently of the network.

From a blog to a WooCommerce store — choose a configuration with room to grow.

View Plans

Мы используем файлы cookie: необходимые — для входа в аккаунт и языка интерфейса, аналитические — чтобы понимать, какими страницами пользуются. Сторонних рекламных систем у нас нет. Подробнее