🕺
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

Connect your server to git

PreviousCreate a .env fileNextCreate a deployment script

Last updated 2 years ago

Your project will be deployed to the server via git clone and for this, your repository needs a deployment key adding into your github account (deployment from Bitbucket or GitLab is very similar, just search for deploy keys).

First we need to create a public private key pair on our SiteGround server.

cd ~/.ssh

ssh-keygen -t rsa -P "" to create an id_rsa pair with no password. Press enter to use the default filename.

You will now have in this folder id_rsa and id_rsa.pub

You share the contents of id_rsa.pub with Github, so cat it to the screen and copy the key from the ssh-rsa through to the end which finishes with the site name.

cat id_rsa.pub

Now in github, go to Settings and Deploy Keys

Add a label (eg your domain name) and paste the key you just copied into the key box.

DO NOT check the box for write access. This server does not need to update your repository.

Key Installed