Introduction

WordPress is the most popular content management system (CMS) that allows you to create websites and blogs with ease. Although WordPress is often used on Linux-based servers, you can also install it on a Linux VPS using software like XAMPP or WAMP. In this guide, we will walk you through the steps to install WordPress on a Linux VPS, set up a local web server, and configure the database for WordPress.

Prerequisites

Before you begin, ensure that you have the following:

  • A Linux VPS with administrative privileges.
  • Access to your server via Remote Desktop Protocol (RDP).
  • PHP, MySQL, and a web server (Apache or Nginx) installed (we will use XAMPP in this guide).
  • Access to a domain name (optional, for live websites).

Step 1: Install XAMPP on Your Linux VPS

XAMPP is an easy-to-install Apache distribution that includes MySQL, PHP, and Perl. Follow these steps to install XAMPP on your Linux VPS:

  1. Download XAMPP from the official website: Apache Friends.
  2. Run the installer and follow the on-screen instructions to install XAMPP on your server.
  3. Once installed, open the XAMPP Control Panel and start the Apache and MySQL services.
  4. Ensure that both Apache (web server) and MySQL (database) are running. You can check their status in the XAMPP Control Panel.

Step 2: Create a Database for WordPress

WordPress requires a MySQL database to store your website’s data. Follow these steps to create a database:

  1. Open your web browser and go to the XAMPP control panel address: http://localhost/phpmyadmin.
  2. Log in with the default MySQL username root (no password).
  3. In phpMyAdmin, click on the “Databases” tab.
  4. Enter a name for your new database (e.g., wordpress_db) and click “Create”.
  5. Note down the database name, as you will need it later during the WordPress installation.

Step 3: Download and Install WordPress

Now, let’s download and set up WordPress on your Linux VPS:

  1. Download the latest version of WordPress from the official website: WordPress Download.
  2. Extract the WordPress zip file to the htdocs directory in your XAMPP installation folder (usually located at C:\xampp\htdocs\).
  3. Rename the extracted folder to something like wordpress for easy access.

Step 4: Configure WordPress

Now that WordPress is installed, you need to configure it to connect to your MySQL database:

  1. Open your web browser and go to: http://localhost/wordpress.
  2. Choose your language and click “Continue”.
  3. On the next page, WordPress will ask for your database details. Enter the following information:
    • Database Name: The name of the database you created earlier (e.g., wordpress_db).
    • Username: root
    • Password: Leave this field empty (unless you’ve set a password for the MySQL root user).
    • Database Host: localhost
    • Table Prefix: Leave the default value (wp_) or change it if needed for security reasons.
  4. Click “Submit”, and then click “Run the Installation”.

Step 5: Complete the WordPress Installation

Once WordPress is connected to the database, you will be asked to provide some basic information to complete the setup:

  • Site Title: Enter the name of your website.
  • Username: Choose a username for the WordPress admin account.
  • Password: Choose a strong password for your admin account.
  • Your Email: Enter your email address.
  • Click “Install WordPress”.

After the installation, you will see a success message. You can now log in to your WordPress admin dashboard at: http://localhost/wordpress/wp-admin using the credentials you just created.

Step 6: Configure WordPress for Online Use

If you want to make your WordPress website live, you will need to configure your domain and adjust the site URL:

  • Update your site’s URL in the WordPress settings under “Settings” > “General”.
  • Point your domain to the public IP address of your Linux VPS by updating your DNS settings.

Conclusion

Congratulations! You have successfully installed WordPress on your Linux VPS using XAMPP. You can now begin customizing your website, adding content, and installing plugins and themes to enhance its functionality. Be sure to keep your WordPress installation up-to-date for security and performance improvements.