Install WordPress on Ubuntu 18.04 Bionic Beaver Linux

Objective

The objective is to install WordPress on Ubuntu 18.04 Bionic Beaver Linux

Operating System and Software Versions

  • Operating System: – Ubuntu 18.04 Bionic Beaver
  • Software: – WordPress 4.9.4 or higher

Requirements

Privileged access to your Ubuntu System as root or via sudo command is required.

Conventions

  • # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
  • $ – requires given linux commands to be executed as a regular non-privileged user

Other Versions of this Tutorial

Ubuntu 20.04 (Focal Fossa)

Instructions

Prerequsites

Let’s start by prerequisites. For the WordPress installation we will need curl, unzip and tasksel command. The following linux command will install all three:

$ sudo apt install -y curl unzip tasksel

This guide will use Ubuntu LAMP stack ( Linux, Apache, MySQL, PHP) to run under the WordPress installation.

If you wish to run WordPress using Nginx webserver then follow our guide on How To Install Nginx, MariaDB, PHP (LEMP stack) on Ubuntu 18.04.

Next, install Ubuntu LAMP stack using tasksel command and enable rewrite mode:

$ sudo tasksel install lamp-server
$ sudo a2enmod rewrite
$ sudo systemctl restart apache2

We are now ready to download WordPress.



Download WordPress

At this stage we are ready to download and unzip WordPress into webserver’s root directory. Start by downloading the latest WordPress package using curl command:

$ curl --output /tmp/wordpress.zip https://wordpress.org/latest.zip

Next, install WordPress files into Webserver’s root directory /var/www/html and change the file ownership to www-data:

$ sudo rm -fr /var/www/html
$ sudo unzip /tmp/wordpress.zip -d /var/www/
$ sudo mv /var/www/wordpress/ /var/www/html
$ sudo chown -R www-data.www-data /var/www/html

Configure Database

In this section we will create a new MySQL database wordpress and assign a user access to it to a new user admin with password pass:

$ sudo mysqladmin create wordpress
$ sudo mysql -e "CREATE USER 'admin'@'%' IDENTIFIED BY 'pass';"
$ sudo mysql -e "GRANT ALL PRIVILEGES ON wordpress.* TO 'admin'@'%' WITH GRANT OPTION;"

For more configuration options regarding MySQL database installation visit page: Install MySQL on Ubuntu 18.04.

Install WordPress

We are now ready to install WordPress.

Given that your WordPress server can be resolved via wordpress-ubuntu host name, open up your browser and navigate to URL http://wordpress-ubuntu to access WordPress installation wizard:

WordPress Ubuntu 18.04 - Slelect Language

Select your Language for your WordPress installation

WordPress Ubuntu 18.04 - Installation Summary

Hit Let's go! button to continue with WordPress installation.



WordPress Ubuntu 18.04 - Database Connection

Enter database name, username and password.
If you followed our guide from the beginning this should be wordpress, admin and pass respectively.

WordPress Ubuntu 18.04 - Continue with Installation

Click on Run the installation button to start the WordPress install

WordPress Ubuntu 18.04 - Create a new user account

Set a new administrative account and click Install WordPress button.



WordPress Ubuntu 18.04 - Install Success

WordPress is now installed on your Ubuntu 18.04 system.

WordPress Ubuntu 18.04 - admin login page

Login to a WordPress administration back-end using previously selected administrator username and password.

WordPress Ubuntu 18.04 - admin back-end

WordPress administration back-end.

WordPress front page - Ubuntu 18.04

WordPress front page – Ubuntu 18.04