Sharing and organizations

Running your own Relay server

An organization can serve its workspace from a server of its own instead of from someone's computer. The server runs Nocturnal Relay (nocturnal-relay.exe), a Windows service with no window: it keeps serving when nobody is signed in, starts with Windows, and holds the organization's workspace as its base. People's computers join it with an enrollment token, and the organization's admins manage everything else from their own Nocturnal app.

It runs on Windows 10, Windows 11 and Windows Server 2016 or later. Linux and Docker come later.

What you need

  • A Windows computer or server that stays on, reachable from people's computers on the network (by name, address or DNS).
  • An administrator account on it.
  • The organization's license file. Without one the server serves 5 computers.
  • nocturnal-relay_<version>_x64.zip, which holds nocturnal-relay.exe and noc.exe.

Install it

Open PowerShell with Run as administrator for every step. Each command says what it did, or why it didn't.

  1. Unzip it to its own folder, for example C:\Program Files\Nocturnal Relay:

    Expand-Archive -Path "$env:USERPROFILE\Downloads\nocturnal-relay_0.1.0_x64.zip" -DestinationPath "C:\Program Files\Nocturnal Relay"
  2. Make the server. Name the workspace and its first Space, which is shared so computers can join:

    & "C:\Program Files\Nocturnal Relay\nocturnal-relay.exe" setup --name "Example Co" --space "General"

    Its data goes in C:\ProgramData\Nocturnal Relay (--data <folder> chooses another, on every command). It listens on port 47470 (--port chooses another).

  3. Apply the license:

    & "C:\Program Files\Nocturnal Relay\nocturnal-relay.exe" license "C:\path\to\license.txt"
  4. Add the service and start it:

    & "C:\Program Files\Nocturnal Relay\nocturnal-relay.exe" install
    & "C:\Program Files\Nocturnal Relay\nocturnal-relay.exe" start

    install also adds a Windows Firewall rule letting the server be reached on domain and private networks. On another firewall, open TCP 47470 (or your port) and UDP 47471, which computers on the same network use to find it.

  5. Invite the first admin as Owner. The command prints their enrollment token, for one computer, good for 7 days:

    & "C:\Program Files\Nocturnal Relay\nocturnal-relay.exe" noc admin invite "Pat Lee" pat@example.com Owner
  6. On Pat's computer, in Nocturnal: the workspace switcher › Join a workspace on this network… › Have an enrollment token?, paste the token, and join. Pat's computer gets the shared Spaces, and Pat sees Settings › Organization.

From there, Pat invites everyone else from Settings › Organization. Their tokens are made on the server, as every token is.

To deploy Nocturnal to many computers at once, see Deploying Nocturnal across an organization, with a token made on the server for the rollout:

& "C:\Program Files\Nocturnal Relay\nocturnal-relay.exe" token --label "Accounting laptops" --days 14 --uses 40

Each computer that joins with it asks who's using it the first time the workspace opens. nocturnal-relay revoke-token "Accounting laptops" stops it once the rollout is done.

Who can manage it

  • On the server: only Windows administrators. Every command needs an administrator PowerShell, and the data folder is open only to SYSTEM and the Administrators group. If someone opens it to another account, every command refuses until nocturnal-relay lock closes it again.
  • Everywhere else: only the organization's admins (Admin or Owner on the whole workspace), from their own app. The server checks each change against the person who made it.
  • The server's status and logs: admins see them in their own app, under Settings › Organization › Server: the server's name, port, how long it's been up, its version, its last backup, anything wrong, and the last lines of its debug log and audit log. The server answers only an admin's computer, and adds each look to its audit log. noc admin server on an admin's computer prints the same.

What's recorded

  • The audit log (nocturnal-relay audit): every command run on the server, with when, the Windows account and whether it worked. For a noc command it records the command's name, never its words. Each time an admin looks at the server's status and logs from their app, it records who and from which computer. Lines are only ever added.
  • The admin log (Settings › Organization, or nocturnal-relay noc admin log): changes to people, roles and the organization's settings, from anywhere. A change made on the server names the Windows account beside the command in the workspace's audit log (noc audit).
  • The debug log (nocturnal-relay log): what the service did, like starting, listening, computers joining and syncing, and problems. It never holds secrets or workspace content. It starts a new file at 5 MB and keeps the 3 before it, in C:\ProgramData\Nocturnal Relay\logs.

Everyday commands

CommandWhat it does
nocturnal-relay statusThe service, the license, each computer and when it last synced, and the tokens
nocturnal-relay log 200The last 200 lines of the debug log
nocturnal-relay auditThe last 50 commands run on the server
nocturnal-relay stop / startStops or starts the service
nocturnal-relay noc admin peopleEveryone, their roles and computers
nocturnal-relay noc admin token "Pat Lee"A new token for someone already invited
nocturnal-relay token --label <name>A token for a rollout to many computers
nocturnal-relay revoke-token <name>Stops a token working
nocturnal-relay noc admin ai-key set anthropicThe organization's AI key, read from the prompt
nocturnal-relay runServes in the window instead of as the service, to try it out
nocturnal-relay uninstallRemoves the service and its firewall rule; the data stays

Run nocturnal-relay noc help for every noc command.

Secrets and backups

  • The server's secrets (each computer's pair key, enrollment tokens' secrets, the organization's AI keys) are kept in the data folder's secrets folder, sealed with Windows' data protection for this computer: a copied file can't be opened on another computer. The data folder's lock is what keeps them from other accounts on this one.
  • The service backs the workspace up into the data folder's backups folder, as the app does: hourly when something changed, and once a day. It keeps every backup from the last 6 hours, a day's backup for 14 days and a week's for 8 weeks. It also follows the organization's retention policies. Back the whole data folder up as you would any server's data, with the service stopped or from a backup in backups.

Moving or removing it

  • nocturnal-relay uninstall stops and removes the service. The data folder stays until you delete it.
  • Moving a server to another computer isn't supported yet: its secrets are sealed for the computer they were made on.