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:
- Ubuntu Server Latest installed
- PHP 7.4 or higher installed
- MySQL or MariaDB installed
- Apache or Nginx installed
Step 1: Download Magento Open Source from Github
- Open your terminal
- Go to the directory where you want to install Magento
- Run the following command to clone Magento 2 from the Github repository:
git clone https://github.com/magento/magento2.git
Step 2: Install Composer
- 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
- Verify the installation by running the following command:
composer --version
Step 3: Install Magento Open Source
- Navigate to the Magento directory:
cd magento2
- Run the following command to install the Magento software:
composer install
- 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
- Login to MySQL as root:
sudo mysql -uroot -p
- Create a new MySQL database for Magento:
CREATE DATABASE magento;
- Create a new MySQL user for Magento:
CREATE USER 'magento'@'localhost' IDENTIFIED BY 'password';
- Grant the new MySQL user permissions for the Magento database:
GRANT ALL PRIVILEGES ON magento.* TO 'magento'@'localhost';
- Flush the MySQL privileges:
FLUSH PRIVILEGES;
Step 5: Configure Magento
- Navigate to the Magento directory:
cd magento2
- 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 [email protected] --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.
- Wait for the installation process to complete.
Step 6: Test Magento
- Navigate to
http://localhost/in your web browser. - Log in to the Magento dashboard using the credentials you set during installation.
- Once logged in, you should see the Magento storefront.
Congratulations! You have successfully installed Magento Open Source on Ubuntu Server Latest using Github.