How to Install WordPress on a VPS with a One-Click Installer or Manually

How to Install WordPress on a VPS with a One-Click Installer or Manually

According to the W3Techs survey, WordPress has a 60% market share as a content management system and an absolute usage rate of 43.3%. With this number of users, WordPress is the most used CMS system all over the globe. Thus, whether you are a blogger, developer, or business owner, installing WordPress on your server is most likely a solution for complete control over your server performance, security, and scalability.

However, installing WordPress on VPS hosting can be a challenge for many, especially if someone is starting from scratch. Unlike shared hosting, a virtual private server gives more flexibility with complete root access. So here in this blog, we will share the following two reliable and trusted methods to install WordPress on your VPS:

  1. Using a One-click Installer (Beginner friendly)
  2. Installing manually (a bit complicated but best for control and customization)

We will cover both of these methods step-by-step, including prerequisites, best practices, and common troubleshooting to avoid

Why use a VPS for WordPress?

Although WordPress can be installed in any hosting service, be it shared, VPS, or a dedicated server, using VPS provides more power and features. Let us tell you the four main reasons to use VPS over shared hosting for WordPress installation

  • Performance: A VPS hosting solution offers a virtually isolated environment for hosting your website, thus increasing the power and performance compared to shared hosting, where each piece of equipment is shared with multiple users.
  • Scalability: These VPS hostings are easily scalable as per the requirement and demand, making them suitable for growing businesses that require continuous upgrading of the services.
  • Control: With VPS hosting, you get more control and power to manage your hosting, as it comes with root access. This means you can edit and customize every aspect of your server effortlessly.
  • Security: The virtually isolated hosting environment and full root access enhance your security to the optimal level.

What are the prerequisites for installing WordPress on VPS?

Let us first understand what are the things required before you start installing WordPress on VPS. Managing these prerequisites help you install the WordPress on your server quickly and faster

  • A VPS Server: Before you start installing the WordPress, make sure you have the virtual private server with latest Operating system versions, such as Ubuntu 20.04 or 22.04
  • Root or sudo user access: It is required to have root access or a sudo user to install WordPress if you are trying to install it manually.
  • SSH client: SSH clients like PuTTY or Terminal help you connect and communicate with the server.
  • A domain name: You should have a domain name that points the VPS IP for the production purposes
  • Basic familiarity with Linux commands: Finally, it is expected to have a basic knowledge of Linux commands, as it will be required while installing WordPress manually on the server. We will give multiple commands in Terminal for the installation.

Method 1: Installing WordPress using a one-click installer

Many VPS hosting providers offer a one-click WordPress installer, knowing the popularity and requirement for WordPress. These hosting providers allow you to install WordPress in one click through their control panel, such as:

  • cPanel or CyberPanel
  • Vultr Apps
  • Linode one-click Apps
  • CloudWays

Step-by-step guide to install WordPress through one-click Installer

  • Step 1: First, log in to your VPS provider’s Dashboard using user credentials such as username/email and password
  • Step 2: Once you log in to your control panel, look for one-click installs, often labeled as Softaculous or something similar like this.
  • Step 3: Here in the one-click installer, search and find WordPress. It might be written like “WordPress on Ubuntu 22.04” or “WordPress LAMP stack.”
  • Step 4: Once you select and click on WordPress, the installer will guide you through the configuration steps, which typically includes
    • Choosing a domain name
    • Choosing a protocol between HTTP and HTTPS based on if you have SSL certification or not (Mostly a VPS comes with SSL certification)
    • Database setup (The installation will do most of the setup; you just need to apply or verify them.)
    • Choosing plugins or themes if needed
  • Step 5: Once the configuration for WordPress is completed, you are all done; soon you will receive a link to your dashboard for logging in and accessing your WordPress CMS.

However, to ensure the efficient process, you must fulfill the prerequisites for the installation; otherwise, it might bring difficulties installing WordPress.

Pros and Cons of installing WordPress Using a One-click installer on VPS

