MidnightDocs

Your first deploy#

Sign in, bind a project directory to a service, and deploy it.

Before you start#

Sign in#

midnight login --api-base https://api.example.test --email you@example.com

Your password, and a time-based one-time code when one is required, are read without terminal echo. This creates a durable human session — an account session tied to you, not an installation-wide credential.

Confirm who the server thinks you are:

midnight whoami

Run this from inside the project directory:

midnight link

link binds the directory to a project, environment and service, and writes .midnight/project.json. That file travels with the repository, so a colleague who clones it inherits the same binding.

midnight status

status shows the current link.

Deploy#

midnight up

up deploys using your scoped human session.

Important

up never silently falls back to a preserved installation-wide recovery credential. If your session cannot perform the deploy, the command fails rather than quietly escalating.

Watch it#

midnight logs -f

This streams the latest deploy's logs.

Automate it later#

For CI, create a project-scoped credential rather than reusing your human session:

midnight token create --name ci-deploy

The raw value is shown once. Store it immediately in your CI secret store.

MIDNIGHT_TOKEN=midn_sa_... midnight up --detach
Warning

A project-scoped token can deploy that project. Treat it as a deployment credential, scope it to the project that needs it, and rotate it if it is ever printed into a log.

Verify#

  • midnight whoami reports your identity and an active session.
  • midnight status shows the expected project, environment and service.
  • midnight logs -f shows build and deploy output.
  • The deployment reaches a running state.

If it does not work#

Symptom Check Recovery
login fails The API base URL and your credentials The URL must be your installation's API base
link finds nothing Whether your session has access to the project Human sessions discover only projects you can reach
up refuses Whether your session has the necessary scope It will not fall back to a recovery credential; grant the scope
The deploy queues but never builds Whether the worker and buildkit units are running See Install the server
The app runs but is unreachable Routing and TLS See Domains and TLS

Next#