Install Magento 2.4.5 or Magento 2.4.6 on Ubuntu 22.04 [Complete Guide]

Install Magento 2.4.5 or Magento 2.4.6 on Ubuntu 22.04 [Complete Guide]

BEST HOSTING For MAGENTO2

Introducing Magento 2 is never a simple errand. Since the absolute first delivery, there are numerous issues clients may experience when introducing Magento 2.

With the most recent arrival of Magento 2.4.3, things have gotten more earnestly as Magento 2 currently, requires Elasticsearch as a compulsory part.

To make a Magento 2 establishment work appropriately in the Production climate, clients are prescribed to introduce Magento 2 in localhost first. At that point move the neighborhood establishment to a Magento 2 facilitating and update store’s Baseurl, and reindex Magento 2.

In this instructional exercise, we will experience the way toward introducing Magento 2 (with Elasticsearch) in Ubuntu.

If you are also want to install Magento2 on Windows. Click Here.

Contents-

  • Step 1: Install Apache2
  • Step 2: Install MySQL and Create Database for Magento2
  • Step 3: Install PHP and required extensions
  • Step 4: Install and configure Elasticsearch
  • Step 5: Install Composer
  • Step 6: Download and Install Magento2
  • Wrapping up

Before starting the installation, you can check theΒ system requirement for installing Magento2 here.

Step 1: Install Apache2

First, we will install Apache web server. Connect to your server using ssh protocol with root access and run this command:

Apache is available in Ubuntu’s default software repositories. For this reason, we’ll start by updating the local package index for the latest changes.

sudo apt update

Then, lets install the apache2Β package.

sudo apt install apache2

The system will ask to continue yes/no. Input β€œy” then enter to proceed.

Once installed, you can check the installed Apache version with the following command:

sudo apache2ctl -v

To verify if apache2 was install properly, in your browser, enter your domain or ip address or 127.0.0.1. If the result is apache default page => everything is fine

To enable auto startup for apache, use this command:

systemctl is-enabled apache2
Apache will be automatically started everytime you reboot your server.

Step 2: Install MySQL and Create Database for Magento2

Install MySQL using apt command:

sudo apt install mysql-server

When prompted, typingΒ YΒ to confirm installation and then pressΒ ENTER.

When the installation is complete, lets check the mysql version

Configure Password Access for the MySQL Root Account

Login with root user.

sudo mysql
SELECT user,authentication_string,plugin,host FROM mysql.user;

 

Note: Replace β€˜your_secure_passwordβ€˜ with your password.
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_secure_password';

 

exit

Create new MySQL user for Magento 2

Login with root user.

mysql -u root -p

 

SELECT user,authentication_string,plugin,host FROM mysql.user;
Note: Replace β€˜your_secure_passwordβ€˜ with your password.
CREATE USER 'magento2'@'localhost' IDENTIFIED BY 'your_secure_password';

ALTER USER 'magento2'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_secure_password';

Grant all privileges toΒ magento2Β users.

GRANT ALL PRIVILEGES ON *.* TO 'magento2'@'localhost' WITH GRANT OPTION;

 

exit

Create Magento 2 database

Lets create the database for our magento2: –

mysql -u magento2 -p

Then create

CREATE DATABASE magento2;
exit

 

Step 3: Install PHP and required extensions

In this step, we will install PHP.Β Magento 2.4Β require PHP 7.4, so we will install php 7.4 in this tutorial.

Update your APT repositories.

sudo aptΒ update

Install PHP 8.1 and packages with command:

sudo apt install php8.1 libapache2-mod-php php-mysql

Next, verify your PHP version:

php -v
Edit the /etc/apache2/mods-enabled/dir.conf file.
sudo nano /etc/apache2/mods-enabled/dir.conf

Modify the index.php file order to the top listed in the DirectoryIndex.

The dir.conf file after modifying will look like this:

Install and enableΒ mbstringΒ extension.

sudo apt install php8.1-mbstring
sudo phpenmod mbstring

Enable the Apache rewrite module.

sudo a2enmod rewrite

 

Install PHP modules for Magento 2.4.x.

sudo apt install php8.1-bcmath php8.1-intl php8.1-soap php8.1-zip php8.1-gd php8.1-curl php8.1-cli php8.1-xml php8.1-xmlrpc php8.1-gmp php8.1-common

