NarraLeaf

Deploying a server

Run NarraLeaf Team 1.1 in a container, choose its address and ports, open the console, and back it up.

A Team server runs on one machine and keeps everything it owns under one directory. The container image carries the version-control server, the document kernel and the web console.

With Docker

Write a compose.yaml. Change NLTEAM_HOSTNAME to the name people use. It goes into the certificate and into every token's audience.

services:
  team:
    image: ghcr.io/narraleaf/team:1.1.2
    restart: unless-stopped
    environment:
      NLTEAM_HOSTNAME: team.example.com
    # Resolve that name to this container. The version-control server inside
    # connects to the address clients sign in at; without this, every
    # repository call fails. Change it when you change the hostname.
    extra_hosts:
      - "team.example.com:127.0.0.1"
    ports:
      - "54080:54080"
      - "41337:41337/tcp"
      - "41337:41337/udp"
    volumes:
      - team:/var/lib/nlteam
volumes:
  team:

Start the server

docker compose up -d

The image is linux/amd64. Nothing is downloaded on first start.

Create the first account

Write the password to a file containing that password and nothing else. It must be at least ten characters.

printf '%s' 'a password of your own' > admin-password
docker compose exec -T team nlteam init ada < admin-password
rm admin-password

init runs once and puts the first account in the admin group. It is refused once the server has an account. The password comes from standard input, so it does not appear in the process list or shell history.

The first account can also be made in a browser: while the server has no accounts, its log (docker compose logs team) shows a /console/setup address and a setup code.

Read the address and fingerprint

docker compose exec team nlteam status

The sign in line carries the endpoint address; another line carries the certificate fingerprint. Send the fingerprint over a channel other than the connection it secures.

Open the web console

Open https://<server>:54080/console/. The browser must trust the certificate. With Team's own authority, install its certificate authority on each machine whose browser opens the console: tls/ca.crt under the storage root, which nlteam trust also prints. nlteam trust --install installs it on the server machine itself. A certificate from an authority the browser already trusts needs no extra step.

A new server at /console/setup: type the setup code nlteam up printed, then create the administrator and name the team

Authors receive the host and port written as nlteam://team.example.com:54080. status prints an https:// URL for the sign-in endpoint; Studio's Add Server dialog accepts the nlteam:// form.

Ports

PortReachable from an author's machineCarries
54080YesSign-in, Studio sessions, the web console and the project API
41337Yes, TCP and UDPProject data
41339NoThe version-control server's health check
41400NoThe server's signing keys

Publish both halves of 41337. QUIC uses UDP, and a deployment that opens TCP alone leaves such a client waiting. The other listeners are bound to loopback.

Without Docker

The nlteam package is not published yet. Build it from a checkout:

git clone https://github.com/NarraLeaf/NarraLeaf-Team.git
cd NarraLeaf-Team
npm install && npm run build && npm link
nlteam up --root /srv/team --hostname team.example.com

up installs the version-control server, writes its configuration, starts it and runs until interrupted. Run the rest in a second terminal.

printf '%s' 'a password of your own' | nlteam init ada --root /srv/team
nlteam status --root /srv/team

Node.js 24 or newer is required, on 64-bit Linux, Windows or Apple silicon.

A certificate you already hold

An organization that holds a certificate for the name people use gives it to the server. Nobody compares a fingerprint because the issuer is already trusted on each machine.

    environment:
      NLTEAM_HOSTNAME: team.example.com
      NLTEAM_TLS_CERT: /etc/nlteam/tls/fullchain.pem
      NLTEAM_TLS_KEY: /etc/nlteam/tls/privkey.pem
    volumes:
      - team:/var/lib/nlteam
      - ./tls:/etc/nlteam/tls:ro

Both values or neither. The key must have no passphrase. Renewal is a restart. Team still serves its own certificate to loopback and to names the supplied certificate does not cover.

Updating

Change the image tag in compose.yaml, then:

docker compose pull
docker compose up -d

The database migrates on start and the certificate authority is kept, so nobody trusts the server again. Pin the image tag rather than using latest; latest and develop can change under a deployment nobody restarted.

From 1.0.5 the sign-in port is 54080; 1.0.0 used 41402. When upgrading from 1.0.0, change the published port to 54080:54080 and give authors the new address, or keep the old one with NLTEAM_AUTH_TLS_PORT: "41402" and 41402:41402.

Backups

/var/lib/nlteam, or the directory --root names, holds accounts, projects, the document log, signing keys, the certificate authority and the repository store.

nlteam backup --root /srv/team

backup writes <root>/backups/nlteam-backup-YYYYMMDD-HHMMSS.tar.gz (UTC) and may run while the server is up. In a container, run it as docker compose exec team nlteam backup. The console's storage page takes backups too, and its back office sets backup.every_hours (off by default) for scheduled backups and backup.keep (7 by default) for how many are kept. A backup under the root sits on the same disk as what it protects: copy it elsewhere.

To restore, stop the server first. Into a root that already holds files, restore needs --force, and then moves what was there into <root>/before-restore-YYYYMMDD-HHMMSS/ instead of deleting it. The archive may be one of the root's own backups.

nlteam restore /srv/team/backups/nlteam-backup-YYYYMMDD-HHMMSS.tar.gz --root /srv/team --force

With Docker, restore in a one-off container on the same volume. The image's entry point is nlteam, so the command starts at restore:

docker compose stop team
docker compose run --rm team restore /var/lib/nlteam/backups/nlteam-backup-YYYYMMDD-HHMMSS.tar.gz --force
docker compose start team

Delete the before-restore-… directory once the restored server checks out.

Full reference

The repository's deployment documentation covers every command, setting and environment variable.

On this page