How to Install Ubuntu 18.04 (Bionic Beaver)

Introduction

Ubuntu 18.04 (codenamed Bionic Beaver) is a free, open-source distribution of Linux, based on the Debian operating system. 18.04 was released in April 2018 and it is an LTS (long-term support) version publicly supported until 2023.
In 2020, Ubuntu 18.04 was succeeded by Ubuntu 20.04 as the latest LTS version.
In this tutorial, you will learn how to install Ubuntu 18.04. 

Prerequisites

  • 2 GHz dual-core processor, at least
  • 4 GB system memory
  • 25 GB of free space on the hard drive
  • A DVD drive or USB port

Step 1: Download Ubuntu 18.04 ISO File

Before you start, make sure you have read the prerequisites, and you have all the recommended system requirements. If you are confident that your system can support the new OS installation, take the first step, and download Ubuntu 18.04.
1. Open a browser of your choice and navigate to the Ubuntu 18.04 official download page.
2. You will see two available packages – Ubuntu 18.04 for Desktop and Ubuntu 18.04 for Server.
We shall download and install the desktop version.
3. Select the 64-bit PC (AMD64) desktop image link to start downloading the package.

Click the 64-bit PC (AMD64) desktop image link to download Ubuntu for Desktop.

4. It will take a couple of minutes to download the .iso file. Once it is done, move on to creating a bootable USB or DVD.

Step 2: Create a Bootable USB

The next step is to create a way to transfer the installation package to your system. You will want your computer to boot from the USB on which the package is on. To do that, you need to create a bootable USB.
This process requires at least a 2GB flash drive and software that creates bootable USB flash drives. There are many options to choose from (RufusUUIUNetbootinPowerISO, and so on).
For this example, we are going to use Rufus, as it is much faster than the alternatives out there. It is also free and open-source.
1. Download Rufus from the official website. Navigate to the webpage and scroll down to the Download section.

Select option to download Rufus bootable.

2. You will find a list of the latest updated versions. Today, these include Rufus 3.5 and Rufus 3.5 Portable or other available versions. Click on either one of the first two, choose to Save and then Run the file.
Read More

How To Install WordPress with LAMP on Ubuntu 18.04

How to install WordPress on Ubuntu 18.04 using a LAMP stack

In this tutorial, I will show you how to install WordPress with LAMP on Ubuntu 18.04 LTS.

Prerequisites for installing WordPress on Ubuntu 18.04

Before we get started, you’ll need to have the following set up:

Step 1: Create a database for WordPress user

WordPress ships a bundle of numerous files and those files need to be stored in a database.

So, your first step towards installing WordPress is to setup MySQL database to handle these files.

To do this, let’s log in to MySQL as a root user, using the command:

mysql -u root -p

You’ll then prompted for the password that you set during the set-up of MySQL database system.

Once logged in, you need to create a new database that will accommodate WordPress files during and after the installation process. You can name it whatever you wish, but to keep things simple, we will call it wordpressdb in this guide.

To create the database, run the following command.

mysql> CREATE DATABASE wordpressdb;

NOTE: Always remember to terminate MySQL statements with a semi-colon “;”

With the database in place, you need to create a new MySQL user account that will have exclusive access to the database.

Let’s also grant the user full access to the database and set a strong password. For this guide, we will create a user
called admin-user.

To do that, execute the following command

mysql> GRANT ALL ON wordpress.* TO 'admin-suser'@'localhost' IDENTIFIED BY 'PASSWORD';

NOTE: Remember to replace the PASSWORD string with a strong password.

At this point, we’ve created a database and a user account specifically for WordPress.

To apply the changes in MySQL instance, we need to run the command below

mysql> FLUSH PRIVILEGES;

Then we’ll exit the MySQL instance by running the command

mysql>   EXIT;

Step 2: Install additional PHP extensions

LAMP stack requires only a minimal set of extensions for PHP to communicate with MySQL database server. However, WordPress and many of its plugins require additional extensions to function without complications.

With that in mind, we’re now going to install additional PHP extensions for WordPress.

First, update the system:

# sudo apt update

Next, install the additional PHP extensions:

# sudo apt install php-curl php-gd php-mbstring php-xml php-xmlrpc php-  soap php-intl php-zip

