Blog · WebJi® India

Install Magento in cPanel

Quick answer: Magento installs on cPanel through Composer from the account terminal, not the old web wizard. Set PHP 8.2 or 8.3 and the required extensions, create a MySQL database, run composer create-project, then bin/magento setup:install. It worked when the storefront loads and the admin URL accepts your login.
✓ In business since 2005✓ INR + GST billing✓ 24/7 Email Support — avg reply < 60 min
Indian freelancer's desk with a laptop showing a website, potted plant and coffee in warm window light — how to install magento in cpanel

What Magento 2 needs before cPanel can run it

Magento 2.4 needs PHP 8.2 or 8.3, MySQL 8.0 or MariaDB 10.6, Composer 2 and a search engine such as OpenSearch 2.x. A cPanel account missing any of those fails before the installer reaches the first screen.

RequirementWhat to setWhere in cPanel
PHP8.2 or 8.3, matching the Magento patchMultiPHP Manager
Extensionsintl, soap, bcmath, gd, sodium, xsl, zipSelect PHP Version, then Extensions
DatabaseMySQL 8.0 or MariaDB 10.6, one schema, one userMySQL Databases
SearchOpenSearch 2.x, or Elasticsearch 8.x on 2.4.6 and laterNot in cPanel; needs the server
Composerversion 2.x on the accountTerminal, or the host enables it
PHP memory2G for command-line workMultiPHP INI Editor

The search engine is the requirement people miss. Magento has no built-in catalogue search since 2.4, so setup:install refuses to finish until it can reach OpenSearch or Elasticsearch on a host and port.

Choose between Softaculous and Composer

Softaculous installs Magento in a few clicks, and it is fine when the version it offers is current. Open the version dropdown and read it before clicking install; a 2.3.x entry is end of life and will not get security patches.

Composer is the route Adobe documents and the only one that fetches the current patch. It also leaves you with the command line you need for every later upgrade, which Softaculous hides behind its own update screen.

Set PHP, extensions and the database in cPanel

  1. Open Software, then MultiPHP Manager. Tick the domain, choose PHP 8.3 or 8.2, and apply. The account default is not enough if the domain overrides it.
  2. Open Software, then Select PHP Version, then Extensions. Enable intl, soap, bcmath, gd, sodium, xsl and zip.
  3. Open Databases, then MySQL Databases. Create the database, create a user, then add the user to the database with All Privileges.
  4. Write down the full names. cPanel prefixes both, so the database is cpuser_magento, not magento.
  5. Open Software, then MultiPHP INI Editor. Set memory_limit to 2G for the domain; the CLI reads a separate php.ini.

Install Magento from the cPanel terminal

Composer asks for Marketplace credentials. Create them in your Adobe Commerce Marketplace account under Access Keys: the public key is the username and the private key is the password.

  1. cd ~/public_html — or the folder behind the subdomain you will use.
  2. composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition store — downloads the current Open Source release into store.
  3. Paste the public key as the username and the private key as the password when Composer asks.
  4. cd store && bin/magento setup:install --base-url=https://shop.example.com/ --db-host=localhost --db-name=cpuser_magento --db-user=cpuser_mage --db-password=YOURPASS --admin-user=owner --admin-password=YOURPASS --admin-email=you@example.com --search-engine=opensearch --opensearch-host=127.0.0.1 --opensearch-port=9200
  5. Add the cron job in Advanced, then Cron Jobs: * * * * * /usr/local/bin/php /home/cpuser/public_html/store/bin/magento cron:run

The install prints an admin path such as /admin_9f2k1. Save it, because it is random and the login page does not exist at /admin.

Point the domain at the pub folder

Magento serves from pub/. If the document root stays at the install folder, static files return 404, the storefront can throw a 500, and app/etc/env.php becomes reachable over HTTP.

  1. Open Domains, then Create A New Domain, and set the document root to public_html/store/pub.
  2. If the domain is the primary one, ask the host to change its document root. Do not move index.php by hand.
  3. Run bin/magento setup:static-content:deploy -f, then bin/magento cache:flush.

Verify the storefront, the admin and cron

You know it worked when the storefront shows the default Luma theme with its product grid, and the admin path from the installer opens a login that accepts the admin user.

  1. Load https://shop.example.com/. A 500 here is the docroot or a missing extension, not the database.
  2. Load the admin URL and sign in. A blank page after login means the static deploy did not run.
  3. bin/magento --version — prints the same version the installer reported.
  4. Open Advanced, then Cron Jobs, and confirm the job last ran. Magento writes its cron output to var/log/magento.cron.log.

Fix the failures that stop a cPanel install

Five messages cover most broken installs, and each has one check before you reinstall anything.

MessageCauseFix
500 on every page right after installdocument root is the install folderSet it to .../store/pub and reload
Magento supports PHP 8.x onlyaccount PHP differs from the release branchMultiPHP Manager, pick 8.3, apply, rerun setup:install
SQLSTATE[HY000] [1045] Access denieduser not attached, or prefix dropped from the nameAttach in MySQL Databases and use cpuser_dbname
Could not validate a connection to OpenSearchservice down or wrong portcurl http://127.0.0.1:9200 should return JSON
Process killed during static deploymemory_limit below 2GRaise it in MultiPHP INI Editor and the CLI php.ini

How much hosting Magento actually needs

A working Magento 2 store is not a shared-hosting workload. Plan on 2 vCPU, 4 GB RAM and 20 GB of disk once OpenSearch, MySQL and PHP-FPM share the machine. A large catalogue or several store views pushes that to 8 GB.

WebJi Magento hosting and cPanel hosting are quoted by email before payment, because the plan follows the catalogue and the search index rather than a fixed tier. Magento Open Source itself carries no licence fee.

When to email WebJi about a Magento install

Email support@webji.services with the setup:install output, the PHP version from MultiPHP Manager, and the newest cPanel error line. Support is 24/7 by email in Hindi and English, with an average first reply under 60 minutes. The office phone is not a support line.

Frequently Asked Questions

Can I install Magento on cPanel shared hosting?

Magento 2.4 will install, but a 1 GB shared account usually fails setup:static-content:deploy or stalls once the search engine is added. Treat 2 vCPU and 4 GB RAM as the practical floor for a live store.

What PHP version does Magento 2.4 need?

PHP 8.2 or 8.3 for the 2.4.7 branch, set per domain in MultiPHP Manager. The supported pair changes with each patch, so match the branch listed for the version you install.

Is Softaculous safe for Magento?

It works, but read the version field first. If Softaculous offers 2.3.x, skip it and use Composer, because 2.3 is end of life and no longer receives security patches.

Why does Magento show a 500 error after install?

The document root is the usual cause. Magento must serve from the pub folder; pointing the domain at the install root breaks static files and can expose app/etc/env.php.

Do I need Elasticsearch or OpenSearch for Magento?

Yes. Magento 2.4 requires a search engine. OpenSearch 2.x is the common choice on a cPanel VPS, and setup:install needs its host and port before it will finish.

Need help with this?

WebJi® support does it for you — free. Talk to our Jaipur team →