Setting up WordPress on a VPS gives you complete control over your hosting environment while providing better performance and security than shared hosting. In this comprehensive guide, we’ll walk through deploying WordPress on a RamNode VPS using Nginx as the web server and securing it with SSL certificates.

Why Choose RamNode VPS for WordPress?

RamNode offers excellent value VPS hosting with SSD storage, competitive pricing, and reliable performance. Combined with Nginx’s efficiency and SSL security, you’ll have a robust WordPress hosting solution that can handle significant traffic while maintaining fast load times.

Prerequisites

Before starting, ensure you have:

  • A RamNode VPS with Ubuntu 24.04 or higher
  • Root access to your server
  • A domain name pointed to your VPS IP address
  • Basic command line knowledge

Initial Server Setup

First, connect to your RamNode VPS via SSH:

ssh root@your-server-ip

Update the system packages:

apt update && apt upgrade -y

Create a new user with sudo privileges:

adduser wordpress
usermod -aG sudo wordpress

Configure the firewall:

ufw allow OpenSSH
ufw allow 'Nginx Full'
ufw enable

Install Nginx

Install Nginx web server:

apt install nginx -y
systemctl start nginx
systemctl enable nginx

Verify Nginx is running by visiting your server’s IP address in a browser. You should see the default Nginx welcome page.

Install MySQL

Install and secure MySQL:

apt install mysql-server -y
mysql_secure_installation

Follow the prompts to:

  • Set a strong root password
  • Remove anonymous users
  • Disallow root login remotely
  • Remove test database
  • Reload privilege tables

Create a database for WordPress:

mysql -u root -p
CREATE DATABASE wordpress_db;
CREATE USER 'wordpress_user'@'localhost' IDENTIFIED BY 'strong_password_here';
GRANT ALL PRIVILEGES ON wordpress_db.* TO 'wordpress_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Install PHP

Install PHP and required modules:

apt install php-fpm php-mysql php-curl php-gd php-xml php-mbstring php-xmlrpc php-zip php-soap php-intl -y

Configure PHP for better WordPress performance:

nano /etc/php/8.3/fpm/php.ini

Update these values:

upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300
memory_limit = 256M

Restart PHP-FPM:

systemctl restart php8.3-fpm

Download and Configure WordPress

Download WordPress:

cd /tmp
wget https://wordpress.org/latest.tar.gz
tar xzf latest.tar.gz

Move WordPress files to web directory:

mkdir -p /var/www/your-domain.com
cp -R wordpress/* /var/www/your-domain.com/
chown -R www-data:www-data /var/www/your-domain.com
chmod -R 755 /var/www/your-domain.com

Configure WordPress:

cd /var/www/your-domain.com
cp wp-config-sample.php wp-config.php
nano wp-config.php

Update the database configuration:

define('DB_NAME', 'wordpress_db');
define('DB_USER', 'wordpress_user');
define('DB_PASSWORD', 'strong_password_here');
define('DB_HOST', 'localhost');

Generate security keys from WordPress Salt Generator and replace the placeholder values.

Configure Nginx for WordPress

Create an Nginx server block:

nano /etc/nginx/sites-available/your-domain.com

Add this configuration:

server {
    listen 80;
    server_name your-domain.com www.your-domain.com;
    root /var/www/your-domain.com;
    index index.php index.html index.htm;

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~ /\.ht {
        deny all;
    }

    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }

    location = /robots.txt {
        log_not_found off;
        access_log off;
        allow all;
    }

    location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ {
        expires 1y;
        add_header Cache-Control "public, immutable";
        log_not_found off;
    }
}

Enable the site:

ln -s /etc/nginx/sites-available/your-domain.com /etc/nginx/sites-enabled/
nginx -t
systemctl reload nginx

Install SSL Certificate with Let’s Encrypt

Install Certbot:

apt install snapd -y
snap install core; snap refresh core
snap install --classic certbot
ln -s /snap/bin/certbot /usr/bin/certbot

Obtain SSL certificate:

certbot --nginx -d your-domain.com -d www.your-domain.com

Follow the prompts to:

  • Enter your email address
  • Agree to terms of service
  • Choose whether to share email with EFF
  • Select redirect option (recommended)

Certbot will automatically update your Nginx configuration to include SSL settings and set up automatic renewal.

Complete WordPress Installation

Visit your domain in a browser (https://your-domain.com). You’ll see the WordPress installation wizard:

  1. Select your language
  2. Enter site title, admin username, password, and email
  3. Click “Install WordPress”

Security Hardening

Hide Nginx Version

Edit the main Nginx configuration:

nano /etc/nginx/nginx.conf

Add this line in the http block:

server_tokens off;

Configure WordPress Security

Add these lines to your wp-config.php:

// Disable file editing in WordPress admin
define('DISALLOW_FILE_EDIT', true);

// Force SSL
define('FORCE_SSL_ADMIN', true);

// Set automatic updates
define('WP_AUTO_UPDATE_CORE', true);

Install Security Plugin

Consider installing a security plugin like Wordfence or Sucuri Security for additional protection.

Performance Optimization

Enable Nginx Gzip Compression

Add to your server block:

gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_types text/plain text/css text/xml text/javascript application/javascript application/xml+rss application/json;

Install Caching Plugin

Install a caching plugin like W3 Total Cache or WP Rocket to improve performance.

Configure PHP OpCache

Edit PHP configuration:

nano /etc/php/8.3/fpm/php.ini

Enable OpCache:

opcache.enable=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=2

Troubleshooting Common Issues

PHP Memory Limit Errors

Increase memory limit in wp-config.php:

ini_set('memory_limit', '256M');

File Permission Issues

Fix WordPress file permissions:

find /var/www/your-domain.com/ -type d -exec chmod 755 {} \;
find /var/www/your-domain.com/ -type f -exec chmod 644 {} \;

SSL Certificate Renewal

Test automatic renewal:

certbot renew --dry-run

Conclusion

You now have a fully functional WordPress site running on your RamNode VPS with Nginx and SSL encryption. This setup provides excellent performance, security, and scalability for your WordPress projects.

The combination of RamNode’s reliable VPS hosting, Nginx’s efficiency, and proper SSL implementation creates a robust foundation for any WordPress site. Regular maintenance, security updates, and monitoring will ensure your site continues to perform optimally.

Remember to regularly backup your site, keep all software updated, and monitor your server resources as your site grows. With this solid foundation, you’re ready to build and scale your WordPress presence with confidence.