Using Laravel Forge to host SilverStripe 4
Tags: laravel, laravelforge, silverstripe, hosting
Published: 2020-03-27 05:46:50

---
title: Using Laravel Forge to host SilverStripe 4
published: true
description: Host your SilverStripe 4 site using Laravel Forge
tags: 
  - Laravel
  - Laravel Forge
  - SilverStripe
  - Hosting
canonical_url: https://bringyourownideas.com/blog/using-laravel-forge-to-host-silverstripe-4/
---
Using Laravel Forge to host SilverStripe 4
==========================================

A few years ago during a [SilverStripe](https://silverrstripe.org) meetup in Wellington [Ingo Schommer](https://twitter.com/chillu) mentioned that SilverStripe 4 will be a "better citizen of PHP world". With this he was pointing to goal to support the PSR standards for the then-future versions of SilverStripe. Now, SilverStripe 4 is here and in daily use. We can leverage on the hard work done to get the popular CMS to be PSR compliant.

At *bring your own ideas* we are using both SilverStripe 4 as well as Laravel heavily. The Laravel ecosystem comes with a lot of great tools build by [Taylor Otwell](https://twitter.com/taylorotwell/) and others. One of these great tools is [Laravel Forge](https://forge.laravel.com/). Forge allows you to manage your servers easily. Configuring this for SilverStripe 4 is as simple as configuring it for Laravel.

Once you have signed up create and connect your server(s) at the your provider of choice. After this you will need to complete the following steps:

1.  **Add a new site:** Click through to your web server and fill in the form to create a new site with the domain name you are intending to use:

    ![Screenshot of the create site form](https://bringyourownideas.com/assets/24eefee0d0/laravel-forge-create-site-for-silverstripe4__ResizedImageWzYwMCwyODhd.png "laravel forge create site for silverstripe4")

2.  **Create a new database:** Navigate to "Database" on the left. Ideally you want to create a database user for each project following:

    ![Froge form to create a new database for your SilverStripe 4 project](https://bringyourownideas.com/assets/590c13cbc7/laravel-forge-create-a-new-database-for-silverstripe4__ResizedImageWzYwMCwxNThd.png "laravel forge create a new database for silverstripe4")

3.  **Configure git:** Navigate back to "Sites" and select your site in the list below the create form. Select "Git repository" and enter the information in the form:

    ![Connect git repository to Laravel Forge](https://bringyourownideas.com/assets/8bca1708d3/laravel-forge-connect-git__ResizedImageWzYwMCwyNDhd.png "laravel forge connect git")

4.  **Configure .env-file:** Select the "Environment"-menu point and click on the green "Edit Environment"-button and fill in the form similar to this:

    ![Configure .env-file for SilverStripe4 hosted on Laravel Forge](https://bringyourownideas.com/assets/d7d886584f/laravel-forge-configure-env-file-for-SilverStripe4__ResizedImageWzU2MSw0MDBd.png "laravel forge configure env file for SilverStripe4")

5.  **Configure deployment script:** One of the last steps required is a tweak of the deploy script to run dev/build during the deployment. The script needs to roughly look like this:

    ![Deploy script for Laravel Forge hosting a SilverStripe 4 instance](https://bringyourownideas.com/assets/167c037542/laravel-forge-deploy-script-for-SilverStripe4__ResizedImageWzYwMCwyMTNd.png "laravel forge deploy script for SilverStripe4")

6.  **Enable automatic deployments:** To use the full convenience of automatic deployments on push you should enable automatic deployments on pushing to/merging into the master branch:

    ![Enable automatical deployments on Laravel Forge](https://bringyourownideas.com/assets/d3242462b7/laravel-forge-enable-automatical-deployments__ResizedImageWzYwMCwxNTJd.png "laravel forge enable automatical deployments")

    This step is optional, but highly recommended.

With these six (5 plus 1) steps you are able to host SilverStripe 4 websites on Laravel Forge. There is no need to actually have an Laravel app on the server(s). This approach can be used with or without any Laravel sites/applications being actually hosted there.

## SilverStripe Hosting

If you are interesting in SilverStripe hosting please have a look at these [SilverStripe hosting options](https://bringyourownideas.com/blog/silverstripe-hosting-options/). Bring Your Own Ideas Ltd. can help you getting started. Get in touch on our website to discuss your needs further.