How to Set Up Laravel on cPanel Hosting

Laravel is one of the most popular PHP frameworks, and it runs great on dotCanada's cPanel hosting. Here's how to get a Laravel application up and running on your account.

Step 1: Upload or Clone Your Project

Upload your Laravel project files to your server (e.g., /home/username/laravel-app) using FTP, the cPanel File Manager, or Git. The project should sit outside your public_html directory.

Step 2: Install Dependencies with Composer

Connect via SSH and navigate to your project:

cd ~/laravel-app && composer install --no-dev

Step 3: Configure the .env File

Copy the example environment file and configure your settings:

cp .env.example .env && php artisan key:generate

Edit .env to set your database credentials, app URL, and any other required values.

Step 4: Set the Document Root to /public

Laravel's web-accessible files live in the /public subdirectory. To point your domain to it:

  1. In cPanel, go to Domains.
  2. Find your domain and click Manage.
  3. Change the Document Root to /home/username/laravel-app/public.
  4. Save the change.

Step 5: Set Permissions

Make sure Laravel's storage and cache directories are writable:

chmod -R 775 storage bootstrap/cache

Final Checks

  • Confirm your PHP version supports your Laravel version via cPanel's MultiPHP Manager.
  • Check storage/logs/laravel.log if anything isn't working.

If you hit a snag during your Laravel setup, contact our support team and we'll help you get it running.

100% Satisfaction Guarantee

We're so confident you'll love dotCanada that we offer a 30-day money-back guarantee. Not satisfied? Get a full refund, no questions asked.

Ready to Get Started?

Join thousands of Canadian website owners who trust dotCanada for reliable, fast web hosting.

Get Started Today