How to Install Magento Open Source on Ubuntu Server Latest

In this tutorial, we will show you how to install Magento Open Source on Ubuntu Server Latest. Magento is a popular open-source eCommerce platform used by thousands of businesses worldwide.

Prerequisites

Before starting with the installation process, ensure that you have the following prerequisites:

Step 1: Download Magento Open Source from Github

  1. Open your terminal
  2. Go to the directory where you want to install Magento
  3. Run the following command to clone Magento 2 from the Github repository:
git clone https://github.com/magento/magento2.git

Step 2: Install Composer

  1. Run the following command to download the latest version of Composer:
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
  1. Verify the installation by running the following command:
composer --version

Step 3: Install Magento Open Source

  1. Navigate to the Magento directory:
cd magento2
  1. Run the following command to install the Magento software:
composer install
  1. Once the installation is complete, set the file permissions on the Magento directory:
sudo chmod -R 777 pub var generated

Step 4: Create a MySQL database

  1. Login to MySQL as root:
sudo mysql -uroot -p
  1. Create a new MySQL database for Magento:
CREATE DATABASE magento;
  1. Create a new MySQL user for Magento:
CREATE USER 'magento'@'localhost' IDENTIFIED BY 'password';
  1. Grant the new MySQL user permissions for the Magento database:
GRANT ALL PRIVILEGES ON magento.* TO 'magento'@'localhost';
  1. Flush the MySQL privileges:
FLUSH PRIVILEGES;

Step 5: Configure Magento

  1. Navigate to the Magento directory:
cd magento2
  1. Run the following command to start the Magento installation process:
bin/magento setup:install --base-url=http://localhost/ --db-host=localhost --db-name=magento --db-user=magento --db-password=password --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 --backend-frontname=admin

Change the --base-url, --admin-email, --admin-firstname, --admin-lastname, --admin-user, and --admin-password parameters to your desired values.

  1. Wait for the installation process to complete.

Step 6: Test Magento

  1. Navigate to http://localhost/ in your web browser.
  2. Log in to the Magento dashboard using the credentials you set during installation.
  3. Once logged in, you should see the Magento storefront.

Congratulations! You have successfully installed Magento Open Source on Ubuntu Server Latest using Github.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!