Let us install Magento 2.3.x community edition on Ubuntu 19.10 with composer. I already have installed PHP 7.3, MySQL 8, and Apache2.4 and tested phpinfo method; it’s working on my Ubuntu laptop with Ubuntu or Debian.
I am assuming that you also have installed PHP, MySQL, Apache 2 web server, and composer. One more thing; you will require to have Magento account in order to generate your authentication key.
Install PHP, MySQL, Apache, & Composer
If you have not installed them yet, go ahead and install one by one
sudo apt install php
sudo apt install mysql-server
sudo apt install apache
sudo apt install composer
Set File Permissions
Launch your terminal and run the following commands to set file permission in var/www/html
sudo chown -R wwwdata:www-data var/www/html
Create Magento Access Keys
Login to your Magento Market place account and under my account click ‘Access Keys’ then click create/generate. This will create publich key and private key.
Public Key is used as useranamd
Private key is used as password
Install Magento with Composer
Launch your terminal and run the following commanda to install magento community edition.
Install Required PHP ext
I had to install the following php exts
sudo apt install php7.3-curl
sudo apt install php7.3-bsmath
sudo apt install php7.3-zip
sudo apt install php7.3-intl
sudo apt install php7.3-soap
You can install multiple php exts once like:
sudo apt install php7.3-bsmath php7.3-intl php7.3-zip php7.3-curl
Restart Your Apache server
ststemctl restart apache2
Change Dirctory into
cd /var/www/html
How to install Magento 2.3.x on Ubuntu with/Using Composer
Let us install Magento 2.3.x community edition on Ubuntu 19.10 with composer. I already have installed PHP 7.3, MySQL 8, and Apache2.4 and tested phpinfo method; it’s working on my Ubuntu laptop.
I am assuming that you also have installed PHP, MySQL, Apache 2 web server, and composer. One more thing; you will require to have Magento account in order to generate your authentication key.
Install PHP, MySQL, Apache, & Composer
If you have not installed them yet, go ahead and install one by one
sudo apt install php
sudo apt install mysql-server
sudo apt install apache
sudo apt install composer
Set File Permissions
Launch your terminal and run the following commands to set file permission in var/www/html
sudo chown R wwwdata:www-data var/www/html
Create Magento Access Keys
Login to your Magento Market place account and under my account click ‘Access Keys’ then click create/generate. This will create publich key and private key.
Public Key is used as useranamd
Private key is used as password
Install Required PHP ext
I had to install the following php exts, and restart Apache web server each time.
sudo apt install php7.3-curl
sudo apt install php7.3-bsmath
sudo apt install php7.3-zip
sudo apt install php7.3-intl
sudo apt install php7.3-soap
You can install multiple php exts once like:
sudo apt install php7.3-bsmath php7.3-intl php7.3-zip php7.3-curl
Restart Your Apache server
ststemctl restart apache2
Install Magento with Composer
Launch your terminal and run the following command to install magento community edition.
Change Dirctory into
cd /var/www/html
sudo composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition <magento 2 install direcotory name>
Now, the terminal will ask for username and password, from your Magento account page copy public access key for username in the terminal and private access key for password in the ternimal.
Private key does not show up in the terminal so paste just once and hit enter and let it go.
Type Y, when it asks “Do you want to store credentials”
This will download Magento 2.3.x and create your directory in var/www/html and install Magento in it. In case, PHP ini file is missing any ext required by Mangeto it give error.
Just read and install the PHP ext and restart apacher server, remove Magento Installation direcory and re run the Magento installation command.
to install php ext : sudo apt install php7.3-ext_name
to remove installation folder, from var/www/html: sudo rm -R /folder_name
sudo composer create-project –repository-url=https://repo.magento.com/ magento/project-community-edition <magento 2 install direcotory name>
Now, the terminal will ask for username and password, from your Magento account page copy public access key for username in the terminal and private access key for password in the ternimal.
Private key does not show up in the terminal so paste just once and hit enter and let it go.
Type Y, when it asks “Do you want to store credentials”
This will download Magento 2.3.x and create your directory in var/www/html and install Magento in it. In case, PHP ini file is missing any ext required by Mangeto it give error.
Just read and install the PHP ext and restart apacher server, remove Magento Installation direcory and re run the Magento installation command.
to install php ext : sudo apt install php7.3-ext_name
to remove installation folder, from /var/www/html: sudo rm -R /folder_name
Let Megento Install all the modules and Dependiencies
It may take some time to install all the required modules and dependencies.
Have patience and grab a cup of coffee or bear.
Set Magento Root Folder File Permissions
Finally, magento 2.3.x is installed with composer. Now, we need to check if it is going to load in the browser. No, it does not load and give http error 500.
to fix this
Run the following command.
sudo chown -R /var/www/html/install_folder
Type your sudo password and refresh your browser. and here we go… boom!!!
Hit that “Agree and Setup Magento” and let check the READINESS…
Create A Database /w MySQL
Before you hit NEXT button on the right top, make sure you have created a database.
mysql -u username -p
Enter you MySQL password and create database.
CREATE DATABASE db_name;
Enter your database credentials on the next page and hit NEXT again.
Now, edit your store admin address path. Since this is my local environment, I named it /admin and going to hit NEXT.
Customize Your Store
Select time zone, store currency, and default language and have a look at Advanced Modules Configurations then hit NEXT >>
Create Magento Admin Account
Choose your Magento admin name, password and type your working email address.
Once you are happy with your admin username, password, and email address and hit NEXT to install Magento on you Ubuntu local environment.
Hit INSTALL NOW
After hitting INSTALL NOW button it’s going to finally install Magento on localhost.
SUCCESS! Magento is Installed