How to Install Magento 2 – Beginner’s Guide

TOP Magento Web Hosting Providers

1. Hostinger

Number of Reviews 10.5k+
Avg. Review Score 4.6 Positive
Customer Support Positive
Starts from $1.99 / mo.

2. DreamHost

Number of Reviews 3.2k+
Avg. Review Score 4.6 Positive
Customer Support Positive
Starts from $1.99 / mo.

3. IONOS |

Number of Reviews 15.6k+
Avg. Review Score 4.1 Positive
Customer Support Neutral
Starts from $0.50 / mo.

When it comes to building a website, there are a lot of different options you can choose from. Whether you will choose a CMS platform or an AI builder, you will succeed in building your website. In today’s article, we have prepared a tutorial on how to install Magento 2 platform, and will guide you through the whole installation process.

install magento image

What is Magento 2?

Magento 2 is an advanced eCommerce platform that uses open-source technology to build websites. The platform is not like the other CMS platforms because it focuses on creating e-commerce sites and online stores. It provides flexible features like an advanced shopping cart and full customization.

The platform offers options to upload themes and plugins. Also, it provides powerful marketing and SEO optimization and is made for the knowledgable audience but with no advanced programming knowledge, and you can easily customize up to a point. But if you need to change some parts of the platform, it needs to be done by a Magento expert.

What’s New in Magento 2?

With the newest version released – v2.4 on 27 July 2020, the platfom has further improvements.

New Improvements and Upgrades

Support for PHP 7.4, PHPUnit 9.x
Support for Elasticsearch 7.x and MySQL 8.0
Removed MySQL search engine
Support for MariaDB 10.4
The Zend Framework has been deprecated and migration to the Laminas project.
Removed the support for Signifyd fraud protection code
Core Braintree module removed

Magento Features
Magento is the world’s most flexible eCommerce building platform.

– Gives you reliability with 99.99% Uptime.
– Customization with the option of integrating hundreds of extensions and plugins.
– Knowledgable expert 24/7 support with 315,000 developers and partners on the line
– 5 months money-back guarantiue
– Page Builder (the drag & drop gives you full control over your website. It will help you customize faster, and create fresh and rich content)

How to Install Magento 2?

To install the platform you need to do it by using an FTP database to transfer its archives. We are going to use an FTP server called Apache and set up Magento in 7 steps.

Install Magento by Using Apache in 7 Steps

Step #1: Install Apache Server and PHP

To set up the platform we are going to use one of the most popular HTTP Server now – Apache. Apache is free and open-source cross-platform web server software and is supported by all the operating systems.

To install Apache, you should update packages before running install Apache install command:

sudo apt update
sudo apt install apache2

To run Apache automatically, run the following command:

sudo systemctl enable apache2.service

The next step form the Apache installation is to:

Configure Apache2 Virtual Host

To affirm Apache2 site configuration for Magento store, you need to create a new configuration file called “magento2.conf”

sudo nano /etc/apache2/sites-available/magento2.conf

Get the following content and paste it to the above file. Have in mind that you can change to your domain.

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html/magento2/

<Directory /var/www/html/magento2/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

If you are installing the CMS locally, you can change to, or Next you have to update hosts file at /etc/hosts with this:

In this tutorial, we use

Make sure you have enabled “rewrite mod” to use site-friendly URLs. To make it enter this code:

sudo a2ensite magento2.conf
sudo a2enmod rewrite

Next, you need to

Install PHP 7.2 and Extensions

On Ubuntu 18.04, you can install PHP 7.2 with the following command line:

sudo apt install php7.2 libapache2-mod-php7.2 php7.2-common php7.2-gmp php7.2-curl php7.2-soap php7.2-bcmath php7.2-intl php7.2-mbstring php7.2-xmlrpc php7.2-mcrypt php7.2-mysql php7.2-gd php7.2-xml php7.2-cli php7.2-zip

After installing PHP you need to update it by using this code:

Open php.ini file sudo nano /etc/php/7.2/apache2/php.ini

Change the data to this and save it.

file_uploads = On
allow_url_fopen = On
short_open_tag = On
memory_limit = 512M
upload_max_filesize = 128M
max_execution_time = 3600

Now you need to restart Apache2 and run this command:

sudo systemctl restart apache2.service

Step #2: Install Database Server Manually

MariaDB Database Server to default MySQL Database Server is preferred, because of faster and better performance. To install MariaDB Server and Client, using the command line:

sudo apt-get install mariadb-server mariadb-client

Ensure it starts and startup every time you reboot the server:

sudo systemctl restart mariadb.service
sudo systemctl enable mariadb.service

After this you have the MariaDB server installed and now you need to set up the database by entering this line:

sudo mysql_secure_installation

It prompt and you choose the following option:

Enter current password for root (enter for none): Enter
Set root password? [Y/n]: Y
New password: Type your password
Re-enter new password: Type your password
Remove anonymous users? [Y/n]: Y
Disallow root login remotely? [Y/n]: Y
Remove test database and access to it? [Y/n]: Y
Reload privilege tables now? [Y/n]: Y

