🕺
LaravelSharedHosting
  • Some hints and best practices for deploying laravel on shared hosts
  • SiteGround Shared Hosting
    • Introduction
    • Prepare your Laravel project
    • Add a hosting account
    • SSH access to SiteGround space
    • Setup a mysql database
    • Adding a mail account
    • The master folder
    • Create a .env file
    • Connect your server to git
    • Create a deployment script
    • Link this site into your webserver
    • SSL Certificate
    • Setting up a CRON job
    • Running a Queue Worker
    • On-going deployments
    • Deploy from local development
    • Deploy using GitHub Actions
Powered by GitBook
On this page
  1. SiteGround Shared Hosting

Prepare your Laravel project

PreviousIntroductionNextAdd a hosting account

Last updated 2 years ago

Nothing special is required to deploy to SiteGround. You should be able to publish your locally developed project directly into SiteGround Shared servers.

This process does not include any front-end build process on the server as I prefer to do this within my development environment and the commit built assets.

If you want to do the same with Laravel 9 and Vite, make sure to remove /public/build from the .gitignore file in the root of your project.

Version Control

This guide relies on deploying from a GIT flavoured repository (Gitlab / Github / BitBucket) so make sure you are committing your source code when it is ready to be deployed. In the you will specify the name of the branch you wish to deploy from so you could deploy from main/master or deploy for instance.

Your .env file should NOT be part of your committed code.

deployment script