WordPress Guide

    Deploy WordPress on RamNode VPS

    WordPress powers over 40% of all websites on the internet, making it the world's most popular content management system. Combined with RamNode's reliable VPS hosting, you can deploy a secure, high-performance WordPress site with SSL encryption and Nginx web server in under 30 minutes.

    Ubuntu 22.04 LTS
    WordPress + Nginx
    SSL Certificate
    ⏱️ 25-30 minutes

    Why Choose WordPress and RamNode?

    WordPress Benefits:

    • • Powers 40%+ of all websites globally
    • • Thousands of themes and plugins available
    • • Easy content management interface
    • • SEO-friendly and mobile responsive
    • • Strong community support

    RamNode + Nginx Advantages:

    • • High-performance SSD storage
    • • Nginx for superior performance
    • • Free SSL certificates with Let's Encrypt
    • • Full root access for customization
    • • Cost-effective hosting solution

    Prerequisites

    Before starting, ensure you have:

    Server Requirements

    • • RamNode VPS (Ubuntu 22.04 LTS recommended)
    • • Domain name pointed to your server IP
    • • SSH access to your server
    • • At least 1GB RAM (2GB+ recommended)

    Knowledge Requirements

    • • Basic Linux command line skills
    • • Understanding of web servers
    • • Domain DNS management
    2

    Initial Server Setup

    Connect to your RamNode VPS and prepare the system:

    Connect via SSH
    ssh root@your-server-ip
    Update System Packages
    apt update && apt upgrade -y
    Install Essential Tools
    apt install curl wget unzip software-properties-common -y

    💡 Tip: Replace "your-server-ip" with your actual RamNode VPS IP address.

    3

    Install Nginx Web Server

    Install and configure Nginx as the web server:

    Install Nginx
    apt install nginx -y
    Start and Enable Nginx
    systemctl start nginx
    systemctl enable nginx
    systemctl status nginx
    Configure Firewall
    ufw allow 'Nginx Full'
    ufw allow OpenSSH
    ufw --force enable

    ✅ You can now visit your server's IP address to see the Nginx welcome page.

    4

    Install MySQL Database

    Install MySQL server for WordPress data storage:

    Install MySQL Server
    apt install mysql-server -y
    Secure MySQL Installation
    mysql_secure_installation

    Follow the prompts to:

    • Set up VALIDATE PASSWORD component (recommended: Y)
    • Set password validation policy (Medium recommended)
    • Set a strong root password
    • Remove anonymous users (Y)
    • Disallow root login remotely (Y)
    • Remove test database (Y)
    • Reload privilege tables (Y)
    Test MySQL Connection
    mysql -u root -p
    5

    Install PHP

    Install PHP and required extensions for WordPress:

    Install PHP and Extensions
    apt install php8.1-fpm php8.1-mysql php8.1-curl php8.1-gd php8.1-mbstring \
    php8.1-xml php8.1-zip php8.1-intl php8.1-bcmath php8.1-soap \
    php8.1-imagick php8.1-readline php8.1-common php8.1-cli -y
    Start and Enable PHP-FPM
    systemctl start php8.1-fpm
    systemctl enable php8.1-fpm
    systemctl status php8.1-fpm
    Optimize PHP Configuration
    nano /etc/php/8.1/fpm/php.ini

    Update these PHP settings for better performance:

    PHP Configuration Updates
    memory_limit = 256M
    upload_max_filesize = 64M
    post_max_size = 64M
    max_execution_time = 300
    max_input_vars = 3000
    Restart PHP-FPM
    systemctl restart php8.1-fpm
    6

    Configure Nginx for WordPress

    Create Nginx virtual host configuration for your domain:

    Create Site Configuration
    nano /etc/nginx/sites-available/your-domain.com

    Add the following configuration (replace your-domain.com with your actual domain):

    Nginx WordPress Configuration
    server {
        listen 80;
        listen [::]:80;
        root /var/www/html/your-domain.com;
        index index.php index.html index.htm;
        server_name your-domain.com www.your-domain.com;
    
        client_max_body_size 100M;
    
        location / {
            try_files $uri $uri/ /index.php?$args;
        }
    
        location ~ \.php$ {
            include snippets/fastcgi-php.conf;
            fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
        }
    
        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 Site and Test Configuration
    ln -s /etc/nginx/sites-available/your-domain.com /etc/nginx/sites-enabled/
    nginx -t
    systemctl reload nginx
    Create Web Directory
    mkdir -p /var/www/html/your-domain.com
    chown -R www-data:www-data /var/www/html/your-domain.com
    7

    Download WordPress

    Download and extract WordPress to your web directory:

    Download Latest WordPress
    cd /tmp
    wget https://wordpress.org/latest.tar.gz
    tar xzf latest.tar.gz
    Move WordPress Files
    cp -R wordpress/* /var/www/html/your-domain.com/
    chown -R www-data:www-data /var/www/html/your-domain.com
    chmod -R 755 /var/www/html/your-domain.com
    Create WordPress Configuration
    cd /var/www/html/your-domain.com
    cp wp-config-sample.php wp-config.php
    8

    Configure MySQL Database

    Create a MySQL database and user for WordPress:

    Access MySQL
    mysql -u root -p
    Create Database and User
    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;
    Update WordPress Configuration
    nano /var/www/html/your-domain.com/wp-config.php

    Update the database configuration in wp-config.php:

    Database Configuration
    define('DB_NAME', 'wordpress_db');
    define('DB_USER', 'wordpress_user');
    define('DB_PASSWORD', 'strong_password_here');
    define('DB_HOST', 'localhost');
    define('DB_CHARSET', 'utf8mb4');
    define('DB_COLLATE', '');
    Generate Security Keys
    curl -s https://api.wordpress.org/secret-key/1.1/salt/

    Copy the generated keys and replace the placeholder values in wp-config.php.

    9

    Complete WordPress Setup

    Complete the WordPress installation through the web interface:

    🌐 Web Setup: Visit http://your-domain.com in your browser to complete the WordPress installation.

    Fill out the WordPress installation form with:

    • Site Title: Your website name
    • Username: Admin username (avoid "admin")
    • Password: Strong password
    • Email: Your email address
    • Search Engine Visibility: Check if you don't want search engines to index yet

    🎉 Success: WordPress is now installed! You can access the admin area at /wp-admin/

    10

    Install SSL Certificate

    Secure your WordPress site with a free SSL certificate from Let's Encrypt:

    Install Certbot
    apt install snapd -y
    snap install core; snap refresh core
    snap install --classic certbot
    Create Certbot Symlink
    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: 2)
    Test SSL Renewal
    certbot renew --dry-run

    🔒 SSL Active: Your WordPress site is now secured with HTTPS!

    11

    Security Hardening

    Implement additional security measures for your WordPress installation:

    Hide Nginx Version
    nano /etc/nginx/nginx.conf

    Add this line to the http block:

    Nginx Security Configuration
    server_tokens off;
    Create WordPress Security Configuration
    nano /var/www/html/your-domain.com/.htaccess
    WordPress .htaccess Security
    # Block access to wp-config.php
    <Files wp-config.php>
    order allow,deny
    deny from all
    </Files>
    
    # Block access to xmlrpc.php
    <Files xmlrpc.php>
    order allow,deny
    deny from all
    </Files>
    
    # Disable directory browsing
    Options -Indexes
    
    # Block suspicious requests
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3E) [NC,OR]
    RewriteCond %{QUERY_STRING} GLOBALS(=|[|%[0-9A-Z]{0,2}) [OR]
    RewriteCond %{QUERY_STRING} _REQUEST(=|[|%[0-9A-Z]{0,2})
    RewriteRule ^(.*)$ index.php [F,L]
    </IfModule>
    Update WordPress Configuration Security
    nano /var/www/html/your-domain.com/wp-config.php

    Add these security settings to wp-config.php:

    WordPress Security Settings
    // Disable file editing from WordPress admin
    define('DISALLOW_FILE_EDIT', true);
    
    // Force SSL
    define('FORCE_SSL_ADMIN', true);
    
    // Limit login attempts
    define('WP_FAIL2BAN_BLOCKED_USERS', array('admin', 'administrator'));
    
    // Hide WordPress version
    remove_action('wp_head', 'wp_generator');
    12

    Performance Optimization

    Optimize your WordPress site for better performance:

    Install Redis for Caching
    apt install redis-server -y
    systemctl enable redis-server
    systemctl start redis-server
    Configure Nginx Caching
    nano /etc/nginx/sites-available/your-domain.com

    Add caching configuration to your Nginx virtual host:

    Nginx Caching Configuration
    # Add to server block
    location ~* \.(jpg|jpeg|png|gif|ico|css|js|pdf)$ {
        expires 1y;
        add_header Cache-Control "public, immutable";
        add_header Vary Accept-Encoding;
        access_log off;
    }
    
    # Enable Gzip compression
    gzip on;
    gzip_vary on;
    gzip_min_length 1024;
    gzip_proxied expired no-cache no-store private auth;
    gzip_types
        text/plain
        text/css
        text/xml
        text/javascript
        application/javascript
        application/xml+rss
        application/json;
    Reload Nginx
    nginx -t && systemctl reload nginx

    🚀 Recommended: Install a WordPress caching plugin like WP Rocket, W3 Total Cache, or WP Super Cache for additional performance gains.

    Troubleshooting

    Next Steps & Recommendations

    Essential WordPress Plugins

    • Security: Wordfence Security, Sucuri, or iThemes Security
    • SEO: Yoast SEO or RankMath
    • Caching: WP Rocket, W3 Total Cache, or WP Super Cache
    • Backup: UpdraftPlus, BackupBuddy, or Jetpack Backup
    • Performance: Smush (image optimization), Lazy Load

    Maintenance Tasks

    • • Regular WordPress, theme, and plugin updates
    • • Weekly database optimization
    • • Daily automated backups
    • • Monthly security scans
    • • Performance monitoring and optimization