How Do I Install WordPress on VPS? Print

  • nstall WordPress VPS, Manual WordPress Install, LAMP Stack, LEMP Stack
  • 0

nstalling WordPress on a VPS gives you maximum flexibility. Unlike shared hosting, there is no one-click installer by default—you will set up the environment manually. This guide assumes you have a LAMP (Linux, Apache, MySQL, PHP) stack installed.

Step 1: Create a Database

  1. Log into MySQL: mysql -u root -p

  2. Run these commands (replace wpuser and password with your own):

    sql
    CREATE DATABASE wpdatabase;
    CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'strong_password';
    GRANT ALL PRIVILEGES ON wpdatabase.* TO 'wpuser'@'localhost';
    FLUSH PRIVILEGES;
    EXIT;

Step 2: Download WordPress

  1. Navigate to your web directory (usually /var/www/html or /var/www/yourdomain.com).
    cd /var/www/html

  2. Download the latest WordPress:
    wget https://wordpress.org/latest.tar.gz

  3. Extract it:
    tar -xzvf latest.tar.gz

  4. Move files to the root (optional):
    mv wordpress/* . /

Step 3: Configure WordPress

  1. Rename the sample config file:
    cp wp-config-sample.php wp-config.php

  2. Edit the config file:
    nano wp-config.php

  3. Enter your database name, username, and password in the appropriate fields.

  4. Save the file and exit.

  5. Set proper permissions (your web server user, usually www-data or apache, needs write access to some folders).

Step 4: Run the Installer
Visit your domain or IP address in a web browser and follow the famous 5-minute WordPress installation.


Was this answer helpful?

« Back

Powered by WHMCompleteSolution