Getting Started with Magento 2
Tags: magento, php, installationguide
Published: 2019-01-08 03:07:14

---
title: Getting Started with Magento 2
published: true
tags: magento, php, installationGuide
canonical_url: https://www.atyantik.com/getting-started-with-magento-2/
---

## What is Magento?

Magento is the leading eCommerce platform used for online stores built on open source technology which provides online merchants with a flexible shopping cart system, as well as control over the look, content and functionality of their online store. 

Magento offers powerful marketing, search engine optimization, and catalogue-<g id="10" data-gr-id="10">managemen</g> tools.

Magento 2 was released in 2015 and is a reinvisioning of the platform bringing it up to date with the latest development practices as a foundation for future features and growth.

### Features

- Website Management Features.
- Checkout, Payment, & Shipping.
- Search Engine Optimization (SEO)
- Analytics And Reporting.
- Marketing Promotions And Tools.
- Order Management.
- Customer Service.
- Customer Accounts.

### Requirements for installing Magento 2

- Web server: Apache 2.4 Or Nginx 1.8.x
- PHP 7.1.x
- Database: MySQL 5.6 or higher, MariaDB 10.0 or higher, Percona 5.7
- [php\_xdebug2.2.0](https://xdebug.org/download.php) or later : Recommended for development environments only.
- Required PHP Extensions: [intl](http://php.net/manual/en/book.intl.php), [mbstring](http://php.net/manual/en/book.mbstring.php), [mcrypt](http://php.net/manual/en/book.mcrypt.php), [mhash](http://php.net/manual/en/book.mhash.php), [openssl](http://php.net/manual/en/book.openssl.php), [PDO\_MySQL](http://php.net/manual/en/ref.pdo-mysql.php), [SimpleXML](http://php.net/manual/en/book.simplexml.php), [soap](http://php.net/manual/en/book.soap.php), [xml](http://php.net/manual/en/book.xml.php), [xsl](http://php.net/manual/en/book.xsl.php), [zip](http://php.net/manual/en/book.zip.php) 

## Install Magento 2 on Ubuntu Using Nginx

### Step 1: 

Install nginx by running following command in terminal.

```bash
﻿apt-get -y install nginx
```

### Step 2: 

Install and configure **php-fpm**.

#### Step 2.1: 

Install **php-fpm** and **php**** -cli**.

```bash
apt-get -y install php7.1-fpm php7.1-cli 
```

This command installs the latest available version of PHP 7.1.X. See [Magento 2.2.x technology stack requirements](https://devdocs.magento.com/guides/v2.2/install-gde/system-requirements-tech.html) for supported PHP versions.

#### Step 2.2:

Open the **php****.ini** files in an editor.

```bash
vim /etc/php/7.1/fpm/php.ini vim /etc/php/7.1/cli/php.ini
```

#### Step 2.3:

Edit both files to match the following lines and save and exit the editor.

```ini
memory_limit = 2G 
max_execution_time = 1800 
zlib.output_compression = On
```

#### Step 2.4:

Restart the **php**** -fpm** service.

```bash
systemctl restart php7.1-fpm   
```

### Step 3:

Configure Nginx.

#### Step 3.1:

Run the line to create a new virtual host for your Magento site.

```bash
vim /etc/nginx/sites-available/magento 
```

#### Step 3.2:

Make the following configuration.

```nginx
upstream fastcgi_backend {         
    server unix:/run/php/php7.1-fpm.sock; 
} 
server {
     listen 80;
     server_name www.magento-dev.com;
     set $MAGE_ROOT /workspace/magento2;
     include /workspace/magento2/nginx.conf.sample; 
}
```

Match your domain name with the base URL you chose when installing Magento then save and exit the editor.

#### Step 3.3:

Activate host by creating a symlink.

```bash
ln -s /etc/nginx/sites-available/magento /etc/nginx/sites-enabled 
```

#### Step 3.4:

Run the command to restart nginx.

```bash
systemctl restart nginx
```

#### Step 3.5:

Add site url to hosts file.

```bash
vim /etc/hosts 127.0.0.1 www.magento-dev.com
```

Now try your site’s URL on a web browser to verify the site yourself. It will open the Magento setup wizard shown in the image. You can install Magento by completing all the steps of the setup wizard as well. This is another method of installing Magento.

![](https://i1.wp.com/www.atyantik.com/wp-content/uploads/2018/12/1.png?resize=640%2C289&ssl=1)

There are 6 steps to complete web setup wizard shown in images.

- 

![](https://i0.wp.com/www.atyantik.com/wp-content/uploads/2018/12/2.png?w=640&ssl=1)<figcaption>Step 1: Readiness check<br></figcaption>

- 

![](https://i1.wp.com/www.atyantik.com/wp-content/uploads/2018/12/3-1.png?fit=640%2C304&ssl=1)<figcaption>Step 2: Database Configuration</figcaption>

- 

![](https://i2.wp.com/www.atyantik.com/wp-content/uploads/2018/12/4-1.png?fit=640%2C426&ssl=1)<figcaption>Step 3: Web Configuration</figcaption>

- 

![](https://i0.wp.com/www.atyantik.com/wp-content/uploads/2018/12/5-1.png?fit=640%2C308&ssl=1)<figcaption>Step 4: Store Customization</figcaption>

- 

![](https://i0.wp.com/www.atyantik.com/wp-content/uploads/2018/12/6-1.png?fit=640%2C288&ssl=1)<figcaption>Step 5: Create Admin Account </figcaption>

- 

![](https://i0.wp.com/www.atyantik.com/wp-content/uploads/2018/12/7-1.png?fit=640%2C267&ssl=1)<figcaption>Step 6: Installation</figcaption>

### Step 4: 

Install and configure Magento2 command line.

#### Step 4.1:

Run the following to change to the <g id="3" data-gr-id="3"><g id="4" data-gr-id="4">docroot</g></g> directory.

```bash
cd /workspace ﻿
```

#### Step 4.2: 

[Download](https://magento.com/tech-resources/download) and extract the Magento 2 and name it  **magento2.**

#### Step 4.3:

Enter the following lines to set directory ownership and file permissions.

```bash
cd /workspace/magento2 
find var vendor pub/static pub/media app/etc -type f -exec chmod g+w {} \; 
find var vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} \; 
chown -R :www-data
chmod u+x bin/magento ﻿
```

#### Step 4.4:

Install Composer globally.

```bash
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/bin --filename=composer
```

#### Step 4.5:

Update Magento dependencies.

```bash
cd /workspace/magento2
composer install -v
```

#### Step 4.6:

Run the below in command line to install Magento.

```bash
cd /workspace/magento2/bin 
./magento setup:install --base-url=http://www.magento-dev.com/ --db-host=localhost --db-name=magento --db-user=magento --db-password=magento --admin-firstname=admin --admin-lastname=admin --admin-email=admin@admin.com --admin-user=admin --admin-password=admin123 --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1 
```

Last but not least, change to developer mode to continue with nginx configuration.

```bash
cd /workspace/magento2/bin 
./magento deploy:mode:set developer
```

Your Magento store setup is now completed. Go to the browser and open site URL and you can see your store.

![Magento](https://i1.wp.com/www.atyantik.com/wp-content/uploads/2018/12/8.png?fit=640%2C318&ssl=1)

The post [Getting Started with Magento 2](https://www.atyantik.com/getting-started-with-magento-2/) appeared first on [Atyantik Technologies](https://www.atyantik.com).