21+ years in hosting · Jaipur, India · INR billing with 18% GST · 24/7 email support
Blog · WebJi® India

How to Install Laravel on cPanel

Quick answer

To install Laravel on cPanel, set the domain to PHP 8.2+ for Laravel 12 or 8.3+ for Laravel 13, run composer create-project laravel/laravel in Terminal outside public_html, and point a subdomain's document root at the project's public folder. Add database keys to .env, then run php artisan key:generate and migrate.

For developers deploying a Laravel app on a shared cPanel account, including what to do when shared hosting runs out of road.

✓ In business since 2005
✓ INR + GST billing
✓ 24/7 Email Support — avg reply < 60 min
GuideWebJi®
knowledge
Read time
6 min
Sections
8
Updated
14 Nov 2026
Written by
WebJi® team

What Laravel needs before the first Composer command

Laravel 12 needs PHP 8.2 or newer, Laravel 13 needs PHP 8.3 or newer, and both need Composer 2. Laravel 11 stopped receiving security fixes on 12 March 2026, so start new projects on 12 or 13. On a cPanel account both are reachable from the panel: PHP from MultiPHP Manager, Composer from Terminal. Check the five items below before you type anything, because a missing one is what most failed installs turn out to be.

What Laravel needs before the first Composer command
RequirementWhere to check in cPanelWhat to do if it is missing
PHP 8.2+ (Laravel 12) or 8.3+ (Laravel 13)Software, then MultiPHP ManagerSet the domain to a matching handler. Neither version installs on PHP 8.1.
Composer 2Advanced, then Terminal: composer --versionInstall composer.phar in your home directory, as in installing Composer on shared hosting, and call it with php composer.phar.
MySQL or MariaDB databaseDatabases, then MySQL DatabasesCreate the database and a user, then add the user to it with All Privileges.
A domain or subdomain you can aimDomains, then Create A New DomainUse a subdomain. A shared account cannot move the main domain's document root.
Terminal accessAdvanced, then TerminalIf the icon is absent, your plan has no shell. Build locally and upload vendor/ and public/.

Two habits save an afternoon. Run every command as the cPanel user, never as root, and keep the project outside public_html so only the public folder is reachable over HTTP. A cPanel hosting account with Terminal access covers all five rows.

How to create a Laravel project with Composer in cPanel Terminal

The project is created with one Composer command inside your home directory, not inside public_html. Open Terminal from the Advanced section of cPanel and work through these steps in order.

  1. Run cd ~ so you are in your home directory, then confirm the PHP binary with php -v. It should report 8.2 or higher.
  2. Run composer create-project laravel/laravel myapp. Composer downloads the skeleton and its dependencies; expect two to four minutes on a shared account.
  3. Run cd myapp and then php artisan --version. You know the create step worked when it prints a Laravel Framework version such as 12.x.
  4. Run php artisan about. It lists the PHP version, cache driver, and environment Laravel is actually using, which is the quickest way to catch a wrong PHP handler.

If Composer stops with a message that ext-fileinfo is missing from your system, the PHP build selected for that domain is short of an extension. Switch the domain to another 8.2+ handler in MultiPHP Manager and rerun the create command. If Composer runs out of memory, run Composer through PHP with a one-off limit, php -d memory_limit=512M "$(command -v composer)" create-project laravel/laravel myapp, instead of raising the account limit for every script.

How to point a cPanel domain at Laravel's public folder

Laravel must be served from its public directory. Everything above that folder holds .env, logs, and source code, and none of it should be reachable by a browser. How you arrange that depends on which domain you use.

Aim a domain at Laravel's public folder
Domain typeWhere the Laravel folder sitsDocument root to set
Subdomain (recommended)/home/your-username/myapp/home/your-username/myapp/public
Addon domain/home/your-username/myapp/home/your-username/myapp/public
Main domain on shared hosting/home/your-username/myappOften fixed at public_html on shared plans

For a subdomain, open Domains, then Create A New Domain, enter app.example.com, untick the share-document-root box, and type the public path as the document root. For the main domain, copy the contents of public into public_html, then open public_html/index.php in File Manager and point its two require lines at the folder above, so they read ../myapp/vendor/autoload.php and ../myapp/bootstrap/app.php.

The check is simple: load the domain. You should see the Laravel welcome page, not a directory listing and not a 403. A listing means the document root is still the project folder; a 403 usually means an index file is missing from the folder you aimed at.

How to connect MySQL and finish Laravel's .env file

The database is created in cPanel and described in .env; Laravel does not create it for you. In MySQL Databases, create a database, create a user with a strong password, and add the user to that database with All Privileges. Then edit .env in File Manager and set four values.

  • DB_DATABASE, DB_USERNAME, DB_PASSWORD from the screen you just used. cPanel prefixes both names with your account name, so copy them exactly.
  • APP_URL set to the full https address you will serve, for example https://app.example.com.
  • APP_ENV=production and APP_DEBUG=false before the site takes real traffic.

Back in Terminal, run php artisan key:generate to write APP_KEY, then php artisan migrate --force to create the tables. You know the database link works when migrate reports each migration as DONE and php artisan migrate:status lists them as Ran. When you change .env later, run php artisan config:clear, because cached configuration keeps the old values.

Which file permissions does Laravel need on cPanel?

