Nowadays many people decide to create a blog to write about many topics. Some of these blogs are about technology or other topics. In this sense, WordPress is a very popular application for the creation of blogs. Therefore, this article is about how to install WordPress 5.1 on Ubuntu 18.04 LTS.
For the creation of blogs there are several alternatives such as Blogger, however, it is not reckless to say that WordPress is the most popular and robust solution in its field.
This is because in WordPress you don’t need programming skills to build your website. On the other hand, it is open source which guarantees its growth and community support. It is also quite customizable and has extensive technical support.
In addition to WordPress, the creators of Blog choose Ubuntu 18.04 LTS to install all its content there, because it is a new and robust version of the most popular distribution in the world.
Let’s install WordPress 5.1 on Ubuntu 18.04 LTS.
1. Upgrade the system
Before you start installing WordPress you must make sure that the system is up to date. With this you will have the latest security patches and the system will be more reliable and stable. To do this, run the following command.
:~$ sudo apt update && sudo apt upgrade
It is always advisable to do this periodically.
2. Install Apache web server
:~$ sudo apt install apache2
Now, enable and start the Apache web server service.
:~$ sudo systemctl enable apache2 :~$ sudo systemctl start apache2
The goal of this is to make apache boot when the system boots.
Now, open your web browser and go to
If you see the image above, apache is correctly installed.
3. Install PHP
In this step, you have to install PHP. This in order to be able to run WordPress properly. In addition to the language, it is necessary to install some additional modules.
:~$ sudo apt install php7.2 libapache2-mod-php7.2 php7.2-common php7.2-mbstring php7.2-xmlrpc php7.2-soap php7.2-gd php7.2-xml php7.2-intl php7.2-mysql php7.2-cli php7.2 php7.2-ldap php7.2-zip php7.2-curl
Now it’s time to check that PHP is working.
Create a file called
:~$ sudo nano /var/www/html/test.php
And add the following:
<?php echo "PHP is working"; ?>
Next, open the file through the web browser
Finally, PHP is working fine.
4. Install MariaDB
WordPress requires for its operation the installation and configuration of a database manager application.
MariaDB is a great alternative for this since it is free and above all stable. It is also compatible with MySQL as it is a fork of MySQL.
:~$ sudo apt install mariadb-server
Then, enable the service and start the service.
:~$ sudo systemctl enable mariadb :~$ sudo systemctl start mariadb
Now, you need to configure a root key for MariaDB. You can also configure other things there. To do this, run the
:~$ sudo mysql_secure_installation
As you can see, I said Y, N, Y, Y to the questions.
Once MariaDB is correctly installed and configured, it is necessary to create the database and the WordPress user.
:~$ sudo mysql -u root -p
CREATE DATABASE wordpress; USE wordpress; GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpressuser'@'localhost' IDENTIFIED BY 'wordpresspss'; FLUSH PRIVILEGES; exit;
Now, you can install WordPress.
5. Install WordPress
The time has come to install WordPress. First, download it.
:~$ cd /tmp :~$ wget https://wordpress.org/latest.tar.gz
Now, decompress the file.
:~$ tar -xvzf latest.tar.gz
Then move the folder to
/var/www/html. Next, change the folder owner and assign permissions.
:~$ sudo mv wordpress/ /var/www/html/ :~$ sudo chown -R www-data:www-data /var/www/html/wordpress/ :~$ sudo chmod 755 -R /var/www/html/wordpress/
Now, you can complete the installation from the web interface.
6. Completing the installation
Now, through the web interface, it is necessary to complete the installation. Go to
http://IP_SERVER/wordpress and you will see the following.
In the next step, you will have to enter the information corresponding to the database.
Then you can continue with the installation.
Then, enter the information from your website or blog that you want to create. You also have to create the username and the password.
When you continue, you will get the screen to log in, with the admin user and the password you defined.
And finally, you will see the WordPress dashboard.
And that’s it. If you scroll down, you will see the current version.
If you want to create a blog or a personal web site, I think your first option to do so is WordPress, because its installation is not complicated, and because it is free. All this without losing robustness and power.
Please share this article with your friends.