Installing WordPress on VPS? Here's How to Get Started Fast!

Learn how to install WordPress on a VPS quickly with our step-by-step guide. Perfect for beginners looking to set up their own website.

Updated: 24 Sep, 24 by Lisa P 10 Min

List of content you will read in this article:

By installing WordPress on a VPS the doors of a new world full of flexibility, resources, and greater control on your CMS opens up. The process of Installing WordPress on VPS might sound intimidating at first, but after reading this article you will see that it actually has a straight-forward process. We will walk the process step-by-step together from how and why to install WordPress on VPS to how to manage it. So fear not and let's go about it.

VPS, Virtual Private Server is an isolated virtual environment which is owned and operated by a third-party web or cloud hosting service. It is a machine hosting all the data and software that an application or website needs. It only uses a portion of the server’s underlying physical resource, hence the Virtual, which is managed by third party providers.

There are a lot of benefits with acquiring a Virtual Private Server. You will acquire more resources such as memory, storage and bandwidth that is yours only and it is way easier and faster to upgrade said resource via contacting your provider. You will have complete control over the server at a reasonable price which can be a booster to your Web page operating on WordPress.

There are a lot of WordPress Friendly VPS services which offer you their own way to install WordPress on VPS through their own control panels with comprehensible guides, but if you want to have a set of steps to Install WordPress on VPS manually, this is the guide for you.

Install WordPress on VPS manually

Step One: Connecting VPS through SSH

To be able to have access to the VPS you will need a Secure Shell (SSH) Clinet. Secure Shell or SSH for short, is a network protocol giving users, specially system admins, a secure way to access a computer over an unsecured network. It also provides strong encryption. It is used broadly to manage systems and applications remotely.

One of the Secure Shell clients which we will use throughout this guide is Putty. Putty is an open source software which is developed and supported by a group of volunteers. To continue this guide you first need to download and install Putty. Once you have done that, open the application.

image 1 provided via screenshot

When you open the application you will see a section in which you can input your IP address. Type your VPS IP address in that field and set port option to 22. Under connection type you must choose SSH. Then click Open.

A command window will open up asking you what you want to login as, Type the word “Root”. And enter your password when asked. If you go through the steps correctly your VPSs name will be displayed and we can carry on to the next step of the process.

image 2 provided via screenshot

Step Two: Installing The Required Software for WordPress

To be able to run and have a functioning WordPress, you need to install a few applications. In this guide we will install Apache as the HTTP server needed, MariaDB as a database and the latest version of PHP. You will be able to install all three with one single command which directs your server to download the files necessary and set them up.

sudo yum install httpd mariadb mariadb-server php php-common php-mysql php-gd php-xml php-mbstring php-mcrypt php-xmlrpc unzip wget -y

This command will ready up the underlying software but you need to direct your server to boot it up each time with the following commands:

sudo systemctl start httpd

 

sudo systemctl start mariadb

 

sudo systemctl enable httpd

 

sudo systemctl enable mariadb

Now you are one step closer to finishing everything off and installing WordPress on your Virtual Private Server (VPS).

Step Three: Creating a Database for WordPress

MariaDB is the software we are using for creating our WordPress database. MaraiDB, created by the original developers of MYSQL, is an open source popular software which is used by a lot of websites. According to MariaDB Foundation MariaDB Server turns data into structured information in a wide array of applications, ranging from banking to websites. Originally designed as an enhanced, drop-in replacement for MySQL, MariaDB Server is used because it is fast, scalable and robust, with a rich ecosystem of storage engines, plugins and many other tools that make it very versatile for a wide variety of use cases.

The first thing you must do is to make sure your MariaDB installation is secure against being accessed remotely by unwanted agents. To do this, you should start with entring the following command:

sudo mysql_secure_installation

Following this  MariaDB will ask for the root user password, which if not set will be blank, hitting enter you will be able to set a new root password. To be able to access the rest of the options hit Y. you will be able to disallow remote logins within the four options you will have.

After this you need to login to your MariaDB account using the root password you set with the following command.

mysql -u root -p

Now that you have logged in you need to run the following commands one by one individually, it is advised to replace the placeholder user and passwords for more security.

Command One: │CREATE DATABASE wordpress;

Command Two: │GRANT ALL PRIVILEGES on wordpress.* to 'user'@'localhost' identified by 'password';