Pros (Benefits) of Using a One-Click installer for WordPress Installation on VPS

  • Quick Setup: The one-click installer allows quick and super-fast setup without requiring advanced knowledge of hosting and coding; it is simple and useful for setting up WordPress as a content management tool.
  • Beginner-friendly: With the help of the one-click installer, even novices can easily install WordPress or other necessary software on VPS.
  • No Linux command needed: As we went through the step-by-step guide, you must have realized we have not used even a single line of Linux command or anything similar to coding. It is just like installing any other software or application.

Cons (Risks) of using a One-Click installer for WordPress installation on VPS

Despite being beginner-friendly and offering quick setup, the One-click installer comes with certain risks or compromises that you might have to deal with, such as

  • Less Control over Configuration: The automatic WordPress installation results in less control over the customization of the CMS and hosting services. You have to compromise on the root-level configuration in your WordPress.
  • May install or configure unnecessary software: Installing WordPress through a one-click installer may install unnecessary software or plugins on your hosting and can make your server even slower.
  • Difficult to hunt troubleshoots: Since everything is done automatically, you can’t do much on the root level if you face any troubleshoot or difficulty. Either you have to install it again or compromise with the existing CMS.

Method 2: Installing WordPress manually

One-click installer is good for beginners and quick setup but what if you need complete control and no compromise? Then you choose to install WordPress on your VPS manually with Linux commands through Terminal or an SSH client like PuTTY.

Here is the step-by-step guide to install WordPress manually with commands

Step 1: Connect to your VPS via SSH

Access your VPS via SSH using Terminal or PuTTY, depending on your operating system and its version. Giving the following command will enable you to do so:

  • ssh root@your_vps_ip

Where your_vps_ip will be your actual IP address

Step 2: Update your server

Now before installing and configuring anything, it is essential to ensure the latest security and performance patches. You can update the server by giving command as

  • sudo apt update && sudo apt upgrade -y

Step 3: Install the Linux, Apache, MySQL, and PHP (LAMP) stack.

Now, here you need to install 3 basic prerequisite components for WordPRess installation known as LAMP stack

●      Install Apache with this command

sudo apt install apache2 -y

●      Install MySQL with the following command:

sudo apt install mysql-server -y

●      To secure MySQL on the server, use this command.

sudo mysql_secure_installation

●      Install PHP and other required extensions. To do this, you can follow this command:

sudo apt install php libapache2-mod-php php-mysql php-cli php-curl php-gd php-mbstring php-xml php-xmlrpc php-soap php-intl php-zip –y

This will install all the required LAMP stacks with proper PHP extensions as well and now just restart your apache with this command and your LAMP stack setup is completed

sudo systemctl restart apache2

Step 4: Create MySQL Database for WordPress

To create a database for WordPress in MySQL, first you have to log in by giving this command:

sudo mysql -u root -p

Now run the following command to create the database:

CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

CREATE USER ‘wpuser‘@‘localhost’ IDENTIFIED BY ‘your_strong_password‘;

GRANT ALL PRIVILEGES ON wordpress.* TO ‘wpuser’@‘localhost’;

FLUSH PRIVILEGES;

EXIT;

Note: Remember to change the user name and password as per your requirement and keep it safe for further setup.

Step 5: Download and configure WordPress

Here in this step you will actually download and configure the WordPress setup manually.

To do this, you will be doing this in 6 steps

●      Navigate to Webroot with this command: cd /var/www/html

●      Remove the default index file. To remove this use, ‘sudo rm index.html’ command

●      Download WordPress:

You can either download WordPress directly from the website with a Linux command or upload the downloaded file to the root directory. You can use the following command to download WordPress directly on the server

sudo wget https://wordpress.org/latest.tar.gz

sudo tar -xvzf latest.tar.gz

