How to set up WordPress on Ubuntu

Before installing WordPress your LAMP stack must be ready. Here is the link to previous article on how to install a LAMP.

Installation of WordPress:

1.Download the latest WordPress package and extract it:

tar -zxvf latest.tar.gz


2.Then move the WordPress files from the extracted folder to the Apache default root directory, /var/www/html/:

cp -a wordpress /var/www/html/

3.Set the correct permissions on the website directory, which means giving ownership of the WordPress files to the web server as follows:

chmod -R 755 /var/www/html/

chmod -R 755 /var/www/html/

4.Create a WordPress Database :

mysql -u root -p


Remember to use your own, values for databaseName, databaseUser, and also use a strong and secure password as databaseuserPassword:

MariaDB [(none)]> create database DatabaseName;

MariaDB [(none)]> grant all privileges on DatabaseName* to 'DatabaseUser@localhost' identified by 'DatabaseuserPassword';

MariaDB [(none)]> flush privileges;



5.Go the /var/www/html/ directory and rename existing wp-config-sample.php to wp-config.php:

mv wp-config-sample.php wp-config.php
then update it with your database information under the MySQL settings section shown below :

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'database_name_here');

/** MySQL database username */
define('DB_USER', 'username_here');

/** MySQL database password */
define('DB_PASSWORD', 'password_here');

Afterwards, restart the web server  service using the command below:

service apache2 restart

Open your web browser, then enter your server address: http://localhost to get the welcome page below. Read through the page and click on “Let’s go!” to proceed further and fill all requested on screen information .



You can now enjoy WordPress on your system.








Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s