Step #3: Create & Set Up MySQL User

This is a required step to go through. From Magento 2.3.x, it requires a unique user for the installation, it cannot default user: root.

To make it proper first you need to login MariaDB

sudo mysql -u root -p

Create a new database – CREATE DATABASE magento2 and then create a new name called: mageplaza


Grant mageplaza user to magento2 database:



Step #4: Install Composer

What Is Composer and How to Use It for Magento 2?

The CMS platform uses the composer, a PHP dependency manager, to package components and product editions.

Composer reads a composer.json file in Magento’s root directory to download third-party dependencies listed in the file.

After setting the server, you are ready to start the installation.

To start with the installation, you need to download the installer, which will set up your PATH environment variable so you can call the composer from any directory. You can download the file from here and also find more info about the process.

curl -sS | sudo php — –install-dir=/usr/local/bin –filename=composer

composer -v

Composer version 1.8.5 2019-04-09

Step #6: Download the Magento Pack

Download the Pack from here

After donwload, you should extract the pack to /var/www/html/. E.g you have a folder call: magento2 in /var/www/html/

Step #7: Install Magento 2

To start the Magneto installation you need access to the, then you will see this window.

magento agree to install image

Click “Agree” and the “Start Readiness Check“. If everything is alright and there are no errors you need to click “next
Now you need to da Database, there you need to fill the Database information and press “next

The next step is the web configuration, you need to enter your store address Enter the relative URL by which to access the Admin. Then “next“.

Now you need to customize your store with general info like time zone, currency, language, and to set advanced modules like Google Analytics, Google Adwords, Google Optimizer, etc.

After setting all these stuff we are at the final steps, now you need to create an admin account.

Fill the following info:
New Username
New E-Mail
New Password
Confirm Password

Click “next“, and then “install“. After the installation is done, you ar ready to check the results and start customizing your site.

Extensions and Themes in the Module

Form the marketplace, you can load your website with different themes and flexible extensions which will help you customize your website. There are any-purpose themes available, and popular extensions like Facebook pixel, Multi-Vendor Marketplace, Google shopping, etc. Visit the marketplace here.

There are a few features categories with extensions for your website.

Customer Support
Paments & Security
Accounting & Finance
Shipping & Fulfillment
Site Optimization

Command-line Configuration

The command-line interface performs both installation and configuration tasks. The new interface performs multiple tasks, including:

Installing the platform (creating or updating the database schema, creating the deployment configuration, etc).
Clearing the cache.
Managing indexes, including reindexing.
Creating translation dictionaries and translation packages.
Generating non-existent classes such as factories and interceptors for plug-ins, generating the dependency injection configuration for the object manager.
Deploying static view files.
Creating CSS from Less.

A single command (/bin/magento list) lists all available installation and configuration commands.
Consistent user interface based on Symfony.
The CLI is extensible so third party developers can “plug-in” to it. This has the additional benefit of eliminating users’ learning curve.
Commands for disabled modules do not display.

Magento Enterprise Edition

The enterprise edition is a premium paid version of the platform which offers more special features, premium customization options, and advanced 24/7 support. The enterprise edition is generally used from the bigger companies or online stores, which have the need for more advanced options. The main reason why the enterprise edition is mostly used by the bigger online stores is because of its price. It costs $15,550/year Tips for Magento

Here you can find useful tips about Magento and how to use it properly and optimize your SEO. Even some of the tips are really easy to do and may sound unnecessary for many there are very important for the performance of your website and its SEO.

Tip #1 – Update to the Latest Version

To be up to date is very important because the latest updates always have improvements and enhancements. Also, the latest versions are the best SEO optimized. The platform itself always recommends being with the last version.

Tip #2 – Use Proper Keywords

This tip is essential not only for Magento websites, but it is very important for any other website. Using the proper keywords and researching for good ones for your site is a very significant moment for your website SEO success. If you are not sure how to do it properly Magento offers its own SEO tools, but you can also check some of the best ones here.

Tip #3 – Image Optimization

Image optimization even may sound that it is not that important, but it is. To optimize your images in the best way, describe what it is about in the best clear way and it is good to add your domain at the end of the image title, it is good for the domain rating of your website. To SEO the images add alt attributes(in this way Google will know what the image is about) and one more thing, compress the images and make them small, this will save your website space and will not slows down your site.

Tip #4 – Avoid Duplicate Content

An important tip is not to duplicate the content. The search engine bots take it as a bad point if they crow to duplicated content. If you have duplicated content you can solve the problem by telling Google that one of the contents you have is canonical to the other. To make this happen go to the SEO setting. Go to Store => Configuration => Catalog => Search Engine Optimization.

Tip #5 – Generate a Sitemap

The Sitemap is essential for your website because the Google crawlers follow the sitemap links and this helps them scan your site.
Manage create both XML and HTML sitemap. With Magento, you have an option both sitemaps at ease.

Leave a Comment

Your email address will not be published.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.