Install and configure WordPress in Ubuntu


Wordpress is the most popular open-source CMS framework for website building. Wordpress runs on the top of the PHP language and uses MySQL or MariaDB as database. Wordpress is easy to run blogging or cart websites and it does not need costly server. Also it does not need heavy programming knowledge to run Wordpress project and it is open-source CMS web framework. Thats is why Wordpress is most popular in running websites.

There are many ways to install and run Wordpress project. In this article, We will download Wordpress project from the official site and configure as this is the easy way to install and configure ubuntu.


You need to be logged in as non-root user with sudo permission. You should already installed LAMP stack installed in your server.

Download and install Wordpress

After installing LAMP stack, first of all, download latest Wordpress project compressed tar file. For that, go to the apache2 root folder.

cd /var/www/html

Download latest version of Wordpress project compressed file.

wget -c

Extract project folder, Now your project is ready to run.

tar -xzvf latest.tar.gz

Give necessary permission for project

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

Create MySQL database

You have downloaded Wordpress project, now you will need to create and setup database. So first, login to MySQL command line shell.

mysql -u root -p

Type password and you will redirect to MySQL command line shell. Create database using bellow command.

CREATE DATABASE wordpress_database;

Create new user and grant permission to database

GRANT ALL PRIVILEGES ON wordpress_database.* TO 'wordpress_username_here'@'localhost' IDENTIFIED BY 'wordpress_password';

And flush privileges


Last exit MySQL command line.


Setup and run Wordpress project

Now you have also created database. In the last, setup Wordpress project and run in the browser. First go to the project root directory and copy or rename wp-config-sample.php file to wp-config.php file.

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

Then open wp-config.php file and change database credentials to yours one.

/** The name of the database for WordPress */
define( 'DB_NAME', 'wordpress_database' );

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

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

And run your website address in browser and you will get bellow screen Wordpress setup wizard. Just run through setup wizard. First select language.


Input admin details.

Thats it. Your Wordpress website is configured and now you can login to your Wordpress admin panel and setup website.


This way, you can simply run Wordpress website. I hope this will help you to setup new Wordpress website.