6 simple steps to host Laravel Application in Shared Hosting, Hostinger
Get your Laravel Application in Hostinger’s shared hosting account, up and running with these 6 simple quick steps.
In Hostinger the public_html folder is soft linked to domains folder in the home directory.
Laravel follow public folder structuring, we have two options
1) Rename Laravel’s public folder to public_html.
2) Relink the Hostinger domains/public_html to pick the Laravel public folder
- #1 – Login to Terminal
Please visit other post to create ssh keys for password less entry –
How to add ssh key to Hostinger – Shared Hosting
- #2: Rename the public_html folder
mv public_html public_html_old
- #3: Initialize git
git init
Visit Our other post to add private git repos
- #4: Add Git remote Url
git add remote origin <url>
- #5: Point Laravel public folder to your domain.
ln -s -T /home/<userID>/public/ /home/<userID>/domains/<domainName>/public_html
- #6: Remove the public_html_old folder to avoid confusion
rm -rf public_html_old/
Be cautious to not change or remove any Hostinger system generated files other than mentioned.
Finally, make sure that you dont forget to add the default hostinger hosting files to .gitignore so that the files are intact with every push and pull.
And no sensitive data is saved to the repository.
Dont forget to add Hostinger native files to your .gitignore
If you delete any system generated file, you could replace from another domain or contact support to revert the changes
Follow the below article for more information
.gitignore file for Laravel – Shared Hosting – Hostinger
Incase if you need any assistance, please dont be hesitant to contact us. We are here to help you.
Thank you,