Support & Downloads

Quisque actraqum nunc no dolor sit ametaugue dolor. Lorem ipsum dolor sit amet, consyect etur adipiscing elit.

s f

Contact Info
198 West 21th Street, Suite 721
New York, NY 10010
[email protected]
+88 (0) 101 0000 000

How to Install Magento 2.4.6 on Ubuntu 22.04

Magento Open Source 2.4.6 introduces support for PHP 8.2. PHP 8.1 remains fully supported, but support for PHP 7.4 has been removed. It includes significant performance and scalability enhancements. GraphQL operations for bulk cart operations and category tree rendering responses have been optimised.

This release includes over quality fixes and enhancements. Core Composer dependencies and third-party libraries have been upgraded to the latest versions that are compatible with PHP 8.2.

In this blog we will show you how to install the Open Source version of Magento 2.4.6 on Ubuntu 22.04 OS.

Before starting the installation, you can check the system requirements for installing Magento 2.4.6.

Prerequisites to be followed before installation:

1.Update and upgrade your operating system i.e., Ubuntu 22.04.

2. Install Apache

2.1 Add following commands to install Apache

2.2 Check your version of Apache being installed

2.3 Run following command to check whether apache2 is enabled or not.

3.Install nginx web server

   Adobe Commerce supports nginx 1.18 (or the latest mainline version). 

4.Install PHP and and configure php-fpm.

  Adobe Commerce and Magento Open Source require several PHP extensions to function properly.

  In addition to these extensions, you must also install and configure the php-fpm extension if

   you are using nginx. 

4.1. Install php-fpm and php-cli.

4.2. Open the php.ini files in an editor.

4.3. Edit both files to match the following lines.

4.4. Save and exit the editor.

4.5. Restart the php-fpm service.

5. Install MYSQL 8 ,phpmyadmin and create a database.

5.1 To install MySQL, run the following command from a terminal prompt.

5.2 Then, run following command.

5.3 To install phpmyadmin

When prompted to choose a web server, hit TAB, then ENTER to select apache2 as shown in the screenshot below.

When prompted to configure a database for your phpMyAdmin package, choose Yes and press ENTER to proceed.

Enter a strong password for the phpMyAdmin package. Press TAB and ENTER to proceed.

Repeat the same password to finalize the installation process. Press TAB and ENTER to continue.

Use the a2enconf command to enable the new configuration file created by the phpMyAdmin..

then, restart Apache to load the new configuration file.

 5.3 Start the database server daemon, and also enable it to start it automatically with the next boot with the following command.

5.4 After database server being installed, log into the MySQL prompt.

5.5 Enter the following commands in the order shown to create a database instance named magento with username magento .

5.6 Enter exit to quit the command prompt.

5.7 Navigate to the URL below in a web browser to test the installation. Replace or Localhost with the correct domain name or public IP address of your server.

Then enter the credentials of the user you’ve just created to log in.

5.8 Verify the database.

6. Installing Elasticsearch.

6.1 Import the Elasticsearch GPG key.

6.2 Add the Elasticsearch repository.

6.3 Update the apt package manager and install Elasticsearch.

6.4 After that start and enable the service.

6.5 Open the elasticsearch.yml file.

6.6 And replace this setting with false.

6.7 After that, you should restart elasticsearch service for the configuration.

6.8 To verify your Elasticsearch working.

6.9 It would look like this, if Elasticsearch is working properly:

7. Install PHP 8.1 and Related Modules

Add following command for update PHP and to check its version.

You will receive output like this:

You can also install more than one package at a time. Here are a few suggestions of the most common modules you will most likely want to install:

This command will install the following modules:

  • php8.1-cli – command interpreter, useful for testing PHP scripts from a shell or performing general shell scripting tasks
  • php8.1-common – documentation, examples, and common modules for PHP
  • php8.1-mysql – for working with MySQL databases
  • php8.1-zip – for working with compressed files
  • php8.1-gd – for working with images
  • php8.1-mbstring – used to manage non-ASCII strings
  • php8.1-curl – lets you make HTTP requests in PHP
  • php8.1-xml – for working with XML data
  • php8.1-bcmath – used when working with precision floats

8.For installing Composer.

8.1 For downloading the Composer, use the following command:

8.2 Move the composer file to the /usr/local/bin path.

8.3 Assign execute permission.

8.4 Verify the composer version installed.

9.Install Magento 2.4.6.

9.1 Mostly it is recommended to install Magento using Marketplace by creating access key.

For generating access key go to:

       My Profile>Marketplace>My Products>Access Keys:

Run following command to download Magento 2.4.6.

Username: Your Public Key:e6161608af9152b013f07ad3e1f8b9a2

Password: Your Private Key:4cde0d7054178296e40fe105b4f650b1

9.2 Navigate to Magento directory and change mode of cache and static content folder.

9.3 Now change the Ownership of Magento Directory to Web server user and also permission.

9.4 Create the user and go to the magento 2 directory.

9.5 Run following command to disable magento module.

9.6 Then, install Magento using composer command.

9.7 After installation you will see Magento admin link.

10. Change DocumentRoot To Pub

10.1 If you are installing Magento locally, you can add

10.2 Modify file as shown below

Remove ‘#’ from server name.

10.3 Restart Apache for the changes to take effect.

You can add Then you have to update hosts file at /etc/hosts with

Add this  below in localhost localhost   magento2

To save the above file  Ctrl + o and then Press Enter  and Close it with  Ctrl + x.

10.4 Configure Elasticsearch

Start editing the main elasticsearch.yml configuration file. Open it using nano or your preferred text editor

Remove the # character at the beginning of the lines for and to uncomment them, and then change their values. Your first configuration changes in the /etc/elasticsearch/elasticsearch.yml file will look like this “My First Node” my-application

Then, search for the line that contains, uncomment it, and change the value to

Set the network host to to listen on all interfaces and make it available publicly, or localhost

http.port: 9200

11. Configure Nginx web server for Magento 2.4.6.

11.1 Navigate to etc/nginx/conf.d  directory and run following command to create a configuration file for Magento installation.

Then add following content:

11.2 Save file and exit.

11.3 Restart Nginx web server.

12.Magento 2.4.6 Application.

12.1 Below code is required for developer mode.

12.2. After Install Magento Run the following command  To Get Homepage And  Admin in Root Directory.

12.3 Also for admin authorisation .

13. To install sample data for Magento 2.

13.1 To install the sample data, run the below command.

13.2 Sample data will fill your website with some products, categories and images so your website will look like this:

Well done! refresh your website and enjoy your new Magento 2.4.6  installation with sample data.

CEO / Managing Partner

[email protected]

Post a Comment