Laravel Framework

How to Install Laravel on DomainIndia.com cPanel Hosting and Create Your First Program

By the Domain India teamPublished 6 min read
Knowledge base article
Contents (5 sections)

You can install Laravel on Domain India cPanel hosting in a few clicks with Softaculous, or build the project on your own computer and upload it. Once it is running, your first program is three small files: a controller, a route and a view. This page gives the short version of the install and walks you through that first page.

For the full install guide, see our Laravel canonical

Every install route, the document root, the .env file, permissions, the scheduler and email are covered in how to install Laravel on shared hosting: Softaculous or upload. For what works in production and when to move to a VPS, read Laravel on cPanel and DirectAdmin.

Key takeaways

Install Laravel with Softaculous in cPanel, or build it on your computer with Composer, including the vendor folder, and upload it with File Manager. Composer isn't pre-installed on our shared servers; with jailed SSH (on request) you can download composer.phar and run php composer.phar install, adding --no-scripts if it stops with a proc_open message. Make sure your domain serves Laravel's public folder. Then add a controller, a route in routes/web.php and a Blade view, and open yourdomain.com/myfirst to see your first page.

1. Install Laravel: the two routes that work

RouteBest forShell needed?
Softaculous in cPanelBeginners, a quick testNo
Build on your computer, then uploadYour own project, productionNo

Softaculous: in cPanel, open Softaculous Apps Installer, search for Laravel, click Install, choose https:// and your domain, and install. Softaculous creates the database and .env for you. It may offer an older Laravel release than the newest one.

Build and upload: on your computer, run composer create-project laravel/laravel laravel-app (or composer install --no-dev --optimize-autoloader for an existing project), zip the folder with vendor/, upload it to your home folder outside public_html with File Manager, and extract it. Then point your domain at the public folder and create .env, as shown step by step in the full install guide.

Composer on shared hosting

Composer isn't pre-installed, and its scripts need PHP functions such as proc_open, which are disabled on our shared servers. Over jailed SSH you can download composer.phar and run php composer.phar install; if it stops with a proc_open message, run it again with --no-scripts, then php artisan package:discover. Or build on your computer or in CI and upload the project with its vendor folder. See PHP disabled functions on shared hosting.

Choose a current PHP 8.x version for the domain in your control panel before you start; the Laravel release you install lists the minimum it needs.

2. Create your first program

You can create the three files by hand in File Manager, or with Laravel's artisan commands over SSH. Jailed SSH is available on every shared hosting plan; it is off by default, so ask support to enable it. See enabling and accessing jailed SSH.

  1. Create the controller.
    Over SSH, in your project folder, run php artisan make:controller MyFirstController. Without SSH, create app/Http/Controllers/MyFirstController.php in File Manager and paste the code below.
  2. Add an action to the controller.
    It returns a view called myfirstview.
  3. Add a route.
    Open routes/web.php and map the address /myfirst to the controller.
  4. Create the view.
    In resources/views, create myfirstview.blade.php with your page content.
  5. Open the page.
    Visit https://yourdomain.com/myfirst. You should see your welcome message.

The controller, app/Http/Controllers/MyFirstController.php:

php
<?php

namespace App\Http\Controllers;

class MyFirstController extends Controller
{
    public function index()
    {
        return view('myfirstview', ['name' => 'Domain India']);
    }
}

The route, added at the end of routes/web.php:

php
use App\Http\Controllers\MyFirstController;

Route::get('/myfirst', [MyFirstController::class, 'index']);

Put the use line with the other use lines at the top of the file.

The view, resources/views/myfirstview.blade.php:

html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>My First Laravel Program</title>
</head>
<body>
    <h1>Welcome to my first Laravel program!</h1>
    <p>Served by {{ $name }}.</p>
</body>
</html>

The {{ $name }} tag prints the value the controller passed, safely escaped. That is the whole Laravel pattern: a route calls a controller, and the controller returns a view with data.

3. If the page does not appear

  • 404 Not Found: the domain may not be serving Laravel's public folder, or the route is missing. Check routes/web.php, and see the document root section of the full install guide.
  • 500 error or a blank page: read storage/logs/laravel.log in File Manager. Common causes are missing write permissions on storage and bootstrap/cache, or a typing mistake in the controller. See troubleshooting 500 errors.
  • Old content after a change: if you ran php artisan optimize earlier, run php artisan optimize:clear so Laravel reads your new route.

Never leave APP_DEBUG=true on a live site: it shows your configuration to anyone who triggers an error.

4. Where Domain India fits

A standard Laravel app with Blade, MySQL and a cron-driven scheduler runs on Domain India cPanel, DirectAdmin and Webuzo hosting. Queue workers, Horizon, Octane, Reverb and Redis need long-running processes, which shared hosting stops; use a VPS for those.

cPanel Starter
₹125/mo + GST
  • 25 GB NVMe SSD Storage
  • 50 GB Monthly Bandwidth
  • 1 Website
  • 10 Email Accounts
See plan details

The plan card shows the Domain India list price, excluding 18% GST.

Frequently asked questions

Can I install Laravel on Domain India cPanel hosting?

Yes. Use Softaculous in cPanel for a one-click install, or build the project on your computer with Composer, including the vendor folder, and upload it with File Manager.

Can I run composer install on the server?

Yes, over jailed SSH (on request). Composer isn't pre-installed, so download composer.phar and run php composer.phar install; if it stops with a proc_open message, run it again with --no-scripts, then run php artisan package:discover. Or run Composer on your computer or in CI and upload the project with its vendor folder.

Do I need SSH to create my first Laravel page?

No. You can create the controller, route and view files in File Manager. SSH makes it quicker with php artisan make:controller. Jailed SSH is available on every shared plan on request; ask support to enable it.

Why do I get a 404 when I open /myfirst?

Either the route is missing from routes/web.php, or the domain is not serving Laravel's public folder. Check both, and clear cached routes with php artisan optimize:clear if you cached them before.

Can I run Laravel queues or Horizon on shared hosting?

Not as permanent workers. Shared hosting stops long-running processes. Use the sync or database queue with cron for light jobs, or move to a VPS for real queue workers, Horizon or Redis.

Ready to build? Follow the full Laravel install guide, compare cPanel hosting plans, or move up to a VPS when your app needs queue workers.

Host your Laravel app

Softaculous, MySQL, cron jobs, a choice of PHP versions and free SSL for your Laravel project.

See cPanel hosting plans

Was this article helpful?

Your answer helps us decide what to improve next.

Still need help? Open a support ticket and our team will reply.

Prefer an app? Add this site to your home screen.Get the app