MGT Development Environment - Magento2 Installation

On this page, we will explain step by step how to install a blank Magento 2 installation accessible via the domain magento2.mgt.

  1. Go to Domains and click on the button Add Domain.

Enter the Domain Name like magento2.mgt and make sure the Document Root points to the pub directory.

Select the Magento 2 Vhost Template, The PHP Version 8.2, and click on Add Domain button.

MGT Development Environment - Add Domain
  1. Go to Databases and click on the button Add Database.

Enter the Database Name, Database Username, and Database User Password and click on Add Database button.

MGT Development Environment - Add Database
  1. Login into the Docker Container via ssh:
ssh root@127.0.0.1

Password: root

  1. Delete the magento2.mgt directory:
rm -rf /home/cloudpanel/htdocs/magento2.mgt/
  1. Create the auth file and enter your Magento Authentication Keys.
nano ~/.config/composer/auth.json
{
"http-basic": {
"repo.magento.com": {
"username": "",
"password": ""
}
}
}
  1. Install Magento 2 via composer:
cd /home/cloudpanel/htdocs/
php8.2 /usr/local/bin/composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition magento2.mgt
  1. Go to the installation directory and execute the setup::install script from Magento:
cd /home/cloudpanel/htdocs/magento2.mgt/
Edit Parameters

Edit the parameters like key, db-host, db-name and so on to your needs.

php8.2 bin/magento setup:install --backend-frontname='admin' --key='18Av6ITivOZG3gwY1DhMDWtlLfx1spLP' --session-save='files' --db-host='127.0.0.1' --db-name='magento2' --db-user='magento2' --db-password='magento2' --base-url='https://magento2.mgt/' --base-url-secure='https://magento2.mgt/' --admin-user='admin' --admin-password='!admin123!' --admin-email='john@doe.com' --admin-firstname='John' --admin-lastname='Doe'
  1. Disable the Two-Factor Authentication that we can lo gin into the Magento Backend without a One-Time Password.
php8.2 bin/magento module:disable Magento_AdminAdobeImsTwoFactorAuth
php8.2 bin/magento module:disable Magento_TwoFactorAuth
  1. Reset the permissions:
chmod -R 777 /home/cloudpanel/htdocs/magento2.mgt/
warning

The permissions 777 are not recommended for production environments!

  1. Edit the hosts file and point magento2.mgt to 127.0.0.1:
sudo nano /etc/hosts

Add the following line at the end of the file:

127.0.0.1 magento2.mgt
  1. The installation of Magento2 is done.

Frontend: https://magento2.mgt/
Backend: https://magento2.mgt/admin/

Username: admin
Password: !admin123!