Skip to main content


On this site, you find a guide to install Magento 2 on CloudPanel.


Magento 2 requires to have Elasticsearch 7.9 installed.

Follow the guide to learn how to install Elasticsearch 7.9.

Creating a Magento Site

Via CloudPanel

  1. Click on + Add Site and then click on Create a PHP Site.
Create a PHP Site
  1. Select the Application Magento 2, enter Domain Name, Site User, Site User Password, and click on Create.
Create a Magento Site

Via CloudPanel CLI

If you like the command line, you can create a Magento Site with the following command as root user.

clpctl site:add:php --phpVersion=8.2 --vhostTemplate='Magento 2' --siteUser='john-doe' --siteUserPassword='!secretPassword!'

Creating a Magento 2 Project

  1. Log in via SSH with the Site User:
ssh john-doe@server-ip-address
  1. Go to htdocs and delete the directory which CloudPanel has created:
cd htdocs && rm -rf
  1. Create a Magento Project via Composer.
Magento Authentication Keys Required

Get Magento Authentication Keys before you create the project via composer.

php8.2 /usr/local/bin/composer create-project --repository-url= magento/project-community-edition
  1. Create a Database and copy the Database Name, Database User Name, and Database User Password.

  2. Go to the installation directory and execute the setup::install script from Magento:

cd ~/htdocs/
Edit Parameters

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

php8.2 bin/magento setup:install --backend-frontname='admin' --key='18Av6ITivOZG3gwY1DhMDWtlLfx1spLP' --session-save='files' --db-host='' --db-name='magento2' --db-user='magento2' --db-password='magento2' --base-url='' --base-url-secure='' --admin-user='admin' --admin-password='!admin123!' --admin-email='' --admin-firstname='John' --admin-lastname='Doe'
  1. Done. Magento 2 has been installed.
Magento 2 has been installed