N Nightship
Guides / Running a server
// running a server

Bootstrap the first admin

A fresh server has no accounts and rejects every request with 401 until you mint the first admin token. There is no sign-up page and no default password — by design. Here is why, and how to do it for each way you run the server.

Why it works this way

Local access to the data directory is the root of trust. There are no auto-created credentials, so nobody can reach a just-started server over the network and claim it. Instead, whoever can write the data directory runs an offline subcommand that mints the first admin token directly into that directory. After that, everything else happens over the API with the token.

Every token create prints the token value once, at creation. Copy it immediately; it is stored only as a hash and cannot be shown again. Lost it? Mint another.
Name the first admin admin, as every example below does. That account is the server’s recovery account: it can’t be deleted, disabled or demoted, so you can always get back in with a fresh invite from the server’s shell.

Docker Compose

Run the offline subcommands as one-shot containers against the same data volume:

docker compose run --rm nightshipd user create admin --role admin --data-dir /data
docker compose run --rm nightshipd token create my-laptop --user admin --data-dir /data
Windows: run these from PowerShell or Command Prompt. In Git Bash they need MSYS_NO_PATHCONV=1 in front of each line (MSYS_NO_PATHCONV=1 docker compose run --rm nightshipd user create admin --role admin --data-dir /data). Git Bash rewrites /data into a Windows path inside the argument, so the admin user and the token are created in a directory literally called C:/Program Files/Git/data in the container. The real /data stays empty, the commands report success, and every request afterwards answers 401 with nothing to explain why.

Docker Desktop (Exec tab)

Click the running nightshipd container, open its Exec tab, and run the two commands there. Because the shell is inside the running server, it writes to the same /data the server reads:

nightshipd user create admin --role admin --data-dir /data
nightshipd token create my-laptop --user admin --data-dir /data
Minting from the Exec tab guarantees the token lands in the volume the server actually reads. A separate docker run one-shot must mount the exact same named volume — a bare -v nightship-data:/data and a Compose-managed <project>_nightship-data are different volumes, and a token in the wrong one gives 401 despite reporting “created”.

Windows (native, bundled server)

With the server running from %LOCALAPPDATA%\Programs\Nightship, open a second terminal and point the offline commands at the same data directory:

nightshipd.exe user create admin --role admin --data-dir %LOCALAPPDATA%\NightshipServer
nightshipd.exe token create my-laptop --user admin --data-dir %LOCALAPPDATA%\NightshipServer

Bare-metal (systemd)

The offline subcommands operate directly on the data directory, so run them as the nightship user that owns it:

sudo -u nightship /opt/nightship/bin/nightshipd user create admin \
  --role admin --data-dir /var/lib/nightship
sudo -u nightship /opt/nightship/bin/nightshipd token create bootstrap \
  --user admin --data-dir /var/lib/nightship

Connect the app

With the token in hand, open the desktop app: Servers → Add server, enter the server URL (http://localhost:8080 locally, or your https://builds.example.com), and Set token with the value you copied. The Admin page now lets you create channels, push builds, and invite people.

Revoke a token instantly with nightshipd token delete <name> --data-dir <dir>. From here, see Users, roles, and groups and Invites and onboarding.
Screenshot — Add server + Set token in the desktop client
Connecting the app with your token.

← All guides