Installing WordPress in your own VPS
Installing WordPress in your own VPS (Virtual Private Server) can seem somewhat daunting in an age of cPanel, Plesk and One-click installs. However, if you want maximum control over your wordpress installation for security and performance reasons, then manually installing WordPress in your server is the way to go.
First, we must check that we have some basic software is installed on the server so that WordPress can function correctly.
Pre-Install Checklist (LAMP Stack):
- Linux: This will most likely come installed in your VPS. Depending on the Distribution, some of the commands may differ a bit. For this article, I will focus on Ubuntu 18.04.
- Apache: This is the webserver. The web server translates requests from the Internet into web pages that your visitors can see. Apache is one of the oldest and most popular web server technologies and works great with static html pages, but for dynamic pages, such as WordPress, it can cause performance issues. I really like using Litespeed Server and the free OpenLitespeed Server, since it comes with built-in caching and it can handle 10-80 times the traffic compared to Apache, without causing the website to go down.
- MySQL or MariaDB: This is the Database engine. All Content Management Systems (CMS) use databases to index, coordinate and relate information from different pages to display on your websites. I like using MariaDB version 10 and above because it offer performance improvements over MySQL for WordPress applications.
- PHP: WordPress is written in this programming language. For optimal security and performance, we recommend using PHP version 7.3 or above.
- DNS: Your domain’s A record should be pointing to your VPS server’s IP address..
Location of Website Files
You can find the location of your website files by going to the following directory:
/var/www/wordpress or /var/www/yourwebsite.com/public_html
Once you go to the directory, you can check that the server is working by creating a simple index.html page by typing the following commands:
nano index.html or
sudo nano index.html if you are not running as root.
This should open the nano text editor within Linux, and you can type in something like:
<h1>Webserver Test Ok</h1>
To exit the nano editor, press “Control+X”, press “Y” to confirm that you want to save the file “index.html” and “Enter” to confirm again.
Now, for the final test. If you go to your website URL in your web browser, you should see a blank page with the following text:
Webserver Test Ok
Install SSL Certificate