Deploying Jigsaw with Laravel Forge to supported VPS cover image

Deploying Jigsaw with Laravel Forge to supported VPS

March 7, 2025

dev

Set up

This guide assumes that you already have a Jigsaw site ready for deployment and a new site installed in Forge.

Should work with any of the supported VPS provider.

I usually use either AWS or DigitalOcean for my projects.

Guide

  1. Add npm commands in the deployment script.

Go to Deployments then add the 2 lines below.

Deployment Script

cd /your/forge/app # your site path
git pull origin $FORGE_SITE_BRANCH

## Add these lines to your deployment script
npm install
npm run prod

$FORGE_COMPOSER install --no-dev --no-interaction --prefer-dist --optimize-autoloader
  1. Next is to update the public folder to use the generated build_production path.

Go to Settings then update the value of Web Directory to /build_production

  1. Make sure to update your Jigsaw config to use your domain in config.production.

config.production

<?php

return [
    'baseUrl' => 'https://blog.jcos.io', // Change this part
    'production' => true,
];

  1. Add in SSL from Forge.

That's pretty much it.

This site here is the end product.

Maybe I'll write the reason for using Jigsaw on another time.

Hope this helps, bye.