Bootstrap API key
The server requires a bootstrap key to authenticate the first user. Generate one locally:NIGHTSHIFT_API_KEY environment variable so the server can seed it into the database at startup.
Production deployment
For production, useinfra/production.sh to set up Caddy (auto-TLS) and systemd. This gives you HTTPS with automatic Let’s Encrypt certificates and a service that restarts on failure.
Prerequisites
- A bare-metal instance with KVM support (e.g., c5.metal)
- DNS A record pointing your hostname to the instance’s public IP
- Ports 80 and 443 open in the security group / firewall
Run the production script
Create systemd service
Creates
nightshift-serve.service that runs nightshift serve --port 3000 as a daemon with automatic restart. Sets NIGHTSHIFT_API_KEY in the service environment.Configure Caddy
Writes a Caddyfile that reverse-proxies your hostname to
localhost:3000. Caddy handles TLS certificate provisioning and renewal automatically via Let’s Encrypt.Bake rootfs
Runs
bake-rootfs.sh to copy the agent runtime (init script, agent entry point, SDK, protocol layer) into the base rootfs image. This is the code that runs inside every Firecracker VM.Options
| Flag | Default | Description |
|---|---|---|
--hostname | (required) | FQDN for TLS — e.g., api.nightshift.sh |
--api-key | (required) | Bootstrap key to set as NIGHTSHIFT_API_KEY in the systemd service |
--port | 3000 | Backend port for nightshift serve |
Authenticate
Once the server is running, use the bootstrap key to log in:Verify
Service management
One-step provision + deploy
If you’re launching a new instance from scratch,setup.sh supports a --production flag that provisions the EC2 instance and runs the production deployment in one step:
production.sh on the remote machine automatically.