Skip to content

Installing DigitalCourse on cPanel Shared Hosting — Step by Step

  • by

This guide explains how to install DigitalCourse on cPanel shared hosting without requiring root access to the server.

Prerequisites

Before installing DigitalCourse, make sure you have:

  • cPanel hosting with PHP 8.1 or newer
  • MySQL database access
  • File Manager or FTP access
  • Composer available through SSH/cPanel Terminal or on your local computer

Step 1 — Prepare DigitalCourse Locally

On your local computer, open the DigitalCourse project directory:

cd digitalcourse

Create the environment file:

cp .env.example .env

Install the DigitalCourse production dependencies:

composer install --no-dev --optimize-autoloader

Generate the application key:

php artisan key:generate

Edit .env and configure the DigitalCourse production database settings and other required services:

DB_CONNECTION=mysql
DB_DATABASE=youraccount_dc
DB_USERNAME=youraccount_dcuser
DB_PASSWORD=strongpassword

Step 2 — Create the DigitalCourse MySQL Database in cPanel

Log in to cPanel and open:

MySQL Databases

Create a database for DigitalCourse, for example:

youraccount_dc

Create a database user:

youraccount_dcuser

Set a strong password.

Add the user to the DigitalCourse database and select:

All Privileges

Keep these credentials available for the DigitalCourse .env configuration.

Step 3 — Upload DigitalCourse

Compress the DigitalCourse project and exclude unnecessary development files such as:

node_modules

Upload the project through cPanel File Manager or FTP.

For a standard Laravel deployment, keep the DigitalCourse application files outside the public web directory.

A recommended structure is:

/home/youraccount/
    digitalcourse/
        app/
        bootstrap/
        config/
        routes/
        storage/
        vendor/
        ...
    public_html/
        index.php
        .htaccess
        css/
        js/
        ...

Copy the contents of the DigitalCourse public directory into public_html.

Step 4 — Update DigitalCourse index.php

Because the main DigitalCourse application files are stored outside public_html, update public_html/index.php:

require __DIR__.'/../digitalcourse/vendor/autoload.php';
$app = require_once __DIR__.'/../digitalcourse/bootstrap/app.php';

Make sure these paths match the actual location of your DigitalCourse installation.

Step 5 — Run DigitalCourse Migrations

If your hosting provider provides SSH or cPanel Terminal, navigate to the DigitalCourse application:

cd /home/youraccount/digitalcourse

Run the database migrations and seed the initial DigitalCourse data:

php artisan migrate --seed --force

Create the DigitalCourse storage link:

php artisan storage:link

Cache the configuration:

php artisan config:cache

Cache the routes:

php artisan route:cache

Do not expose DigitalCourse migrations or administrative commands through a temporary public web route.

Step 6 — Set the PHP Version for DigitalCourse

In cPanel, open:

MultiPHP Manager

Select your DigitalCourse domain and choose a PHP version supported by your DigitalCourse release, such as PHP 8.1 or 8.2.

Make sure the PHP extensions required by DigitalCourse are enabled.

Step 7 — Configure .htaccess for DigitalCourse

Place the following .htaccess file inside public_html:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f

    RewriteRule ^ index.php [L]
</IfModule>

This allows DigitalCourse Laravel routes to be handled through index.php.

Step 8 — Set DigitalCourse Storage Permissions

Using cPanel File Manager, make sure these DigitalCourse directories are writable:

digitalcourse/storage/
digitalcourse/bootstrap/cache/

Set the required permissions, such as:

775

Use the permissions supported by your hosting environment and avoid granting unnecessary write access.

Step 9 — Configure Email for DigitalCourse

Open the DigitalCourse .env file and configure your cPanel SMTP credentials:

MAIL_MAILER=smtp
MAIL_HOST=mail.yourdomain.com
MAIL_PORT=465
MAIL_USERNAME=no-reply@yourdomain.com
MAIL_PASSWORD=yourpassword
MAIL_ENCRYPTION=ssl

Use the SMTP credentials supplied by your hosting provider.

Step 10 — Verify the DigitalCourse Installation

Open your DigitalCourse domain:

https://yourdomain.com

Verify that the DigitalCourse homepage loads correctly.

Test the DigitalCourse login page:

https://yourdomain.com/login

Use the default seeded credentials provided in USER_ACCESS.md or your DigitalCourse documentation.