Reload Apache for the changes to take effect.

sudo systemctl reload apache2

Configure php settings

php -i | grepΒ "Configuration File"

From this command, you will get path to the php.ini file. Open this file to modify some settings:

sudo nano <path_of_php.ini_file>

In php.ini file, search and change the following values as below

max_execution_time=18000
max_input_time=1800
memory_limit=4G

Save the file. Reload Apache2.

sudo systemctl reload apache2

These values will keep the installation go properly without interruption.

Step 4: Install and configure Elasticsearch

From Magento 2.4, Elasticsearch has become compulsory component. From Magento 2.4, catalog search will no longer use mysql, instead the system will use Elasticsearch by default.

So let’s install and configure it.

Install Elasticsearch

First, we will install Openjdk17 (Java) as Elasticsearch runs on Java:

sudo apt install openjdk-17-jdk

Next, verify if the java was installed properly and check its version with this syntax

java -version

The first step is toΒ import the GPG keyΒ for Elasticsearch packages using the following command:

sudo apt install curl

Once done, run below command:-

sudo curl -sSfL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --no-default-keyring --keyring=gnupg-ring:/etc/apt/trusted.gpg.d/magento.gpg --import

 

Then you need toΒ add Elasticsearch repositoryΒ to the system using the following command:

sudo sh -c 'echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" > /etc/apt/sources.list.d/elastic-7.x.list'
sudo chmod 666 /etc/apt/trusted.gpg.d/magento.gpg

After completing the above steps, you must firstΒ update the cacheΒ using the following commands. ThenΒ install Elasticsearch packagesΒ on the system:

sudo apt update
sudo apt install elasticsearch

Finally, you can use the following commandsΒ StartΒ andΒ enableΒ the Elasticsearch service:

sudo systemctl daemon-reload
sudo systemctl enable elasticsearch.service

sudo systemctl start elasticsearch.service

Configure Elasticsearch

Once the elasticsearch has been installed on your system, open the elasticsearch.yml configuration file.

Now that you have installed Elasticsearch and its Java dependency, it is time to configure Elasticsearch.

The Elasticsearch configuration files are in theΒ /etc/elasticsearch directory. The ones we’ll review and edit are:

  • elasticsearch.ymlΒ β€” Configures the Elasticsearch server settings. This is where most options are stored, which is why we are mostly interested in this file.
  • jvm.options β€” Provides configuration for the JVM such as memory settings.

The first variables to customize on any Elasticsearch server are node.nameΒ andΒ cluster.nameΒ inΒ elasticsearch.yml. Let’s do that now.

As their names suggest,Β node.nameΒ specifies the name of the server (node) and the cluster to which the latter is associated. If you don’t customize these variables, aΒ node.nameΒ will be assigned automatically in respect to the server hostname. TheΒ cluster.nameΒ will be automatically set to the name of the default cluster.

TheΒ cluster.nameΒ value is used by the auto-discovery feature of Elasticsearch to automatically discover and associate Elasticsearch nodes to a cluster. Thus, if you don’t change the default value, you might have unwanted nodes, found on the same network, in your cluster.

Let’s start editing the mainΒ elasticsearch.yml configuration file. Open it usingΒ nanoΒ or your preferred text editor:

sudo nano /etc/elasticsearch/elasticsearch.yml

Remove theΒ #Β character at the beginning of the lines forΒ node.nameΒ andΒ cluster.nameΒ to uncomment them, and then change their values. Your first configuration changes in theΒ /etc/elasticsearch/elasticsearch.ymlΒ file will look like this:

...

node.name: "My First Node"
cluster.name: my-application
...

Search for the line that contains network.host, uncomment it, and change the value to 0.0.0.0.

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

network.host: 127.0.0.1
http.port: 9200

Incase you want to configure this to be private/local to your machine. You will have to set theΒ network.hostΒ toΒ 127.0.0.1, so the content is not public.

If your server only has 1GB of RAM, you must edit this setting.
Open jvm.options:
sudo nano /etc/elasticsearch/jvm.options
Now change theΒ XmsΒ andΒ Xmx values toΒ 256MB:
...
-Xms256m
-Xmx256m
...
Save and exit the file. Now start Elasticsearch for the first time:
$ sudo nano /usr/lib/systemd/system/elasticsearch.service

