Build a release and say what the server needs

Compile the binary, build the frontend, and set APP_DEBUG to false before anyone else can see an error page.

The deployment guide’s production build is two commands, from the Field Notes directory:

cargo build --release
npm run build

Cargo writes the binary to target/release/. The name is the [package] name, so this project is target/release/field-notes. The guide’s examples say example-app because that is their package name. Release builds take longer than the rebuilds laravel dev does, and they run faster. Deploy the release binary.

Inertia server-side rendering is optional. If you use it, the guide says to run npm run build:ssr instead and set INERTIA_SSR=true. Field Notes works without that flag.

What you copy

The binary contains the Rust code and the migrations. The process still reads directories next to it:

  • public/, including the files npm run build wrote to public/build/
  • resources/views/, including mail templates and the Inertia root view
  • storage/, which the app writes
  • bootstrap/ssr/, only if you built server-side rendering

Start the binary from the directory that contains those folders. If a process manager starts it somewhere else, set APP_BASE_PATH to the app directory. A local storage/ belongs to one machine, and many hosts erase it on deploy. The guide tells you to keep uploads in Laravel Cloud object storage or on an S3-compatible disk. Do not treat the server’s storage/ as the system of record.

The environment

At minimum:

APP_ENV=production
APP_DEBUG=false
APP_KEY=base64:...
APP_URL=https://example.com
DATABASE_URL=postgres://app:secret@db.internal/field_notes

Use a different APP_KEY from the one on your laptop. Generate one with ./field-notes key:generate --show. On Laravel Cloud, each environment gets its own key.

APP_DEBUG=true renders the error, its causes, the route, and the request for anyone who can trigger a server error. Set it to false before the binary is reachable. The deployment guide states that as a warning, not as a style preference.

Run the binary with no arguments to serve. /up returns 200 once the app has started. Point a load balancer at it. The routing guide shows how to move that path if you already use /up.

Migrations ask for confirmation in production. A deploy script passes --force, and only one machine should run it:

./field-notes migrate --force

The queue worker is a second process. It runs the code it was compiled with, so restart it on every deploy, just as you restart the server:

./field-notes queue:work

Scheduled tasks, if you add them later, need one cron line. The guide’s line is ./example-app schedule:run every minute, from the app directory. Field Notes has no schedule yet. The workflows sleep is a delayed queue job, not a cron entry. The next lesson is the Cloud path, where that cron line is a toggle instead.

Check your work

Run the release binary from the app directory and get 200 from /up. APP_DEBUG in that environment is false.

Back to roadmap