To load these extensions, restart Apache web server by running the following command:

# sudo systemctl restart apache2

Step 3: Download WordPress

With all the prerequisites in place, let’s go ahead and download WordPress.

For security reasons, I recommend always downloading WordPress from its official repository:

First Navigate to /var/www/ directory

# cd  /var/www/```

Then download the zipped folder using the command

# curl -O https://wordpress.org/latest.tar.gz

Extract the tarball file

# tar -xvf latest.tar.gz

The extraction of the tarball file yields a folder labeled wordpress.

This is the folder that contains all the WordPress configuration files. At this point, it’s safe to delete the tarball file you just downloaded from the WordPress repository.

# rm latest.tar.gz

Step 4: Configure the WordPress directory

Before we proceed to the next step, we need to adjust ownership and file permissions of the WordPress directory.

Let’s assign file ownership to all the files in the WordPress directory using the

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

Next, we’ll set the correct permissions as shown:

# sudo find /var/www/wordpress/ -type d -exec chmod 750 {} \;
# sudo find /var/www/wordpress/ -type f -exec chmod 640 {} \;

We also need to rename the sample configuration file in the WordPress directory to a filename it can read from:

# cd /var/www/wordpress
# mv wp-config-sample.php wp-config.php

Next, we will open the wp-config.php file using the default text editor Vim.

# vim  wp-config.php

Now scroll down and locate the database settings as shown below. Be sure to fill in the WordPress database namedatabase userdatabase password and hostname.

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wordpressdb');
/** MySQL database username */
define('DB_USER', 'admin-user');
/** MySQL database password */
define('DB_PASSWORD', 'StrongPassword');
/** MySQL hostname */
define('DB_HOST', 'localhost');
/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');
/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');

Save and exit the configuration file.

You also need to generate security keys to provide additional security to your WordPress installation. WordPress provides an automatic generator for these keys to eliminate the need for generating them ourselves.

To generate these values from WordPress secret generator, simply run the command:

# curl -s https://api.wordpress.org/secret-key/1.1/salt/

Note: The command gave us the output below. DO NOT USE THESE VALUES, you need to copy the unique values that you generated.

define('AUTH_KEY',      'UV>...SAMPLE ONLY...COPY YOUR OWN VALUES...mL)');
define('SECURE_AUTH_KEY',  'bn(UV>...SAMPLE ONLY...COPY YOUR OWN VALUES...emL)zx');
define('LOGGED_IN_KEY',    '-naUV>...SAMPLE ONLY...COPY YOUR OWN VALUES...emL{fY');
define('NONCE_KEY',     '{xNwUV>...SAMPLE ONLY...COPY YOUR OWN VALUES...emL8Fq');
define('AUTH_SALT',        'j+;UV>...SAMPLE ONLY...COPY YOUR OWN VALUES...emLZpu');
define('SECURE_AUTH_SALT', '0M=UV>...SAMPLE ONLY...COPY YOUR OWN VALUES...emL*xC');
define('LOGGED_IN_SALT',   'G&2UV>...SAMPLE ONLY...COPY YOUR OWN VALUES...emLps+');
define('NONCE_SALT',    '2gZUV>...SAMPLE ONLY...COPY YOUR OWN VALUES...emLh/L');

Copy the unique output that you’ve generated.

Once again, open the WordPress configuration file wp-config.php

# vim  wp-config.php

Scroll and locate the section that contains the dummy values, which looks like this:

define('AUTH_KEY',         'put your unique phrase here');
define('SECURE_AUTH_KEY',  'put your unique phrase here');
define('LOGGED_IN_KEY',    'put your unique phrase here');
define('NONCE_KEY',        'put your unique phrase here');
define('AUTH_SALT',        'put your unique phrase here');
define('SECURE_AUTH_SALT', 'put your unique phrase here');
define('LOGGED_IN_SALT',   'put your unique phrase here');
define('NONCE_SALT',       'put your unique phrase here');

Delete those values and paste the security keys that WordPress generated for you.

Now save and exit the configuration file.

Step 5: Modify Apache configuration

In this step, we need to make a few adjustments to the default configuration file 000-default.conf in the path /etc/apache2/sites-available.