TimeoutStartSec configures the time to wait for start-up. TIncrease this value to a proper value, in my case, I set it to 900.

sudo systemctl daemon-reload
sudo systemctl start elasticsearch.service
Allow some time for Elasticsearch to start before you attempt to use it. Otherwise, you may get a connection error.

Testing Elasticsearch

By now, Elasticsearch should be running on port 9200. You can test this using curl, the command-line tool for client-side URL transfers. To test the service, make aΒ GET request like this:

curl -X GET 'http://localhost:9200'

You will see the following response:

Output:

 

Now we have finished installing Elasticsearch.

Now let’s install next component – Composer.

Step 5: Install Composer

In this tutorial, we will install Magento 2.4 using composer. First, run this command to download composer installer.

Move back to the root directory.

cd ~
Downloading and installing composer.
curl -sS https://getcomposer.org/installer -o composer-setup.php
sudo php composer-setup.php --install-dir=/usr/bin --filename=composer

Let’s check the composer version.

composer

 

Our composer version is 2.1.6.Β Now we are ready toΒ download Magento 2.4Β using composer.

Step 6: Download and Install Magento2

Download Magento2:-

Go toΒ htmlΒ folder by command:

cd /var/www/html

Create a new Composer project using the Magento Open Source or Magento Commerce metapackage.

Command for this is :-

sudo composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.4.5 magento2

For Magento 2.4.6

sudo composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.4.6 magento2

 

Create an account on Magento marketplace and go to https://marketplace.magento.com/customer/accessKeys/ to get private and public access key,

 

 

Create Access keys here. If you have access keys, you can use those.

Now enterΒ UsernameΒ Β andΒ passwordΒ to start downloading

  • Username: Your public KeyΒ  2fc966a913d4e83b28041eeb3c3b72e5
  • Password: Your private key. 48e05400d17ca1bcb4e693825c45416e

You will see this screen if everything is fine. Now just wait some minutes, composer is download Magento 2 to your server

 

Wait the process to complete.

Set file permissions

cd /var/www/html/<magento install directory>
sudo find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} +
sudo find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} +
sudo chown -R user_name:www-data .
sudo chmod u+x bin/magento
Note: sudo chown -R user_name:www-data .Β  => user_name is the user with root access

Install Magento 2

Everything is ready, now we will run the final command to install Magento 2.4

First, change the current directory to your website folderΒ (this is also where you downloaded Magento 2 data in step 3)

Go to Magento 2 install directory.

cd /var/www/html/<magento install directory>

You must use the command line to install Magento.

php bin/magento setup:installΒ --base-url=<your-domain>Β --db-host=localhostΒ --db-name=magento2Β --db-user=magento2Β --db-password=<your-db-password-of-magento2-user>Β --admin-firstname=AdminΒ --admin-lastname=AdminΒ --admin-email=admin@admin.comΒ --admin-user=adminΒ --admin-password=<your-admin-password>Β --language=en_USΒ --currency=USDΒ --timezone=America/ChicagoΒ --backend-frontname=adminΒ --search-engine=elasticsearch7Β --elasticsearch-host=localhostΒ --elasticsearch-port=9200

Replace the following information with your information

--base-url : your domain, eg: sonal.magento.com. You can change this base URL later if you make mistake.

--db-hostΒ : Database host, inputΒ localhostΒ if you follow my tutorial

--db-nameΒ : name of the database we created in step 2

--db-userΒ : name of the database user we created in step 2

--db-passwordΒ : password of your mysql user

Now composer will start installing Magento 2.4. The process will take a while (approximately 20 minutes)

 

Wait until the installation is successful.

When everything is done you will see this

 

Congratulation, Magento 2.4 was successfully installed to your ubuntu server.

Change DocumentRoot To Pub

