In this post, we’ve gathered all the necessary information about Magento 2 installation. The new version of the platform has been finally released, so don’t hesitate to find out how to install the Magento 2 software. Below, we discuss different approaches to the Magento 2 installation from the use of the Setup Wizard to more complicated procedures based on Composer and the command line. To get more information about Magento 2 check our main Magento 2 Overview .
Before starting our Magento 2 installation guide, we’d like to introduce you to 4 major approaches to this procedure. Below, you will find their descriptions as well as links to official guides. Magento 2 offers the ability to perform an easy installation and at the same time do everything to contribute code to its codebase. Of course, each approach has unique requirements, so let’s begin with the easiest one.
Easy installation on your own server does not require any complicated tricks with the command line. You only need some technical expertise as well as command line access to your Magento server. This Magento 2 installation consists of the following steps:
Download a compressed file with the Magento software.
Then, you should extracts it on your Magento server.
Now, install the software via the Setup Wizard. Alternatively, you can rely on the command line.
This approach to the Magento 2 installation is similar to the aforementioned one. The only difference here is in the usage of shared hosting. Get ready to find a hosting provider and perform a small technical expertise. You are alredy familiar with the installation steps:
If you need a full control over all installed components of Magento 2, then this type of installation is for you. It is highly technical, provides access to your Magento server, and offers the ability to repackage Magento CE with other components. To install Magento 2 in such a way, do the following:
Creates a new Composer project with the list of components you want to use.
Update your package dependencies via the same tool. Use the composer create-project command to get the metapackage.
Now, you can install Magento 2 via the command line. The Setup Wizard can be utilized as well.
Run su – apache. If “This account is currently not available” error displays, continue with the next step;
Use sudo chsh -s /bin/bash apache to give apache a valid shell account.
Enter su – apache again – it should work now.
Running Composer to update dependencies
Switch or log in as the web server user to the Magento server.
Change to the installation directory of Magento 2 – cd /var/www/html/magento2
Run composer install to update package dependencies.
Magento Software Installation With The Setup Wizard
Running the Setup Wizard
With the Setup Wizard, you can go back and forward through the pages of installation. You can’t skip pages, and you you have to enter all the required information before you can go to the next step. It is possible to run the installer again or return to a previous page to fix errors.
Open a web browser.
Enter http://[Magento host or IP]/[path to Magento root]/setup in the location or address bar. For the Magento server’s IP address “192.0.2.10” and magento2 directory, you should enter: http://192.0.2.10/magento2/setup
Click Agree and Set Up Magento.
To complete the installation, continue with the following sections
Step 1: Readiness Check
Use Start Readiness Check option.
Resolve all the problems if there are any before you go to the next step.
Use More detail to see the additional information about each check.
Step 2: Add a Database
Database Server Host
Enter localhost for the web and database servers located on the same host. For the database server from a different host, use its fully qualified IP address or hostname.
Database Server Username
Enter the username of the instance owner of Magento database.
Database Server Password
Enter the user’s password, if any or leave the blank field if you didn’t configure any password.
Enter the instance name of Magento database.
You should use this field only if you’re installing the Magento database tables in a database instance with already existing Magento tables.
To identify the Magento tables for this installation, use a prefix.
Step 3: Web Configuration
Your Store Address
Enter the URL of your storefront. It should include scheme and trailing slash (http://www.example.com/).
Magento Admin Address
Enter the URL of your Magento Admin.
Optionally, click Advanced Options and enter the following information:
To enable the use of SSL in the indicated URL, select the checkbox. Do this only if your web server supports SSL.
Select this check box only if you enabled server rewrites while Apache installation.
Magento can generate an encryption key. Use I want to use a Magento generated key option to receive it. If you have your own encryption key, you should use I want to use my own encryption key.
Step 4: Customize Your Store
Use Store Default Time Zone list to set the timezone of your store.
Use Store Default Currency list to choose the default currency.
Use Store Default Language list to choose the default language.
Step 5: Create Admin Account
Enter a username with which you will log in to the Admin of your Magento store. You will be an administrator and will be able to create other users and administrative users under this username.
This is the field for e-mail address of Magento administrator.
The field for the password of administrator.
Password confirmation field.
Step 6: Install
Click Install Now and you will get the following options:
By clicking Console Log, you will be able to see installation progress and error details.
By clicking Previous in the event of problems, you will be able to go back to fix incorrect entries.
By clicking Try Again, you will be able to run the installation again.
If the installation was successful, you will see the message Success.
Viewing the installation log
The Setup Wizard creates install.log – a log file, which can be useful for the debugging or in the actions verification. To locate the log, you should:
Use a text editor to open php.ini. If you don’t know where php.ini is located:
You can find the location of php.ini specified as Loaded Configuration File.
Find sys_temp_dir. Its value determines the location of install.log. PHP uses that value as its default in a case when the value is commented out. Keep in mind, that a typical default value is /tmp, so the log is /tmp/install.log.
Magento Software Installation From The Command Line
You should log in to the Magento server as the web server user or you can switch.
Change cd <your Magento install dir>/setup: cd /var/www/magento2/setup for Ubuntu and cd /var/www/html/magento2/setup for CentOS.
You can also use the following commands to find some values for required options: php -f index.php help language for Language; php -f index.php help timezone for Time zone and php -f index.php help currency for Currency.
Installing the Magento 2 software from the command line
Use Base URL to access your Magento Admin and storefront in the format http[s]://[host or ip]/[your Magento base dir]/. A scheme and a slash are required.
[your Magento base dir] is the docroot-relative path, where the Magento software will be installed. It can be magento2 or might be blank.
Use http://localhost/[your Magento base dir]/ or http://127.0.0.1/[your Magento base dir]/ to access Magento on localhost.
This is the path to access the Magento Admin. It is is appended to Base URL. For the Base URL http://www.example.com and the Admin Pat admin, the Admin Panel’s URL would be ishttp://www.example.com/admin
You can use the database server’s fully qualified hostname, IP address, localhost if your database web servers are on the same host, or UNIX socket (/var/run/mysqld/mysqld.sock)
In addition, there is an option to specify the database server port in its host name: www.example.com:9000
This is the name of the Magento database instance where you are going to install the Magento database tables.
Magento database instance owner’s username.
The password of Magento database instance owner.
Use it if you have more than one Magento instance running on a server with all tables in the same database.
First name of Magento administrator user.
Last name of Magento administrator user.
E-mail address of Magento administrator user’s.
Username of Magento administrator.
Password of Magento administrator user.
Language code for the Admin and storefront. To view the list of language codes enter php -f index.php help language from the setup directory.
Default currency – php -f index.php help currency from the setup directory.)
Default timezone – php -f index.php help timezone from the setup directory.)
1 enables the use of SSL in all URLs (your web server should supports SSL).
0 disables the use of SSL.
1 – SSL is preferred in Magento URLs
0 – SSL is not used.
1 – SSL is used to access the Magento Admin.
0 – SSL is not used with the Admin.
1 – Magento software uses a randomly generated key value to access different pages in the Admin and forms.
0 disables the feture.
Use files to store session data in the file system; db.files – in the database.
Specify a key to encrypt data in the Magento database or Magento will generate its own.
Specify this parameter without a value to drop database tables before Magento software installation, or the Magento database will be left intact.
This is the advanced parameter for MySQL configuration. To set any values use this this link – you will find all the necessary information there.
Set a string value, which will be used as a prefix for sales orders. As a result the payment processor will be provided with unique order number.
Sample localhost installation
As a result of such installation, your Magento receives the following options:
The software is be installed in the magento2 directory. Your storefront URL – http://localhost; Magento Admin – http://localhost/admin;
The database and web server are on the same host.
The database name, username and password are magento.