{"id":956,"date":"2022-04-19T13:51:02","date_gmt":"2022-04-19T13:51:02","guid":{"rendered":"https:\/\/blog.hostinger.io\/support\/2022\/04\/19\/6152127-how-to-deploy-laravel-8-at-hostinger\/"},"modified":"2026-07-24T10:06:20","modified_gmt":"2026-07-24T10:06:20","slug":"6152127-how-to-deploy-laravel-8-at-hostinger","status":"publish","type":"post","link":"https:\/\/www.hostinger.com\/support\/6152127-how-to-deploy-laravel-8-at-hostinger\/","title":{"rendered":"How to deploy Laravel 8 at Hostinger"},"content":{"rendered":"

While it’s possible to install Laravel automatically<\/a><\/b>, 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<\/a><\/b> installed to avoid any security threats or bugs.<\/p>

If you still choose Laravel 8, you should proceed with a manual installation:<\/p>

Step 1 – Preparations<\/h2>

Before starting, you will need to activate your hosting plan<\/a> <\/b>and add a domain<\/a><\/b> on which you want to have Laravel.<\/p>

Step 2 – Upload and move the files<\/h2>

Using any suitable option, upload your Laravel website’s files<\/a><\/b> to the website’s files, 1 level above public_html<\/b>. If your project is named laravel<\/b>, your file structure will look like this:<\/p>

\"The<\/div>

After this, open laravel\/<\/b> folder and move all files from it to public_html<\/b>:<\/p>

\"The<\/div>

Step 3 – Create .htaccess file<\/h2>

Create the .htaccess<\/b> file<\/a> and add the following rule so that Laravel loads content correctly:<\/p>

<IfModule mod_rewrite.c>\r\n  RewriteEngine On\r\n  RewriteRule ^(.*)$ public\/$1 [L]\r\n<\/IfModule><\/code><\/pre>

If your website uses databases\/models, you will see a Laravel Database connection error. We’ll fix it in the next step.<\/p>

Step 4 – Update Database Information<\/h2>

If Models are running on your application, you will have to migrate tables to the database. You have two alternatives:<\/p>

MySQL<\/h3>

To use MySQL, start by creating a new database<\/a><\/b>. Next, open the .env<\/b> file and update your database information. It should look like this:<\/p>

\".env<\/div>

SQLITE<\/h3>

If you want to use SQLITE, go to the File Manager, navigate to database\/<\/b>, and create the database.sqlite<\/b> file. Next, open the .env<\/b> file and update your database information. Just copy the path to your root directory<\/a><\/b> and change public_html<\/b> to database\/database.sqlite<\/b>. It should look like this:<\/p>

<\/div>

Migrate the tables<\/h3>

Once you have created the database with either method, connect to your account via SSH<\/a><\/b>, navigate to your laravel<\/b> directory, and enter the following command to migrate all the files to a database:<\/p>

php artisan migrate<\/code><\/pre>

That’s it. Your Laravel 8 website should work now 😊<\/p>

NOTE<\/b><\/p>