sudo mv wordpress/* .

sudo rm -rf wordpress-latest.tar.gz

●      Create the configuration file:

Now you will create a configuration file and edit the wp-config.php file with following linux commands

To create the configuration file: sudo cp wp-config-sample.php wp-config.php

To edit the wp-config.php file: sudo nano wp-config.php

●      Update the database details

Update the database details to your server hosting so that your server can fetch the right details and save the data accurately on your created database.

Here is the command to update the database details:

define(‘DB_NAME’, ‘wordpress‘);

define(‘DB_USER’, ‘wpuser‘);

define(‘DB_PASSWORD’, ‘your_strong_password‘);

Note: Please note that these commands are just for example, and you have to edit them before giving the command. Change the database name, username, and password to the actual ones set up by you previously while creating the database in step 4.

Make sure you save all the settings before you exit from nano and then click enter

Additionally, before we configure Apache, we have to set permissions so that our web server (Apache) can read, write, and access root directories to host websites and all the other tasks. These permissions can be set with the following command in the terminal:

sudo chown -R www-data:www-data /var/www/html

sudo chmod -R 755 /var/www/html

Step 6: Configure Apache for WordPress

Configuring Apache for WordPress is a crucial step in WordPress installation, as it locates the WordPress files in the root and ensures the proper response when your website is accessed. Apache configuration in the terminal involves the following three sub-steps:

  • Creating a virtual host file:

To generate the virtual host file, use this command:

To generate the virtual host file, use this command:

  • And then paste the following commands:

<VirtualHost *:80>

    ServerAdmin admin@example.com

    DocumentRoot /var/www/html

    ServerName yourdomain.com

    ServerAlias www.yourdomain.com

 

    <Directory /var/www/html>

        AllowOverride All

    </Directory>

 

    ErrorLog ${APACHE_LOG_DIR}/error.log

    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

This command includes the email, server name, and server alias, which you must change with your actual details.

  • Enabling the configuration and rewriting the module with the following command:

sudo a2ensite wordpress.conf

sudo a2enmod rewrite

sudo systemctl restart apache2

Note: If you don’t have a domain name yet, you can use your VPS IP address to access your site details.

Step 7: Complete the installation on the web browser

Once you complete step 6, which is configuring your Apache, you are done with the Linux command; you just now have to complete the next process from the web browser.

To do this, type and enter your website URL or VPS IP address in a web browser. For example:

http://yourdomain.com

or

http://your_vps_ip

Here finally you will see all the WordPress setup wizard. It includes three four steps, such as

  • Choosing language
  • Setting site title, admin username, and password
  • And then installing WordPress.

Once this step is finalized, your website should be live on your VPS, and now you can decide to make it public or keep it private as you wish.

Summarizing the Guide

Installing WordPress on a VPS can be easy and difficult at the same time, depending on the process you opt for. If you are a beginner and have never used WordPress, we recommend you go with the one-click installer, but if you have basic knowledge of Linux SSH commands and LAMP setup, go with manual installation, as it provides more control and security options.

We have explained both processes step by step in this guide; however, at it4int, we are determined to help our clients at every step in the process of their hosting with us. So, if you

Visit Our Service Page:

india cheap dedicated server
low cost dedicated server india

Related Articles

web hosting web hosting small business

Why Fully managed web hosting is best for SMBs?

Online businesses are budding day by day all over the world. Well-established companies take their businesses online fairly easily, but small and medium businesses often lose customers as a result of inadequate online services or not being online at all. The needs of today’s SMBs are complex as they grow rapidly. Web host companies provide […]
Read more
anti DDoS

Understanding the Basics of Windows server and its key feature

Windows Server is an operating system designed to manage and control server machines. It provides a platform for managing networked resources and is used in many businesses, organizations, and enterprises to run applications, databases, and websites. The architecture of Windows Server is similar to that of Windows desktop operating systems. It includes a graphical user […]
Read more
sql server

How to Configure Windows Server to access SQL Server Remotely

Typically, SQL Server is accessed by connecting with your company’s Active Directory account, which is your login account for your company network with servers, or by connecting with a SQL standard account, which is your login and password. To connect to a SQL Server, you must also know what tool you can use. Here you […]
Read more
Search for: