How to Install Magento 2 on Ubuntu 22.04 Server (Step by Step). In this post, we introduce Magento, its features, advantages then explain how to install Magento 2 on Ubuntu 22.04 server.
First of all, Magento is a well known open source eCommerce platform that allows the highest level of customization. One of the most reliable, adaptable, and extensible platforms that provides a wide range of effective tools for setting up and running your online store.
Secondly, Magento streamlines eCommerce operations and gives vendors a multi channel experience by enabling access to ready to use tools for product management, marketing, and SEO. Here, we are discussing more prominent features and advantages of Magento to further comprehend this eCommerce platform.
Importantly, with Magento it offers efficient operation by Magento Cloud to execute challenging eCommerce strategies. Below are Magento other features:
1. Analytics & Reporting
Supports Google Analytics to assist you in completing a complete investigation. Also offers several reports, including the following;
Interestingly, Magento has created an ece tools package for modular deployment tool customization to meet merchant’s or retailer’s requirements. This package contains scripts and instructions that enable retailers to launch eCommerce projects automatically, including project verification, cron management, and docker deploy environments.
3. ElasticSearch
ElasticSearch assists in managing search requests across huge catalogues in many languages and customising search results across a Magento store.
4. Customer accounts
Offers user accounts, incorporating various functions, and is simple to use with a comprehensive dashboard (account). With the order history & status, one or more delivery addresses, billing options, browsing history, shopping cart contents and more as features of the customer account.
5. Hosted on the clouds
The Magento edition’s cloud based framework enables quick scaling and consistent performance regardless of the sales season. Your eCommerce store will be running efficiently owing to Magento Commerce Cloud (which is operated by developers) and it handles any issues that may arise during traffic spikes.
6. Shipping and payments methods
The eCommerce platform of Magento enjoys following features:
Well, with Magento it operates both small and large stores to overcome difficulties with product placement and performance. The platform also offers services like product and inventory management for your website. Additionally, it also enables configuring filters and navigation in a way that increases conversion rates and improves the operation of your website.
Highly versatile Content Management
Retailers build and modify their offers to an easy to use, visually based page builder. Moreover, its content management interface provides the option where customers get a link to what they see. This interference is convenient for those who lack programming skills but still wish to alter how the shopping cart functions at its most basic level.
A versatile content management system is essential for eCommerce websites to publish new, high quality material every day, and draw in customers.
SEO Friendly
With Magento Enterprise Edition, optimising product descriptions is a simple process. It generates SEO friendly URLs so that you excel at your customer experience.
Customization
Magento offers a high level of customisation, which places it above other eCommerce platforms. Also design a distinctive storefront for your eCommerce shop that sets it apart from your rivals using Magento.
Provides top notch security
Easily manage internal access with top notch levels of security to secure your store. Employing Magento, you create a secondary password to prevent security breaches. In addition, Magento offers PCI Data Security and CAPTCHA for the highest level of security.
This is the main part of the article how to Install Magento 2 on Ubuntu 22.04 Server (Step by Step).
Magento uses ElasticSearch to provide search functionality. So you need to install the ElasticSearch on your server. First, install the Java JDK using the following command.
apt install openjdk-17-jdk -y
After the installation, download the Magento GPG key with the following command.
Next, add the Magento 2 repository to APT with the following command.
echo "deb [signed-by=/usr/share/keyrings/elastic.gpg] https://artifacts.elastic.co/packages/7.x/apt stable main" | tee -a /etc/apt/sources.list.d/elastic-7.x.list
Then, update the repository cache and install the ElasticSearch with the following command.
apt update -y
apt install elasticsearch -y
Once the ElasticSearch is installed, start and enable its service with the following command.
You also need to install the Apache web server, MySQL database server, PHP and other PHP modules to your server. Install all of them with the following command.
All settings correct for using Composer
Downloading...
Composer (version 2.5.1) successfully installed to: /usr/bin/composer
Use it: php /usr/bin/composer
Next, navigate to the Apacheweb root directory and download the latest version of Magento using the Composer.
cd /var/www/html
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.4.5 magento2
Provide your Magento public key and private key to download Magento from its website.
Authentication required (repo.magento.com):
Username: da86d0babbb486bc25703ad7a899116f
Password:
Do you want to store credentials for repo.magento.com in /root/.config/composer/auth.json ? [Yn] Y
Once Magento 2 is download, navigate to the magento2 directory and set proper permission on it.
cd magento2
find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} +
find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} +
chown -R www-data:www-data .
chmod u+x bin/magento
At this point, Magento 2 is downloaded on your server. Proceed to the next step.
Without a doubt Magento 2 provides an easier way to install it via command line interface. Run the following command to install Magento 2 on your server.
At this point, Magento 2 is installed on your server. Now, you need to create an Apache virtual host configuration file for Magento. Create it with the following command.
Now, open your web browser and access the Magento 2 web interface using the URL http://magento2.example.com. You will be redirected to the Magento 2 login page.
Provide your Magento 2 admin username, password and click on the Sign in button. See the Magento 2 dashboard on the following screen.
Thank you for reading How to Install Magento 2 on Ubuntu 22.04 Server (Step by Step). We shall conclude the article.
How to Install Magento 2 on Ubuntu 22.04 Server (Step by Step) Conclusion
In this guide, we showed you how to install Magento 2 with Apache on Ubuntu 22.04 server. Now you can start your own eCommerce store using the Magento. The advantages of Magento eCommerce development are uncountable, varying from hassle free product management to simple third party integration. These all greatly contribute to the expansion of your business. Therefore, choose Magento for its advanced features and benefits to stand out in the fierce competition with your rivals.
I am a fan of open source technology and have more than 10 years of experience working with Linux and Open Source technologies. I am one of the Linux technical writers for Cloud Infrastructure Services.