If you append a directory name to your server’s hostname or IP address to create the base URL when you installed Magento (for example http://<your-ip>/magento2 or http://<your-sever-hostname>/magento2), you’ll need to remove it.

Edit your virtual host file

sudo nano /etc/apache2/sites-available/sonal.magento.com.conf

Add the path to your MagentoΒ pub/Β directory to theΒ DocumentRoot directive:

Modify file as shown below:

<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/magento2/pub
Β  Β  Β  Β  Β ServerNameΒ sonal.magento.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory "/var/www/html">
AllowOverride all
</Directory>
</VirtualHost>

Restart Apache for the changes to take effect:

sudo systemctl restart apache2

If you are installing Magento locally, you can add domain.com.Β Then you have to updateΒ hostsΒ file atΒ /etc/hostsΒ with

127.0.0.1 sonal.magento.com
Add line at the last of this file
127.0.0.1 sonal.magento.com
Save the file (Ctrl + o and then Press Enter) and Close it (Ctrl + x).
Run the below command,
sudo a2ensite sonal.magento.com.conf
Next, you will need to run these command to upgrade the database and deploy static view files
php bin/magento indexer:reindex && php bin/magento se:up && php bin/magento se:s:d -f && php bin/magento c:f && php bin/magento module:disable Magento_TwoFactorAuth Magento_AdminAdobeImsTwoFactorAuth  

Hit the URL http://sonal.magento.com in the browser. This is Magento 2 Home page

 

Admin Login

Your Admin Url – http://sonal.magento.com/admin/Β 

When logging to admin dashboard withΒ username – adminΒ andΒ password – Admin@123456(which we set in magento install command),

 

Step 7: Install sample data for Magento 2

Now we will deploy sample data for our new Magento 2.4.4 website on localhost. Sample data will fill your website with some products, categories and images so your website will look like this:

 

To install the sample data, run the below command

php bin/magento sampledata:deploy && php bin/magento indexer:reindex && php bin/magento se:up && php bin/magento se:s:d -f && php bin/magento c:f

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

 

You can watch complete video for this installation of Magento2 on Ubuntu.

Wrapping up

I have tried my best to give you the step-by-step tutorial so that it will be helpful for users who are having trouble installing Magento 2.4. If you face any problems during installation process, please drop a comment below (better with image describing your problem). I will be happy to help!

Recommended Posts

Sonal Motghare-Balpande
Sonal Motghare-Balpande

Hello Readers, With over 14 years of experience as a PHP expert and a Magento Certified Professional, I bring both technical mastery and a passion for growth. Beyond coding, I embrace a healthy lifestyle and believe in the transformative power of knowledge. My mission is to empower others through guidance because true success lies in sharing what we know. Let’s grow togetherβ€” https://www.facebook.com/SonalMotghareBalpande/ https://www.linkedin.com/in/sonalmotgharebalpande/ https://www.instagram.com/sonalmotgharebalpande/ Thank You, Sonal

One thought on “Install Magento 2.4.5 or Magento 2.4.6 on Ubuntu 22.04 [Complete Guide]

  1. Hi Sonal,

    I am getting
    Class “Magento\Framework\App\ResourceConnection\Proxy” does not exist
    while running php bin/magento setup:install ….

    Can you please help me here.

    Thanks

  2. Hi Sonal,
    First thank you so much for such the informative blog.
    Second, I am facing an issue

    ““Your requirements could not be resolved to an installable set of packages.

    Problem 1
    – Root composer.json requires magento/product-community-edition 2.4.5-p2 -> satisfiable by magento/product-community-edition[2.4.5-p2].
    – magento/product-community-edition 2.4.5-p2 requires php ~7.4.0||~8.1.0 -> your php version (8.2.3) does not satisfy that requirement.
    Problem 2
    – magento/magento2-functional-testing-framework[3.7.0, …, 3.12.0] require ext-intl * -> it is missing from your system. Install or enable PHP’s intl extension.
    – Root composer.json requires magento/magento2-functional-testing-framework ^3.7 -> satisfiable by magento/magento2-functional-testing-framework[3.7.0, …, 3.12.0].

    To enable extensions, verify that they are enabled in your .ini files:
    – /etc/php/8.2/cli/php.ini
    – /etc/php/8.2/cli/conf.d/10-mysqlnd.ini
    – /etc/php/8.2/cli/conf.d/10-opcache.ini
    – /etc/php/8.2/cli/conf.d/10-pdo.ini
    – /etc/php/8.2/cli/conf.d/15-xml.ini
    – /etc/php/8.2/cli/conf.d/20-bz2.ini
    – /etc/php/8.2/cli/conf.d/20-calendar.ini
    – /etc/php/8.2/cli/conf.d/20-ctype.ini
    – /etc/php/8.2/cli/conf.d/20-curl.ini
    – /etc/php/8.2/cli/conf.d/20-dom.ini
    – /etc/php/8.2/cli/conf.d/20-exif.ini
    – /etc/php/8.2/cli/conf.d/20-ffi.ini
    – /etc/php/8.2/cli/conf.d/20-fileinfo.ini
    – /etc/php/8.2/cli/conf.d/20-ftp.ini
    – /etc/php/8.2/cli/conf.d/20-gd.ini
    – /etc/php/8.2/cli/conf.d/20-gettext.ini
    – /etc/php/8.2/cli/conf.d/20-iconv.ini
    – /etc/php/8.2/cli/conf.d/20-mbstring.ini
    – /etc/php/8.2/cli/conf.d/20-mcrypt.ini
    – /etc/php/8.2/cli/conf.d/20-mysqli.ini
    – /etc/php/8.2/cli/conf.d/20-pdo_mysql.ini
    – /etc/php/8.2/cli/conf.d/20-phar.ini
    – /etc/php/8.2/cli/conf.d/20-posix.ini
    – /etc/php/8.2/cli/conf.d/20-readline.ini
    – /etc/php/8.2/cli/conf.d/20-shmop.ini
    – /etc/php/8.2/cli/conf.d/20-simplexml.ini
    – /etc/php/8.2/cli/conf.d/20-sockets.ini
    – /etc/php/8.2/cli/conf.d/20-sysvmsg.ini
    – /etc/php/8.2/cli/conf.d/20-sysvsem.ini
    – /etc/php/8.2/cli/conf.d/20-sysvshm.ini
    – /etc/php/8.2/cli/conf.d/20-tokenizer.ini
    – /etc/php/8.2/cli/conf.d/20-xmlreader.ini
    – /etc/php/8.2/cli/conf.d/20-xmlwriter.ini
    – /etc/php/8.2/cli/conf.d/20-xsl.ini
    – /etc/php/8.2/cli/conf.d/20-zip.ini
    You can also run `php –ini` in a terminal to see which files are used by PHP in CLI mode.
    Alternatively, you can run Composer with `–ignore-platform-req=ext-intl` to temporarily ignore these required extensions.Your requirements could not be resolved to an installable set of packages.

    Problem 1
    – Root composer.json requires magento/product-community-edition 2.4.5-p2 -> satisfiable by magento/product-community-edition[2.4.5-p2].
    – magento/product-community-edition 2.4.5-p2 requires php ~7.4.0||~8.1.0 -> your php version (8.2.3) does not satisfy that requirement.
    Problem 2
    – magento/magento2-functional-testing-framework[3.7.0, …, 3.12.0] require ext-intl * -> it is missing from your system. Install or enable PHP’s intl extension.
    – Root composer.json requires magento/magento2-functional-testing-framework ^3.7 -> satisfiable by magento/magento2-functional-testing-framework[3.7.0, …, 3.12.0].

    To enable extensions, verify that they are enabled in your .ini files:
    – /etc/php/8.2/cli/php.ini
    – /etc/php/8.2/cli/conf.d/10-mysqlnd.ini
    – /etc/php/8.2/cli/conf.d/10-opcache.ini
    – /etc/php/8.2/cli/conf.d/10-pdo.ini
    – /etc/php/8.2/cli/conf.d/15-xml.ini
    – /etc/php/8.2/cli/conf.d/20-bz2.ini
    – /etc/php/8.2/cli/conf.d/20-calendar.ini
    – /etc/php/8.2/cli/conf.d/20-ctype.ini
    – /etc/php/8.2/cli/conf.d/20-curl.ini
    – /etc/php/8.2/cli/conf.d/20-dom.ini
    – /etc/php/8.2/cli/conf.d/20-exif.ini
    – /etc/php/8.2/cli/conf.d/20-ffi.ini
    – /etc/php/8.2/cli/conf.d/20-fileinfo.ini
    – /etc/php/8.2/cli/conf.d/20-ftp.ini
    – /etc/php/8.2/cli/conf.d/20-gd.ini
    – /etc/php/8.2/cli/conf.d/20-gettext.ini
    – /etc/php/8.2/cli/conf.d/20-iconv.ini
    – /etc/php/8.2/cli/conf.d/20-mbstring.ini
    – /etc/php/8.2/cli/conf.d/20-mcrypt.ini
    – /etc/php/8.2/cli/conf.d/20-mysqli.ini
    – /etc/php/8.2/cli/conf.d/20-pdo_mysql.ini
    – /etc/php/8.2/cli/conf.d/20-phar.ini
    – /etc/php/8.2/cli/conf.d/20-posix.ini
    – /etc/php/8.2/cli/conf.d/20-readline.ini
    – /etc/php/8.2/cli/conf.d/20-shmop.ini
    – /etc/php/8.2/cli/conf.d/20-simplexml.ini
    – /etc/php/8.2/cli/conf.d/20-sockets.ini
    – /etc/php/8.2/cli/conf.d/20-sysvmsg.ini
    – /etc/php/8.2/cli/conf.d/20-sysvsem.ini
    – /etc/php/8.2/cli/conf.d/20-sysvshm.ini
    – /etc/php/8.2/cli/conf.d/20-tokenizer.ini
    – /etc/php/8.2/cli/conf.d/20-xmlreader.ini
    – /etc/php/8.2/cli/conf.d/20-xmlwriter.ini
    – /etc/php/8.2/cli/conf.d/20-xsl.ini
    – /etc/php/8.2/cli/conf.d/20-zip.ini
    You can also run `php –ini` in a terminal to see which files are used by PHP in CLI mode.
    Alternatively, you can run Composer with `–ignore-platform-req=ext-intl` to temporarily ignore these required extensions.Your requirements could not be resolved to an installable set of packages.

    Problem 1
    – Root composer.json requires magento/product-community-edition 2.4.5-p2 -> satisfiable by magento/product-community-edition[2.4.5-p2].
    – magento/product-community-edition 2.4.5-p2 requires php ~7.4.0||~8.1.0 -> your php version (8.2.3) does not satisfy that requirement.
    Problem 2
    – magento/magento2-functional-testing-framework[3.7.0, …, 3.12.0] require ext-intl * -> it is missing from your system. Install or enable PHP’s intl extension.
    – Root composer.json requires magento/magento2-functional-testing-framework ^3.7 -> satisfiable by magento/magento2-functional-testing-framework[3.7.0, …, 3.12.0].

    To enable extensions, verify that they are enabled in your .ini files:
    – /etc/php/8.2/cli/php.ini
    – /etc/php/8.2/cli/conf.d/10-mysqlnd.ini
    – /etc/php/8.2/cli/conf.d/10-opcache.ini
    – /etc/php/8.2/cli/conf.d/10-pdo.ini
    – /etc/php/8.2/cli/conf.d/15-xml.ini
    – /etc/php/8.2/cli/conf.d/20-bz2.ini
    – /etc/php/8.2/cli/conf.d/20-calendar.ini
    – /etc/php/8.2/cli/conf.d/20-ctype.ini
    – /etc/php/8.2/cli/conf.d/20-curl.ini
    – /etc/php/8.2/cli/conf.d/20-dom.ini
    – /etc/php/8.2/cli/conf.d/20-exif.ini
    – /etc/php/8.2/cli/conf.d/20-ffi.ini
    – /etc/php/8.2/cli/conf.d/20-fileinfo.ini
    – /etc/php/8.2/cli/conf.d/20-ftp.ini
    – /etc/php/8.2/cli/conf.d/20-gd.ini
    – /etc/php/8.2/cli/conf.d/20-gettext.ini
    – /etc/php/8.2/cli/conf.d/20-iconv.ini
    – /etc/php/8.2/cli/conf.d/20-mbstring.ini
    – /etc/php/8.2/cli/conf.d/20-mcrypt.ini
    – /etc/php/8.2/cli/conf.d/20-mysqli.ini
    – /etc/php/8.2/cli/conf.d/20-pdo_mysql.ini
    – /etc/php/8.2/cli/conf.d/20-phar.ini
    – /etc/php/8.2/cli/conf.d/20-posix.ini
    – /etc/php/8.2/cli/conf.d/20-readline.ini
    – /etc/php/8.2/cli/conf.d/20-shmop.ini
    – /etc/php/8.2/cli/conf.d/20-simplexml.ini
    – /etc/php/8.2/cli/conf.d/20-sockets.ini
    – /etc/php/8.2/cli/conf.d/20-sysvmsg.ini
    – /etc/php/8.2/cli/conf.d/20-sysvsem.ini
    – /etc/php/8.2/cli/conf.d/20-sysvshm.ini
    – /etc/php/8.2/cli/conf.d/20-tokenizer.ini
    – /etc/php/8.2/cli/conf.d/20-xmlreader.ini
    – /etc/php/8.2/cli/conf.d/20-xmlwriter.ini
    – /etc/php/8.2/cli/conf.d/20-xsl.ini
    – /etc/php/8.2/cli/conf.d/20-zip.ini
    You can also run `php –ini` in a terminal to see which files are used by PHP in CLI mode.
    Alternatively, you can run Composer with `–ignore-platform-req=ext-intl` to temporarily ignore these required extensions.

      1. Thanks Sonal for the response. After making changes I am getting
        Class “Magento\Framework\App\ResourceConnection\Proxy” does not exist

        Can you please help here.

  3. Best install instructions. Ever. The only times I ran into issues was due to my own typing mistakes, or bash not liking special characters in passwords.
    Thank you so much for the time and effort you put into this.

  4. I am seeing Whoops, our bad… (404 Not Found) error. What wrong I have done? Is anybody know how resolve this issue?

  5. Great tutorial.

    What do I need to do to change the host name for Magento e.g. from example.magento.com to store.mysite.com?

    Thanks for your help.

  6. Would you please be so kind as to explain where I have made a mistake.
    /var/www/html/magento/app# vim bootstrap.php

    bash: /var/www/html/magento/app#: No such file or directory

    1. Hello Saul Zimmerman,

      Check what is the folder name for magento in /var/www/html and one more point, there is no need of modifying bootstrap.php file. do you have any specific reason for doing it.

      Thanks

  7. Good afternoon. Could you please help me. Step 6 sudo find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} +
    find: β€˜var’: No such file or directory
    find: β€˜generated’: No such file or directory
    find: β€˜vendor’: No such file or directory
    find: β€˜pub/static’: No such file or directory
    find: β€˜pub/media’: No such file or directory
    find: β€˜app/etc’: No such file or directory

  8. I am getting below error when i run php bin/magento setup:install as i added all parameters as per your document

    SQLSTATE[HY000] [2002] Connection timed out

    In InstallCommand.php line 282:

    Parameter validation failed

    Can you help me what i am doing wrong

  9. Thanks for the instruction. It is absolutely detailed.

    While running the installation command on VPS ubuntu server. I am getting this error.

    SQLSTATE[HY000] [1045] Access denied for user ‘magento2’@’localhost’ (using password: YES)

    In InstallCommand.php line 282:

    Parameter validation failed.

    Command used:
    php bin/magento setup:install –base-url=”http://domainname.com” –db-host=”localhost” –db-name=”magento2″ –db-user=”magento2″ –db-password=”password” –admin-firstname=”admin” –admin-lastname=”Shaikh” –admin-email=”ismat@email.com” –admin-user=”ismat” –admin-password=”Password” –language=”en_US” –currency=USD –timezone=”America/Chicago” –backend-frontname=”admin” –search-engine=”elasticsearch7″ –elasticsearch-host=”localhost” –elasticsearch-port=”9200″

    Even if I use the server ip as db host, then it says connection refused. But I am able to connect to the mysql database through command line.
    sudo mysql -u magento2 -p

    Thanks.

  10. I have setup magento2, but I am having the following issues:

    While adding sample data(php bin/magento sampledata:deploy && php bin/magento indexer:reindex && php bin/magento se:up && php bin/magento se:s:d -f && php bin/magento c:f) I get an error:

    Catalog Search index process error during indexation process:
    Could not ping search engine: No alive nodes found in your cluster

    When I checked elastic search it is not up, I got the following error:

    sudo systemctl start elasticsearch.service
    Job for elasticsearch.service failed because the control process exited with error code.
    See “systemctl status elasticsearch.service” and “journalctl -xe” for details.

    Could you please help me

  11. Hello Dear
    After installation successful I get this error
    404 error not found
    Installation in localy Ubuntu
    All steep you described in post 100% successful
    Magento2.4.4
    Apache2
    MySQL 8
    Php 8.1
    Kindly help
    Thank you

  12. Hello mam i am facing two factor auth problem how can i fix it please gudide me?
    this command isn’t working showing error
    php bin/magento module:disable Magento_TwoFactorAuth

  13. Thanks very much for this nice Tutorial.
    I am having few problems.
    First I can successfully open my home page but cant open admin page it says error 404.
    second problem : php/bin magento setup:upgrade shows the following errors.
    suneet@ubuntum1:/var/www/html/magento2$ php bin/magento setup:upgrade
    Warning: file_put_contents(/var/www/html/magento2/var/cache//mage-tags/mage—f73_CONFIG): Failed to open stream: Permission denied in /var/www/html/magento2/vendor/colinmollenhour/cache-backend-file/File.php on line 691#0 [internal function]: Magento\Framework\App\ErrorHandler->handler()
    #1 /var/www/html/magento2/vendor/colinmollenhour/cache-backend-file/File.php(691): file_put_contents()
    #2 /var/www/html/magento2/vendor/colinmollenhour/cache-backend-file/File.php(203): Cm_Cache_Backend_File->_updateIdsTags()
    #3 /var/www/html/magento2/vendor/magento/zendframework1/library/Zend/Cache/Core.php(390): Cm_Cache_Backend_File->save()
    #4 /var/www/html/magento2/vendor/magento/framework/Cache/Core.php(74): Zend_Cache_Core->save()
    #5 /var/www/html/magento2/vendor/magento/framework/Cache/Frontend/Adapter/Zend.php(63): Magento\Framework\Cache\Core->save()
    #6 /var/www/html/magento2/vendor/magento/framework/Cache/Frontend/Decorator/Bare.php(75): Magento\Framework\Cache\Frontend\Adapter\Zend->save()
    #7 /var/www/html/magento2/vendor/magento/framework/Cache/Frontend/Decorator/TagScope.php(52): Magento\Framework\Cache\Frontend\Decorator\Bare->save()
    #8 /var/www/html/magento2/vendor/magento/framework/Cache/Frontend/Decorator/Bare.php(75): Magento\Framework\Cache\Frontend\Decorator\TagScope->save()
    #9 /var/www/html/magento2/vendor/magento/framework/App/Cache.php(73): Magento\Framework\Cache\Frontend\Decorator\Bare->save()
    #10 /var/www/html/magento2/vendor/magento/framework/App/Cache/Proxy.php(81): Magento\Framework\App\Cache->save()
    #11 /var/www/html/magento2/vendor/magento/framework/App/ProductMetadata.php(87): Magento\Framework\App\Cache\Proxy->save()
    #12 /var/www/html/magento2/vendor/magento/framework/Console/Cli.php(99): Magento\Framework\App\ProductMetadata->getVersion()
    #13 /var/www/html/magento2/bin/magento(22): Magento\Framework\Console\Cli->__construct()
    #14 {main}

    Kindly help
    Thanks

    1. Hello sam,

      Please run below command to install sample data:

      php bin/magento sampledata:deploy && php bin/magento indexer:reindex && php bin/magento se:up && php bin/magento se:s:d -f && php bin/magento c:f

      Thanks,

  14. Great guide, which works πŸ™‚ . Thanks!

    Two questions:

    1) The installation of sample data does not work for me with the given command. Any hint?

    2) Do you have a fitting “Composer” guide to add an extension?

    Thanks again. Greetings from Europe

Leave a Reply

Your email address will not be published. Required fields are marked *

πŸš€ Let’s Connect on LinkedIn! πŸš€

Want to level up your skills and knowledge? πŸš€
Follow us on LinkedIn to get:
βœ… Expert insights on business growth
βœ… Daily tips to sharpen your skills
βœ… Exclusive updates from The Coach SMB

Let's grow together!