XRL Tech Corner

Font size: +

Install Wordpress on ubuntu

In this tutorial we will install Wordpress in Ubuntu and we will configure it by default.

We will start by opening the Ubuntu virtual machine that we created in the previous tutorial: how to install Ubuntu in a VirtualBox virtual machine.

We are also going to need the tutorial: how to install Apache, MySQL and PHP in Ubtuntu .

The first thing we are going to do when starting the operating system is to open a terminal with Ctrl + Alt + T. Once we are inside we will create the database that will house the Wordpress engine.

For this we are going to connect to the database through the mysql client:

Carlos @ tutorial: ~

mysql -u root -p

If we do not specify a password when installing the MySQL package, the password will usually be blank, so just press the "Return" key when you ask for it.

Next we will create the database with the following sentence:


Now we will create a user that will be called wpuser to connect to the database from Wordpress:

CREATE USER wpuser @ localhost IDENTIFIED BY 'wpuser1234';

Next we will give privileges to that user for the wordpress database:

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

Note : To consolidate these permits we must record them with the following command:


Once these actions are done, we will write exit to exit the mysql client.

Next we will download and install Wordpress in its latest version.

We will go to our main user directory by typing the cd statement and download the latest available version:

wget http://wordpress.org/latest.tar.gz

We will unpack it using the tar command:

tar xvf latest.tar.gz

Once finalized we will erase the file latest.tar.gz to free disk space.

We will access the directory:

cd ~ / wordpress

and we will copy the configuration file (that comes from example) to a new configuration file that will be the final one:

cp wp-config-sample.php wp-config.php

Now we will edit it with the VI for example (you can use any other editor):

vi wp-config.php

and we will make the relevant changes in the following parameters:

define ('DB_NAME', 'database_name_here');

define ('DB_USER', 'username_here');

define ('DB_PASSWORD', 'password_here');

define ('DB_HOST', 'localhost');


define ('DB_NAME', 'wordpress');

define ('DB_USER', 'wpuser');

define ('DB_PASSWORD', 'wpuser1234');

define ('DB_HOST', 'localhost');

Once updated the configuration file we will have to copy all that wordpress directory to the directory where we have the html files used by the Apache.

In our case we will create the blog directory just below html.

In this way if we want to design and publish a web later, we would access the blog under the context / blog. If instead we want our website to be the blog engine only, then we could locate the wordpress files right inside html:

sudo mkdir / var / www / html / blog

sudo cp -rp ~ / wordpress / * / var / www / html / blog /

The sudo will ask you to enter the user password.

Now we must change the owner of the files to be www-data, which is the user that Apache habitually uses.

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

Perfect, now we will continue the final installation from the web browser.

For this we will enter the browser specifying our IP address (or localhost) and access the Wordpress installation screen.

http: // localhost / blog

In the installation screen, we will select the language and click " Continue ".

wordpress first install browser

then we must enter the title of the site, a username and a password and mail for the administrator. Next we will click on " Install Wordpress ".

wordpress create user

Then click on " Access ."

wordpress installed

We will get the login screen to enter the administration panel, so we will have to enter the user that we just created who is the blog administrator. We will introduce the previous name and password and click " Access ".

Wordpress Logged Admin

Once inside we will see the "Desktop" and a lot of menu options, as well as a central part with several options and panels.

At first glance it may seem a bit overwhelming, but it will be a matter of seeing what it is for, and above all, trying it out.

This is the installation and basic configuration of this fantastic blogging engine.

Rate this blog entry:
How to install and configure a phpBB forum in ubun...
How to install Apache, PHP and MySQL in Ubuntu

Related Posts



No comments made yet. Be the first to submit a comment
Wednesday, 18 September 2019

Captcha Image