How To Install Magento On Ubuntu 18.04

Introduction

Magento is a robust e-commerce platform that enables developers and online entrepreneurs to create and customize online stores in minutes. The platform is written in PHP, and it requires database and web servers to run successfully. On the other hand, Ubuntu is an open source platform that delivers technical and economic scalability to meet enterprise-level server needs.

This tutorial will help you install the latest version of Magento on Ubuntu 18.04 LTS. We’ll use the LAMP (Linux, Apache2, MySQL, and PHP) stack to install Magento 2 on your Linux distribution. To accomplish this, let's follow the steps below.

Prerequisites

First, you should ensure your system is up-to-date. Run the commands below to update and upgrade your system:

$ sudo apt-get update -y
$ sudo apt-get upgrade -y

Step 1 - Installing Apache2

As aforementioned, Magento requires a web server to run commendably. For this reason, we’ll first install Apache2 which is one of the most popular web servers in the modern tech world. Run the command below to install Apache2:

Step 6 - Configuring Apache2

By now the installation is almost complete, but we need to configure Apache2 website configuration file for your Magento store. This configuration file dictates how your site visitors access the Magento content.

First, we create the configuration file and name it magento.conf:

$ sudo nano /etc/apache2/sites-available/magento.conf

Next, paste the following content into the configuration file and save.

Step 7 - Enabling The Rewrite Module and Magento

Once the virtual host is configured, run the commands below to enable it:

$ sudo a2ensite magento.conf
$ sudo a2enmod rewrite

Step 8 - Restarting Apache2

Run the command below to restart the service:

$ sudo systemctl restart apache2.service

Restarting Apache2 allows all the settings changes to take effect.

Step 9 - Setting Up The Magento Store

Open a web browser and search your server domain name (http://example.com). This will present the Magento setup wizard. Follow the instructions in the wizard to complete the setup.

Readiness Check

Click Start Readiness Check to initiate the process:

Adding Database Information

Next, enter your database credentials

Click Next to move to the next step, Follow the instructions carefully and continue until you get to Create Admin Account.

Creating Admin Account

Enter all the required details

Continue until the setup is complete:

That is it!

Conclusion

You have successfully installed Magento on your Ubuntu 18.04 server. Thank you for using this tutorial to install one of the most popular, open source eCommerce platforms. All the best as you embark on a mission to trade online.