Install Latest Version WordPress on Linux with Apache, Maria DB and PHP

654 0
Install Latest Version WordPress on Linux with Apache, Maria DB and PHP

Today, I am going to show you how to install latest version of WordPress on Linux system epically on Ubuntu (and its derivatives), Debian (and its derivatives), Linux Mint, Elementary OS. This article focus on the WordPress Installation on your Linux system locally using Apache, Maria DB and PHP7. Before starting, you must familiar with WordPress CMS platform and download it from its official website:

This article assumes that you have already installed and set up a LAMP stack on your Linux, if not please click the below link and follow the steps to install LAMP stack.

If you have already done or finishing LAMP installation, follow the below steps to install WordPress with LAMP stack.

Install Latest Version of WordPress on Linux using LAMP Stack

Step 1: Download latest version of WordPress

Before downloading, just update your all software by this command.

sudo apt-get update && sudo apt-get upgrade

Now, download the latest WordPress archive file on your Linux machine using following command.


After completion, extract the archive using this command.

tar xvf latest.tar.gz

Now, we move this extracted folder (directory named wordpress) to the Apache web root using below command.

sudo mv wordpress/ /var/www/website-name

Remember: Replace website-name with your own name.

Step 2: Create Maria Database for WordPress Site

In this step, you need to create database and use for wordpress website you named. For this, open your terminal (as root) and log into MariaDB shell as root.

mysql –u root –p

Once you are logged in, create a database for your WordPress using below command.

create database DB-name

Remember: Replace DB-name with your Database name. You can use whatever name you like.

After that, below command provides the database user for WordPress and also grant all privileges on WordPress database to the user. Just enter the following command once by once.

grant all privileges on DB-name.* to username@localhost identified by ‘nepkoder;

Where, DB-name is your Database name entered at above step.
username is your user name for your database. (You can use any name)
nepkoder is your user password for database access. (You can use any password)

Now, enter below command

Flush privileges;

Step 3: Configure WordPress for Database

Go to your directory where you installed WordPress by this command on your terminal.

cd /var/www/website-name

Copy sample config file to new one.

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

Edit new config file.

sudo nano wp-config.php

Note: you can directly edit your config file using any editor.

On that php file, replace the red texts with your database name, username and password you created in the previous step.

/** 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’);

And finally save and close the file and enter below command to set the Apache user (www-data) as the owner of the WordPress site directory.

sudo chown www-data:www-data /var/www/website-name/ -R

Now, access your localhost sever and enter the WordPress website name on your browser.
Hoping that everything went on just fine, you now enjoy WordPress on your Linux system. If you have any question on this article, you can use the comment section below for your valuable feedback.

Leave A Reply

Your email address will not be published.

Pin It on Pinterest