How to install WordPress
Always wanted to create your own website? Are you inexperienced with programming, but familiar with Microsoft Word? If you answered both questions with yes, then WordPress would be the ideal framework for you to build your own website. This guide will provide an comprehensive description on how to install WordPress.
WordPress is a framework designed for building blogs or small websites. It is designed for people who would like to create their own website, but lack programming knowledge. Once installed, WordPress can be extended by applying plugins. One of these plugins is WooCommerce which can be used to extend your site with a shop. WooCommerce can easily so that you can add your own payment service provider. With a few clicks you have your shop up and running without having to even think about designing complicated code.
In order to use WordPress, it needs to be installed. WordPress can be installed by several methods. This guide will focus on one of these methods. After following this tutorial, you will be able to use WordPress in your own web environment.
Step 1: Install Web Server
In order to run WordPress, it needs to be running on some sort of webserver. A webserver is a piece of software which is required to let people access your server. It consists of a set of rules which points users to the right webpage. For this tutorial we will be using Apache. To install Apache run the following command:
$ sudo apt-get install apache2
Once installed, Apache needs to be enabled.
$ sudo service enable apache2 $ sudo service restart apache2
To check if the database is installed, you can enter the IP address of the machine which contains WordPress in the address bar. The following screen should be visible when Apache has been correctly installed.

Note: Apache automatically stores files in the directory: /var/www/html
Step 2: Install Database
Now that the webserver is installed, we need to install the database as well. The database will be used to store all the information necessary to run the WordPress sites. Some examples of data stored in the database are: users, posts & pages. We will use a MySQL database server. To install the MySQL server, run the following command.
$ sudo apt-get install mysql-client mysql-server
The installation will ask you for several options. Please remember these options, because they will be necessary at a later stage.
Step 3: Install PHP and Modules
Now PHP is necessary in order to run the back-end code. To install PHP run the following command.
$ sudo apt install php php-curl php-soap php-mysql php-gli php-cli php-gd libapache2-mod-php7.2
To check if all is installed correctly, please create a file: test.php at the root directory of your webserver. The file should contain the following code:
<?php phpinfo(); ?>
You can now access this file using: http://[[[YOUR IP ADDRESS]]]/test.php. If all is installed correctly, the following PHP properties should be visible.

Step 4: Install WordPress
Change directory to web server Document root.
$ cd /var/www/html
Now install WordPress by using the following commands:
$ wget http://wordpress.org/latest.tar.gz $ tar -xvzf latest.tar.gz $ mv wordpress/* . $ rm -rf wordpress/
Make sure that WordPress is running using the right permissions.
$ sudo chmod 755 /var/www/html/ $ sudo chmod -R 755 /var/www/html/
Step 5: Connect Database & WordPress
Login to your mysql database with the credentials provided at step 1. Do this by running the following code in your terminal.
mysql -uroot -p
root is our chosen username, this can different based on your chosen username. Now continue by creating a new database.
mysql> CREATE DATABASE turtle;
Your database is now created and ready to be used. Now a config file needs to be made so that WordPress knows which database should be used. WordPress provides a sample config file. The easiest thing here is to copy this file and adapt it.
$ mv wp-config-sample.php wp-config.php
Now edit this file using your favorite editor. We will be using nano.
$ nano wp-config.php
Here you can see all the configurations. At least change the database username, password and database name here according the earlier accessed database information. Finish by saving your file. Now restart Apache.
$ sudo service apache2 restart
WordPress should now be up and running. Test this by filling in your IP address inside your URL bar again. The site should be visible now.