Skip to main content
Live. This area is documented as current, user-reliable behavior.

Goal

Run a Laravel Go app on StackShift with its assets, database, queue worker and scheduler.

Prerequisites

  • A Laravel Go app in a GitHub repository, such as the official skeleton
  • A StackShift database if your app uses one

Workflow

1
Deploy the repository from the dashboard. StackShift detects the app and shows it as Laravel Go.
2
Attach a database if your app uses one. StackShift adds DATABASE_URL and runs ./app migrate --force before each new version starts.
3
Deploy. StackShift builds the assets and the binary, starts it, and checks /up.
4
Open the project, press + and add the Queue worker and the Scheduler if your app uses queued jobs or scheduled tasks.
5
Add your domain. If it is not the main address or a subdomain of it, copy the bootstrap/app.go snippet StackShift shows into your app and deploy again.

What StackShift does automatically

  • Detects Laravel Go: Your go.mod requires the Laravel Go module (go.laravel.com).
  • Builds with Go 1.27.4 (modules that declare go 1.26 or older keep Go 1.26): CGO_ENABLED=0 go build -o app .
  • Builds your frontend first when package.json has a build script: npm ci && npm run build, or npm run build:ssr when INERTIA_SSR=true.
  • Ships public/, storage/ and bootstrap/ssr/ when you use server-side rendering (views are compiled into the binary) next to the binary, with storage/ writable by the app.
  • Starts the binary from /app on port 8080 and checks /up, which answers before any middleware, so health checks pass on every address.
  • Runs ./app migrate --force before each new version starts when a database is attached (DATABASE_URL is set). A release command you set wins.

Environment variables StackShift sets

StackShift sets these on every deploy, worker and scheduled run. A variable you set yourself always wins.
  • SERVER_HOST=0.0.0.0, so the app listens on every interface instead of 127.0.0.1.
  • SERVER_PORT, the same value as PORT (8080 unless you change the port).
  • APP_ENV=production.
  • APP_URL=https:// followed by the main address: your verified custom domain when it is the main address, otherwise the project’s stackshift.cloud address. When you change the main address, StackShift redeploys the app so APP_URL follows.
  • APP_KEY, generated once per environment in the same format as ./app key:generate --show and stored as a secret variable, so it stays the same across deploys. You find it under Variables. Previews get their own key.

Queue worker and scheduler

Open the project, press + (or A) and pick Queue worker or Scheduler under Laravel Go. Queue worker runs ./app queue:work as its own process next to the web process, from the same build. Deploy changes to start it. It restarts with every deploy, so it always runs the code it was built with. Scheduler adds a scheduled job that runs ./app schedule:run every minute (UTC) in a fresh container from the live build.

Custom domains

In production Laravel Go answers only the host in APP_URL and its subdomains; other hosts get a 400. When you add a domain that is neither, the Networking settings show the exact snippet with your hosts. Put it in bootstrap/app.go and deploy again. The list replaces the default, so keep the APP_URL host in it. *.example.com covers every subdomain of example.com but not example.com itself. If your main address is a custom domain and you still want the stackshift.cloud address to work, list it too.
bootstrap/app.go

Uploads and storage

storage/ is reset on every deploy, and each copy of your app has its own. Keep logs on stderr and keep uploads elsewhere:
  • A StackShift storage bucket with your app’s S3-compatible disk. This works with several copies of the app.
  • A persistent volume on the project, with your local disk’s root pointed at the volume path. This keeps files across deploys on one server.

Expected result

Your Laravel Go app answers on its address, /up returns 200, assets load, migrations have run, and the worker and scheduler run from the same build.

Common failures

  • A domain returns 400 Bad Request. In production Laravel Go answers only the APP_URL host and its subdomains. List the other hosts in bootstrap/app.go as shown below, and keep the APP_URL host in the list.
  • Uploads disappear after a deploy. storage/ is reset on every deploy. Keep uploads on a persistent volume or in a bucket.
  • Migrations did not run. They run only when DATABASE_URL is set. If you set your own release command, StackShift runs yours instead.
  • Sessions end and encrypted values stop working after you change APP_KEY. Keep the key StackShift stored, or set your own once and leave it.

Deploy from GitHub

Use the repository-backed project flow when you want StackShift to detect the app, build from source, and let you override runtime behavior before the first deploy.

Worker and background processes

Run a project as a background process type (worker, queue, scheduler, reverb) instead of a public web service.

Scheduled jobs (cron)

Run a command from your deployed image on a recurring standard-cron schedule, with run history and exit-code tracking.

Create a bucket and connect an S3 client

Create an S2 bucket, capture its one-time credentials, and verify object operations with the AWS CLI.