Help center/Self-hosting

ARTICLE / Self-hosting

Create a space and pair

A fresh server has no spaces. Create the first one from the CLI; the space id and enrollment secret it prints are the only credentials that allow device registration.

Why this is a separate step

A freshly installed server has no spaces, so the desktop's "issue token" has nothing to point at. Creating a space is a one-time administrative action, possible only through the CLI; the two credentials it prints are the only gate for device registration.

The first-run three steps

  1. Create the space

    docker compose run --rm novara-sync space create --name "My Space" (Compose path) or NovaraSync space create --name my-space (bare metal). Note the space id and enrollment secret.

  2. Start the server

    docker compose --profile https up -d, or double-click 2-启动服务端.cmd, or run NovaraSync.exe --urls http://127.0.0.1:5180 directly.

  3. Pair

    Desktop → Encrypted sync → Pair: address + space id + enrollment secret, space key left empty (the first device generates its own SpaceKey).

Why run --rm instead of exec: this step does not need the server running; run starts a one-off container, mounts the same ./data, writes and exits — credentials stay in one place with the server.

CLI subcommand reference

NovaraSync space create --name my-space
NovaraSync space list --json
NovaraSync space show <space id>
NovaraSync space rotate-secret <space id>
NovaraSync space delete <space id> --yes
CommandEffect
space create --name <name>Creates the space; prints the space id and enrollment secret (once only)
space listLists spaces; --json for machine-readable output
space show <space id>Shows one space's details
space rotate-secret <space id>Issues a new enrollment secret; the old secret dies instantly; paired devices are unaffected
space delete <space id> --yesDeletes the space. Irreversible; without --yes it refuses and exits (exit code 2)

Every subcommand supports --json. Exit codes: 0 success; 1 the operation failed (bad credentials, missing space, etc.); 2 command usage problem (like delete without --yes).

After pairing

The first device generates and keeps the SpaceKey (shown in a dialog, savable from the card). Only now does read-only access come into play: issue a token, copy the link, send it to the phone — see "Read-only mobile access".