Skip to content
Cloudzyro

Laravel hosting with cPanel, SSH and PHP 8.4

Run your Laravel app on Web Hosting, our cPanel hosting with email included. Use SSH for Composer and Artisan, and choose PHP 8.4. We tested Laravel 13, and the steps below are exactly what worked.

Last updated

Runs on
Web Hosting, our cPanel hosting with SSH in a walled-off space of your own.
Versions
PHP 8.3 or 8.4 for Laravel 13. New sites start on 8.2, so choose the version in cPanel's MultiPHP Manager.
You get
SSH, Composer, Git and Artisan on the server, with MySQL databases or SQLite.

Over SSH

ea-php84 ~/bin/composer create-project laravel/laravel laravel
cd laravel && ea-php84 artisan migrate

Why host Laravel on Cloudzyro

  • SSH, Composer and Artisan

    Run Composer, Artisan and Git on the server, in a walled-off space of your own that no other customer can see.

  • PHP 8.4 when you want it

    Choose PHP 8.3 or 8.4 for your domain in cPanel. Other sites on the same plan can stay on older versions.

  • Your code stays private

    Your app and its .env sit outside the web folder, so only Laravel's public folder can be reached from the web.

  • MySQL and email included

    Create MySQL databases in cPanel and manage them with phpMyAdmin, with email accounts on your own domain on every plan.

Put your Laravel app online

Tested on Web Hosting. These are the steps that worked.

  1. 1In cPanel, open SSH Access and add your public key, or sign in with your cPanel password. Connect with ssh, using your cPanel username and the server address on your hosting's page in the console.
  2. 2Install Composer in your home folder: mkdir -p ~/bin && cd ~/bin, then php -r "copy('https://getcomposer.org/installer', 'installer.php');" && php installer.php --filename=composer && rm installer.php.
  3. 3The php command on the server is PHP 8.2, so run Laravel's commands with ea-php84 (or ea-php83). Create your app with ea-php84 ~/bin/composer create-project laravel/laravel laravel, or git clone your repository and run ea-php84 ~/bin/composer install --no-dev.
  4. 4In your app's .env, set APP_ENV=production, APP_DEBUG=false, APP_URL and your database. For MySQL, create the database and user in cPanel first. Then run ea-php84 artisan migrate --force.
  5. 5Point your site at Laravel's public folder: mv ~/public_html ~/public_html.old, then ln -s ~/laravel/public ~/public_html. Your app's code and .env stay outside the web folder.
  6. 6Open MultiPHP Manager in cPanel and choose PHP 8.4 (or 8.3) for your domain. Do this after the step above, because cPanel saves the choice in your public folder's .htaccess.

How Laravel runs on Web Hosting

Laravel runs on Web Hosting, our cPanel hosting, not on Sites & Apps. You get SSH in a walled-off space of your own, so Composer, Artisan and Git work on the server just as they do on your computer.

Laravel 13 needs PHP 8.3 or newer. The php command on the server is 8.2, so you run Laravel's commands with ea-php84 (or ea-php83) and choose the same version for your domain in MultiPHP Manager. The steps above are exactly what we ran to test it.

Your app lives in a folder in your home directory, and public_html points at its public folder. So your code, .env and storage can't be reached from the web. Unlike Sites & Apps, Web Hosting keeps your files between deploys, so storage and a SQLite database stay put.

After your first deploy

Cache your configuration, routes and views for speed, and link the public storage folder if your app serves uploaded files:

Over SSH

cd ~/laravel
ea-php84 artisan storage:link
ea-php84 artisan optimize

To release a new version from Git, pull it, install packages, run migrations and cache again:

Over SSH

cd ~/laravel
git pull
ea-php84 ~/bin/composer install --no-dev
ea-php84 artisan migrate --force
ea-php84 artisan optimize

Run ea-php84 artisan optimize again whenever you change .env, because cached configuration doesn't read it.

Databases and email

For MySQL, create the database and its user in cPanel and add the user to the database. cPanel puts your username in front of both names. In .env, set DB_CONNECTION=mysql, DB_HOST=localhost and those names. Or keep Laravel's default SQLite database, which stays on your hosting between releases.

To send mail from your app, create an email account on your domain in cPanel and point Laravel's mail settings at falcon.cloudzyro.com on port 465 with SSL, signing in with the full address and its password. See Set up email.

Common Laravel problems and fixes

The usual causes, and what to do about them. Still stuck? Use Get help in the console, or email support@cloudzyro.com.

Artisan or Composer says it needs a newer PHP version.
The php command is 8.2. Run ea-php84 artisan and ea-php84 ~/bin/composer instead, and choose PHP 8.4 for your domain in MultiPHP Manager.
No application encryption key has been specified.
A cloned app has no key yet. Copy .env.example to .env if you haven't, then run ea-php84 artisan key:generate.
The site went back to an older PHP version.
cPanel keeps the version in your public folder's .htaccess. Choose PHP 8.4 in MultiPHP Manager again after linking public_html to Laravel's public folder.
Server error on every page.
With APP_DEBUG=false the details are in storage/logs/laravel.log. Missing .env values and a database that isn't set up yet are the usual causes.
The scheduler never runs.
Cron needs full paths: cd ~/laravel && /usr/local/bin/ea-php84 artisan schedule:run, every minute.

What Laravel hosting costs

Lite is $6.99 a month, or $39.99 a year ($3.33 a month), for up to 30 websites, 30 GB of NVMe storage and 30 email accounts, plus tax. Growth and Max add more websites, storage and email. Every plan includes SSH, MySQL, email and 30 days of backups, with a 30-day money-back guarantee on the hosting. See Web Hosting.

Questions about Laravel hosting

Why does Artisan say it needs a newer PHP version?
The php command on the server is PHP 8.2. Run ea-php84 artisan (or ea-php83) instead, and choose the same version for your domain in MultiPHP Manager.
Can I deploy without SSH?
Yes. Run composer install on your computer, put your app in a laravel folder and the contents of public in public_html, change the two paths in public_html/index.php to ../laravel/, then upload a zip with File Manager and extract it. Choose your PHP version after extracting.
Can I run Laravel's scheduler?
Yes. In cPanel's Cron Jobs, add a job that runs every minute: cd ~/laravel && /usr/local/bin/ea-php84 artisan schedule:run (cron needs the full path).
Which Laravel versions work?
We tested Laravel 13 on PHP 8.4. An older Laravel app can use the PHP version it needs, from 7.4 to 8.4, chosen the same way.
Can I host Laravel on Sites & Apps?
No. Sites & Apps doesn't run PHP. Laravel runs on Web Hosting.
How much is it?
From $3.33 a month on a yearly plan ($39.99 a year), or $6.99 paid monthly, plus tax. Yearly plans include a domain free for the first year.

Host your Laravel site with email included

cPanel hosting from $3.33 a month on a yearly plan, with a domain free for the first year.