Laravel writes to two folders at runtime: storage and bootstrap/cache. Set folders to 755 and files to 644, and use 775 on those two folders only if the panel runs PHP through a handler that needs group write. Never use 777, and never leave index.php group-writable.

The failure this prevents has a specific log line: SoftException in Application.cpp: File .../public/index.php is writeable by group. That is a 500 caused by permissions alone. Fix it with chmod 644 public/index.php and chmod -R 755 public, then reload. If uploads or cache writes still fail, widen storage to 775 and test the feature that writes, not just the home page.

How to fix a blank page, 500 or Vite manifest error in Laravel on cPanel

Most first-deploy failures on cPanel fall into five shapes. Match the symptom, make one change, and reload the page before trying the next row.

Blank page, 500 error, or Vite manifest error
SymptomUsual causeFix
500 with SoftException in the logindex.php or a folder is group-writablechmod 644 on files, 755 on folders, then reload
Blank white page, nothing in the logvendor/ missing or APP_DEBUG hiding the errorRead storage/logs/laravel.log, run composer install, set APP_DEBUG=true while testing
Vite manifest not found at public/build/manifest.jsonFront-end assets were never builtRun npm run build on your machine and upload the public/build folder
403 on every routeDocument root is the project folder, not publicRepoint the document root or fix the index.php paths
No application encryption key has been specifiedAPP_KEY is emptyRun php artisan key:generate in the project folder

One more thing to check before you blame the code: the PHP version that Terminal uses and the one Apache uses can differ. php -v in Terminal proves the command-line handler; MultiPHP Manager sets the web handler. If artisan runs cleanly while the browser throws errors, that mismatch is the first suspect.

What shared cPanel will not do for a Laravel app

Shared hosting runs your app on request, then stops it. That suits CRUD tools, dashboards, and brochure sites. It does not suit anything that must stay resident: queue workers under Supervisor, Laravel Horizon, websocket servers, or long scheduled jobs all need a process that outlives the request.

The workaround on shared is cron, set up as in the crontab examples guide. Schedule php /home/your-username/myapp/artisan queue:work --stop-when-empty --max-time=50 once a minute, which drains the queue without overlapping runs. When queue depth, concurrent users, or an always-on worker become the normal load, move the same codebase to a VPS server with root access; WebJi quotes VPS and dedicated configurations by email at support@webji.services before you pay.

Which WebJi® cPanel plan suits a Laravel project?

For a Laravel app on shared cPanel, choose the plan with the highest process limits, Webji Scale, at ₹699 a month or ₹6,588 a year before 18% GST in WebJi®’s published pricing; checkout confirms the final amount. WebJi® cPanel accounts list PHP 8.1, 8.2 and 8.3 in MultiPHP Manager, which covers Laravel 12 and 13. Ask support to confirm Terminal access on your plan before you order, and every invoice carries WebJi®’s GSTIN.

Email support@webji.services with the Laravel version, the PHP version, and the exact error if an install stalls. Support is 24/7 by email in Hindi and English with an average first reply under 60 minutes. Plan details sit on the cPanel hosting page and the full list with billing cycles is on WebJi pricing.

Sources: Laravel release notes and support policy (laravel.com/docs/master/releases); Laravel deployment documentation on serving from the public directory and optimising configuration.

FAQ

Frequently asked questions

Can I install Laravel on cPanel shared hosting?

Yes. Create the project with Composer in cPanel Terminal, aim a subdomain's document root at the project's public folder, fill in the database values in .env, and run php artisan migrate. The limits are process-based: no resident queue workers, no websocket server, and no root access.

How do I point the document root to Laravel's public folder in cPanel?

Open Domains, then Create A New Domain, and set the document root to /home/your-username/myapp/public. For the main domain on a shared account the root is fixed at public_html, so copy the contents of public into public_html and edit the two require lines in index.php to point at ../myapp.

Do I need SSH, or is cPanel Terminal enough?

Terminal is enough for Composer, artisan, and chmod, because it runs as your cPanel user. SSH is only needed for extras such as Git deploy hooks or rsync, and not every shared plan enables it. If the Terminal icon is missing from Advanced, your plan has no shell access.

Why does my Laravel site show a 500 error on cPanel?

Read the newest line under Metrics, then Errors. The most common cPanel-specific cause is a group-writable index.php under a suPHP-style handler, which is fixed with chmod 644. Storage permissions, a missing vendor folder, and an empty APP_KEY cover most of the rest.

How do I fix Vite manifest not found on cPanel?

The message means public/build/manifest.json is missing, so Laravel cannot resolve the compiled CSS and JavaScript. Run npm install and npm run build on your own machine, then upload the generated public/build folder. Shared hosting rarely has Node available, so building on the server is not the intended path.

Does Laravel 12 or 13 run on PHP 8.1?

No. Laravel 12 supports PHP 8.2 to 8.5 and Laravel 13 supports 8.3 to 8.5, so Composer refuses to install either on 8.1. Set the domain to a matching handler in MultiPHP Manager before you create the project, and check the same version with php -v in Terminal.

Last editorial update: 14 November 2026. Prices follow the dated sources on this page; checkout confirms current charges.

WebJi® since 2005

Ready to get started with WebJi®?

Join 12,000+ businesses across India and overseas. INR pricing, 18% GST shown before payment and 24/7 email support in Hindi and English — average first reply under 60 minutes.