Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Linux Tutorials»How to Install Magento2 on Ubuntu 16.04

    How to Install Magento2 on Ubuntu 16.04

    By RahulSeptember 19, 20183 Mins Read

    Magento is the best eCommerce software and solution for online services. Recently the Magento team has released its new version Magento 2.0 with lots of improvements changes and optimizations over Magento 1.

    Advertisement

    Step 1 – Install Apache2 and PHP

    You can use following commands to install all requirements from default repositories.

    sudo apt install apache2 
    

    Then install PHP and other required PHP modules.

    sudo apt install php libapache2-mod-php php-mysql php-dom php-simplexml 
    sudo apt install php-curl php-intl php-xsl php-mbstring php-zip php-xml
    

    Step 2 – Install MySQL Server

    You can use MySQL or MariaDB as the database server for Magento application.

    sudo apt install mysql-server
    

    Step 3 – Download Magento 2 Archive

    Magento is available in 2 editions Enterprise and Community. In this tutorial we are using community edition for setup. Download Magento2 community edition from its official website.

    After downloading the archive file, extract it under website document root. So we can access directly from web browser.

    cd /var/www/html/magento2
    tar xjf ~/Downloads/Magento-CE-*.tar.bz2
    chown -R www-data.www-data /var/www/html/magento2
    chmod -R 755 /var/www/html/magento2
    

    Step 4 – Create MySQL Database

    Now login to your MySQL server with admin privileges and create a database and user for new Magento 2 installation.

    mysql -u root -p
    
    mysql> CREATE DATABASE magento2_db;
    mysql> GRANT ALL ON magento2_db.* TO magento2_usr@'localhost' IDENTIFIED BY 'password';
    mysql> FLUSH PRIVILEGES;
    mysql> quit
    

    Step 5 – Run Web Installer

    Let’s begin the installation of Magento2 using web installer. Access your Magento 2 directory on the web browser like below. It will redirect you to the installation start page.

     http://localhost/magento2/
    

    4.1. Agree the License agreement and click on “Agree and Setup Magento”

    Install Magento 2 - Step 1

    4.2. Now click on “Start Rediness Test”. Magento will check for system requirements here. On successful completion, you will see the screen like below then Just click Next. Fix issues if shows on this screen and click Try again.

    Install Magento 2 - Step 2

    4.3. Enter your database details here created in step 3.

    Install Magento 2 - Step 3

    4.4. On this page configure the admin URL and website URL. For security reason it will not take url as admin, that’s why I used myadmin here. Now click Next.

    Install Magento 2 - Step 4

    4.5. You will see a success message on this screen. Now just click on “Launch Magento Admin”
    Install Magento 2 - Step 5

    4.6. At this step, Magento is ready for installation. Click on Install Now button to begin installation and wait for its completion.

    Install Magento 2 - Step 6

    4.7. At this step, Magento installation is completed. Now create an admin account for yours. remember these details for admin login in future.

    Install Magento 2 - Step 7

    4.8. Set the preferred timezone, default currency and default language as per your requirements.

    Install Magento 2 - Step 8

    4.9. Finally, it will open the Admin Login screen. Use admin credentials to log in on this screen. It will open Admin panel after successful authentication.

    Install Magento 2 - Login Page

    Congratulation! You have successfully deployed Magento2 on your system.

    Step 6 – Schedule Magento2 Cronjobs

    Finally schedule the backgound cronjobs for your magento2 installation. These cronjobs does some activities like, re-indexing, Newsletters, Update of currency rates, sending automatic emails and generating sitemaps etc. To schedule these jobs edit crontab file

    crontab -e
    

    and add following cronjobs at the end of file and save it.

    */1 * * * * www-data php /var/www/html/magento2/bin/magento cron:run
    */1 * * * * www-data php /var/www/html/magento2/update/cron.php
    */1 * * * * www-data php /var/www/html/magento2/bin/magento setup:cron:run
    

    Here www-data is the user under which Apache is running and /var/www/html/magento2/ is the location of your Magento2 applications.

    eCommerce Magento Magento 2.0
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    What are the difference between SH and BASH

    What are the difference between SH and BASH?

    Understanding the Zombie Processes in Linux

    A Comprehensive Guide to Shutting Down or Rebooting Linux System

    View 11 Comments

    11 Comments

    1. Prakash Kumar Singh on June 12, 2021 12:47 pm

      after launch admin page then coming this error
      Not Found
      The requested URL was not found on this server.

      Apache/2.4.18 (Ubuntu) Server at 192.168.169.138 Port 80

      Reply
      • Prakash Kumar Singh on June 12, 2021 6:26 pm

        Thanks i got the solution……….

        Reply
    2. nahuel on March 17, 2019 2:27 pm

      Thx!

      Reply
    3. Manoj on December 11, 2018 9:17 am

      done same but its not working

      Reply
    4. Alex on February 16, 2018 10:57 am

      hey, my installation gets stuck at installing database schema. Any idea about what’s going on?

      Reply
    5. Panuci on November 20, 2017 1:55 pm

      Works like a charm!!

      Reply
    6. foysal on May 22, 2017 10:55 am

      Great tutorial.

      Reply
    7. thomas on December 18, 2016 12:16 pm

      Great article! I have also enabled redis and varnish as described here:
      https://www.rosehosting.com/blog/magento-2-with-redis-varnish-and-nginx-as-ssl-termination/

      Reply
    8. Surya on March 16, 2016 3:04 pm

      The installation went fine, after th installation, the site was not loaded correctly…it was like its not using any css files–

      I only see text. like login link etc…but no image or css..

      Reply
      • Rahul on March 17, 2016 2:28 am

        Hi Surya,

        Edit .htaccess file of main folder and set RewriteBase with your application directory name.

        RewriteBase /magento2/

        Hope this help you.

        Reply
    9. Dan on March 15, 2016 3:00 pm

      Good day! Very useful article! But can you clarify to me if I need to install Composer firstly As it was said here http://sam-ecommerce.com/blog/view/install-Magento-2-with-Composer?

      Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Python Function with Parameters, Return and Data Types
    • free Command in Linux (Check Memory Uses)
    • Git Rebase: A Practical Guide
    • How to move the complete Git repository
    • Handling Special Characters in Shell Scripts
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.