Command Three: │FLUSH PRIVILEGES;

Command Four: │exit

Finishing off these four commands you will have a ready to use database. Now there is only one step left.

Step Four: Installing WordPress

After setting up all the prerequisites, the last thing left to do is to install WordPress itself. First we need to download the software. There are a series of commands which will download the latest version of WordPress onto your Virtual Private Server (VPS), and will relocate them into your root directory. Run the following command individually for them to work properly.

Command One: │wget http://wordpress.org/latest.tar.gz

Command Two: │tar -xzvf latest.tar.gz

Command Three: │sudo cp -avr wordpress/* /var/www/html/

The next thing we ought to do is create a folder for the installations. We also need to give correct permissions to files and folders. The following commands will achieve the result we are looking for:

sudo mkdir /var/www/html/wp-content/uploads

 

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

 

sudo chmod -R 755 /var/www/html/

Now we need to rename and connect the WordPress wp-config-sample.php file to the database.

cd /var/www/html/

 

sudo mv wp-config-sample.php <a class="wpil_keyword_link" href="https://www.elegantthemes.com/blog/tips-tricks/wordpress-wp-config-php"   title="wp-config.php" data-wpil-keyword-link="linked">wp-config.php</a>

 

sudo nano wp-config.php  │

this command will open up the Nano editor within the command line. What you have to is to replace the fields blow with the your own information which you had during the prior steps.

define('DB_NAME', 'wordpress');

 

define('DB_USER', 'user');

 

define('DB_PASSWORD', 'password');

After replacing the fields, you need to use the key command “CTRL +O” to save the changes you made to the file and “CTRL +X” to close the Nano editor. Now we only need to do the configuration related to the VPS and allow connections with the following commands:

sudo firewall-cmd --permanent --zone=public --add-service=http

 

sudo firewall-cmd --permanent --zone=public --add-service=https

 

sudo firewall-cmd --reload

 

And that’s about it, after running these commands you will be able to have access to WordPress installer by putting your VPS IP in front of “http://” and you will have a working WordPress on Virtual Private Server.

How to install WordPress with Softaculous

If installing WordPress manually is not your preferred option, third-party options are always out there for you. One of the said third parties is Softaculous. Softaculous is an auto installer for apps such as WordPress, Joomla, Drupal, Magento and others. It also integrates with control panels like Webuzo, cPanel, Directadmin, Plesk and more.

Softaculous offers a wordpress manager which allows you to manage your WordPress Plugins, Themes, Posts, Upgrade settings, Wp-config Setting and much more.

Here we will go through installing WordPress using Softaculous in four steps, Starting with:

Step One: Login to Control Panel

First you need to open your chosen control panel and login with your login information. Then find the Softaculous icon and click it. By clicking the icon you will be directed to the Softaculous enduser panel.

image 3 provided from Softaculous

Step Two: Select WordPress

Now that you have gotten to the Softaculous enduser panel, you should search for WordPress and select it.

image 4 provided from Softaculous

 

After this you will be directed to the WordPress page by clicking on Install you will reach the install form.

image 5 provided from Softaculous

Step Three: Fill The Install Form

Now you need to fill the form displayed. In this form you will be required to set your Admin Username, password, and email alongside much more details. Some of the details of the form is prefilled, you can leave it as default or change it to your own preference. After filling out the form

click Install at the bottom of the page and wait for the process to be over

image 6 provided from Softaculous

Step Four: All Done!

When the installation is complete you will see a message congratulating you for a successful installation.

Now you can access your WordPress admin panel and website.

At the end of the day the advantages Installing WordPress on a Virtual Private server offers are too much to miss out on. significant advantages such as having more control, flexibility and all and all better performance will take you a step forward in managing your web page. With the help of this guide you will be able to set up your WordPress on VPS by yourself regardless of the expertise you possess. regardless of setting up WordPress on VPS manually or by using a third-party installer such as Softaculous hosting you WordPress on VPS will give you a more secure and efficient online presence.

Lisa P

Lisa P

Hello, everyone, my name is Lisa. I'm a passionate electrical engineering student with a keen interest in technology. I'm fascinated by the intersection of engineering principles and technological advancements, and I'm eager to contribute to the field by applying my knowledge and skills to solve real-world problems.