Demo Modern
Guide & TutorialsYour first production deployment
Guide & Tutorials

Your first production deployment

Take a Northstar project from a local prototype to a monitored production release.

A reliable deployment starts before code reaches production. This tutorial prepares an environment, creates a release, and verifies that the application is healthy after traffic begins flowing.
A laptop displaying product analytics
Photo by Carlos Muza on Unsplash.

Prepare the environment

Create a dedicated production environment instead of reusing staging. This keeps credentials, variables, deployment history, and access controls isolated from day-to-day testing.
ts
const environment = await northstar.environments.create({
  projectId: 'prj_01J8YQ2N7F',
  name: 'production',
  region: 'eu-west',
});
Add secrets through the Northstar dashboard or your secret manager. Avoid passing sensitive values in command arguments because shell history and CI logs may retain them.

Create the release

Deploy an immutable commit rather than a moving branch reference. An exact commit makes the release reproducible and gives your team an unambiguous rollback target.
ts
const deployment = await northstar.deployments.create({
  projectId: 'prj_01J8YQ2N7F',
  environment: 'production',
  commit: '8c31f82',
});
Northstar moves the deployment through queued, building, releasing, and ready. Treat a successful API response as acceptance of the request, not proof that the release is already serving traffic.

Verify the result

Wait for the deployment.succeeded webhook, then run a small application-level smoke test. Check the public health endpoint, load a representative page, and confirm that background jobs can reach their dependencies.
Tip
Record the deployment identifier with your application release metadata. It connects production errors to the exact build and logs in Northstar.

Roll back safely

If verification fails, deploy the last known-good commit as a new release. This preserves a complete audit trail and avoids mutating an existing deployment.