Start by opening the default configuration file

# vim  /etc/apache2/sites-available/000-default.conf

Next, locate the DocumentRoot attribute and change it from /var/www/html to /var/www/wordpress.

In the same file, copy and paste the following lines inside the Virtual Host block.

<Directory /var/www/wordpress/>
AllowOverride All
</Directory>

virtual_host_wordpress_ubuntu

Save and exit the configuration file.

Next, you need to enable the mod_rewrite so that you can use WordPress Permalink feature.

# sudo a2enmod rewrite

To verify that all went well, execute the command.

# sudo apache2ctl configtest

Output: Ok

To implement the changes, restart Apache web server.

# sudo systemctl restart apache2

Step 6: Run WordPress installation using the web browser

At this point, you’ve finished all the server configurations for your WordPress installation.

The final step is to complete the installation via a web browser.

To do this, launch your web browser and browser your server’s IP address or domain name
http://server_IP_address or http://YOUR-DOMAIN

The first page will prompt you to select the language.

wordpress_ubuntu_language

Click on your preferred language and hit the ‘Continue’ button.

In the next step fill in the additional information required such as ‘Site Name’, ‘Username’ , ‘Password’, and ‘Email address’.

wordpress_ubuntu_welcomeOnce you’ve filled in all the required fields, click on ‘Install WordPress’

If all went well, you will be directed to the Login Page.

Hit the ‘Login’ button and you’ll head to the world-famous WordPress dashboard that you see below:

wordpress_ubuntu_dashboard

Guess what? You just installed WordPress on Ubuntu!

Congratulations! If you’ve followed along this far, you’ve installed WordPress with LAMP on Ubuntu 18.04 LTS.

So, now you’re ready to get to work building your new blog or website.

How To Install Nginx on Ubuntu 18.04

Prerequisites

  • A system running Ubuntu 18.04
  • A user account with sudo privileges
  • SSH Access

Steps to Installing Nginx on Ubuntu

Update Software Repositories

Log into your Server via SSH as the root user

ssh [email protected]

Before installing new software, it is strongly recommended to update your local software database. Updating helps to make sure you’re installing the latest and best-patched software available.
Enter the following:

sudo apt update

Allow the process to finish.

Install Nginx on Ubuntu

Enter the following to install Nginx on Ubuntu:

sudo apt install nginx

This may take some time for the system to download the software packages and install them. Allow it to complete before moving on.
Read More

How to Install MySQL 8.0 in Ubuntu 18.04

Prerequisites

  • A system running Ubuntu 18.04
  • Access to a user account with sudo privileges

Installing MySQL in Ubuntu Using Terminal

This guide assumes you’re installing to a local system. If you need to set up encryption or security certificates for configuring a remote server, please refer to this guide.

Step 1: Enable MySQL Repositories

Your installation of Ubuntu 18.04 may not have access to MySQL repositories.
To download the latest repositories, enter:

wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.11-1_all.deb

The system should respond by reaching out to the server and downloading the .deb configuration file. A progress bar displays to let you know when the download is completed.

Terminal command to install and add the MySQL repository.

Step 2: Install MySQL Repositories

To install and enable MySQL repositories, enter the command:

sudo dpkg -i mysql-apt-config_0.8.11-1_all.deb

The system should respond by launching an installation configuration tool. It will present options to you for which MySQL version you want to install.

MySQL package configuration manager

Leave the default settings and click OK, unless you’re an advanced user and have a specific reason to change them.

Step 3: Refresh the Repositories

Any time you’re installing new packages, you should update repository listings to ensure you are installing the latest release.
In the terminal, enter the following:

sudo apt-get update

The system should take a few moments and refresh the repository cache.
 

Step 4: Install MySQL

To install MySQL on Ubuntu, run the command:

sudo apt-get install mysql-server

Enter your administrator credentials, and the system will install the MySQL server package, client packages, and database common files.

Terminal command and output installing MySQL

The installation will prompt you to enter and confirm a root user and password for the MySQL database.
This password grants total access to the database, so it should be secure and private.
Next, the installer will display a notice about a new authentication method. The newer authentication is more secure but may cause compatibility problems with older MySQL clients.
Read More