Clicky

Installing Magento 2 software could be challenging. You can install Magento 2 with this super simplified process. I’ve divided the installation into 3 phases:

  1. Requirements,
  2. Installation, and
  3. Post-installation

You can install Magento 2 via

1. Requirements

  • You’re not on shared hosting and have your own Magento server.
  • Your OS is either Ubuntu or CentOS.
  • Everything is on one host (web server, database)
  • Install via composer create-project.
  • You’re installing to the magento2 subdirectory under your web server’s docroot (path: /var/www/html/magento)

2. Installation

Now that you have ensured all the requirements, here’s how you can install Magento 2 and get your hands on the powerful Magento software:

2.1. Install Magento 2 via Composer

Composer: A tool for dependency management in PHP.

Get the composer software by following these commands:

Note: In the installation, Magento core code is also stored under /vendor directory and updating is possible through Magento admin.

Step 1: Get Authentication Keys

You need authentication keys to get started which you can get by:

  • Login to Magento account > Go to “My Access Keys” > Enter “Name” and generate new set of keys.
  • Know more about authentication keys here.

Enter this command:

Your public key is the username and private key is password.

Step 2: Go to Setup Wizard > Click on Install

Step 3: To install sample data:

Go to your Magento 2 root directory via terminal > run following commands

This will update your composer.json file and install sample data. If you see “Please re-run Magento compile command”, enter the following command:

2.2. Install via GitHub

1. Clone Magento repo from here or simply download it.

2. Create empty directory and run:

3. After deploying, run:

4. Now after installing Magento 2, the setup will look like:

Note: change your base-url, db-name, db-password, admin-email, admin-password to match the setup.

To install sample data:

1. Run git clone [email protected]:magento/magento2-sample-data.git in your web root.

2. Go to the cloned directory and execute the following command to create symlinks to your M2 installation:

For ownership and permissions (on Linux), follow these commands:

3. To clear cache or static files, follow:

4. For installing sample data, follow these commands:

After this, you’ll have sample data installed.

2.3. Install Magento 2 via Command line

Follow these commands to install Magento 2 via command line:

Wherein,

  • Database name is Magento
  • Username and password are both Magento
  • Properties of Magento administrator:
  • First name is Magento and the last name is User
  • Username is Admin and password is [email protected]
  • E-mail address is [email protected]
  • Default language is en_US (US English)
  • Default currency is USD
  • Default time zone is India (Delhi)

Note: Magento software will be installed in the /var/www/html/magento2 directory and your storefront URL will be: https://103.90.240.1/magento2/

Replace 103.90.240.1 with your IP address

2.4. Install Magento 2 using Web Setup Wizard

Follow these steps to run the Web Setup Wizard:

1. Open this URL in your browser: http://103.90.240.1/magento2/setup

Note: The Magento software will be installed in the magento2 directory relative to the web server docroot and your storefront URL will be https://103.90.240.1/magento2/

Replace 103.90.240.1 with your IP address.

2. At the welcome page > Agree and Setup Magento

3. Click Start Readiness check to verify your system is ready to install Magento 2 software.

4. Click “Next” if readiness check passes.

5. Check Readiness check issues if it fails.

6. “Add a Database” to set up your Magento database.

7. With web configuration, you can enter the storefront and Magento Admin URLs.

8. You can enter a default store currency, language, and time zone by clicking on “Customize Your Store”.

9. Create “Admin Account” to set up a Magento administrator and perform all the required actions.

10. To install, click on “Install Now”.

And there you go!

3. Post Installation: Is Magento 2 Installed Correctly?

3.1 Verifying the Magento 2 Storefront

If you’ve installed Magento 2 for URL is https://www.yourwebsitename.com, then open this in a browser. If you see the following storefront page, the installation was successful.

magento 2 install success storefront

Verifying the Magento Admin

> Go to the Magento in a web browser.

For example, https://www.yourwebsitename.com/ admin_magento2 where https://www.yourwebsitename.com/ is your Magento installation base URL and the Admin URI is admin_magento2.

> Log in as a Magento Admin.

If you see the following page, Magento 2 is installed successfully.

  • If there’s some problem with graphics, check here.
  • If you get 404 error or similar error, check for solutions here.

Looking for Magento 2 hosting? Share your requirements with our Magento Experts and get the best-suited plan for your e-commerce!

Tired of slow loading Magento stores

Speed up your Magento

12 proven tricks to boost Magento speed