While it's possible to install Laravel automatically, you might want a version that is not on the list. Keep in mind that it's always recommended to have the current stable version installed to avoid any security threats or bugs.
If you still choose Laravel 8, you should proceed with a manual installation:
Step 1 - Preparations
Before starting, you will need to activate your hosting plan and add a domain on which you want to have Laravel.
Step 2 - Upload and Move the Files
Using any suitable option, upload your Laravel website's files to the website's files, 1 level above public_html. If your project is named laravel, your file structure will look like this:
After this, open laravel/ folder and move all files from it to public_html:
Step 3 - Create .htaccess File
Create the .htaccess file and add the following rule so that Laravel loads content correctly:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
If your website uses databases/models, you will see a Laravel Database connection error. We'll fix it in the next step.
Step 4 - Update Database Information
If Models are running on your application, you will have to migrate tables to the database. You have two alternatives:
MySQL
To use MySQL, start by creating a new database. Next, open the .env file and update your database information. It should look like this:
SQLITE
If you want to use SQLITE, go to the File Manager, navigate to database/, and create the database.sqlite file. Next, open the .env file and update your database information. Just copy the path to your root directory and change public_html to database/database.sqlite. It should look like this:
Migrate the Tables
Once you have created the database with either method, connect to your account via SSH, navigate to your laravel directory, and enter the following command to migrate all the files to a database:
php artisan migrate
That's it. Your Laravel 8 website should work now 😊
NOTE
To set up an artisan cronjob for scheduling actions of your application, create a custom cronjob using this code template:
/usr/bin/php /home/u12345678/domains/domain.tld/public_html/artisan schedule:run
Replacing u12345678 and domain.tld with your data.
Additional Resources