Noctura

Guide

Noctura Server

Your Noctura library in every browser at home: the phone, the TV or another laptop. Each person signs in with their own account and keeps their own history. The web page only answers inside your home network.

Run it

The simplest way is inside the Noctura app: Settings → Home server. To run it on its own, on a computer that stays on, download the program for your system from the latest release: Linux (x64, or ARM like a Raspberry Pi), macOS (Apple silicon) or Windows. Unpack it and start it.

$ tar -xzf noctura-server-linux-x64.tar.gz
$ cd noctura-server-linux-x64
$ ./noctura-server --port 8787

On Windows it's noctura-server.exe. The Mac program isn't signed, so macOS blocks it the first time; run xattr -d com.apple.quarantine noctura-server once. On Linux it needs OpenSSL 3 (Debian 12, Ubuntu 22.04 or newer). To build it from source instead, use cargo run --release -- in place of ./noctura-server.

Then open http://<this computer's address>:8787 on another device. A server with no accounts yet opens with a short setup in the browser: make the administrator account and choose where the movies live, a folder (created if missing) or an S3 bucket (tried before it is saved). Once the first account exists, the setup is gone for good.

You can also make accounts from the command line instead. The first account is the administrator.

$ ./noctura-server add-user alice          # asks for a password
$ ./noctura-server add-user bob --role editor
OptionWhat it does
--port 8787The port of the web page.
--data DIRWhere accounts, settings and the library live.
--cache DIRWhere torrent downloads go.
--vpn INTERFACESends torrent traffic through your VPN's network interface. Add --kill-switch to stop it when the VPN drops.
--proxy socks5://…Sends torrent traffic through your SOCKS5 proxy.

Other commands: set-role NAME ROLE, set-password NAME, remove-user NAME, users, and journal (who published, rematched or deleted what, and when).

The server doesn't provide a VPN or a proxy. It uses the one you already have.

Docker (Linux)

$ mkdir -p data/server movies
$ echo 'folder = "/movies"' > data/server/noctura-server.toml
$ docker compose up -d --build
$ docker compose run --rm noctura add-user alice

compose.yaml uses host networking on purpose: the server then sees each device's real address, so the web page still answers only inside the home network. With published ports Docker makes every request look local, so don't add ports:. ./data keeps accounts, settings and the library, ./cache the torrent downloads and ./movies your files. The image includes FFmpeg.

Accounts

Each account has one of three roles, checked on every request:

On the Accounts page an administrator adds accounts, changes roles, sets new passwords, deletes accounts and reads the journal. They also see how much space the films and photos take, and what is still free on the disk. An administrator can't change their own role or delete themselves, so the server always keeps one.

Nobody signs up on their own. An administrator makes an invite link with the role already chosen; the person opens it, picks a name and a password, and is signed in. A link works once, for 7 days, and can be withdrawn before that.

Adding movies

Editors and administrators get an Add button on the home page:

Each one then shows what the server recognised: title, year, episode (S01E04) and poster, from the file name and Cinemeta. "Not this one?" searches again, and nothing reaches the catalog before Publish, which files it as Title (Year)/Title (Year).mkv or Show/Season 01/Show S01E04.mkv. Uploads left unfinished are deleted after two days.

If ffprobe (part of FFmpeg) is installed, the server also shows the codecs and warns about what a browser can't play: HEVC video, AC3 or DTS sound, or an MKV that Safari and iPhones won't open. VLC plays them all.

On a title's page, editors can pick another Cinemeta title, fix the name and year by hand (Rename), add a subtitle (Subtitles) or delete the file.

Watching

Libraries and limits

An administrator can make Libraries, say "Kids" or "Dan's movies", and give each one to some accounts. Editors put a title into a library, with an age (7+, 12+, 15+, 18+), from the title's page; a whole series moves at once. Everyone sees a title with no library; a library's titles are seen only by the accounts it was given to, and by administrators.

Each account also has Limits: an age limit (titles with no age are hidden from it, since nobody checked them), whether it may Share or Download files, and a space quota for what it uploads or fetches.

Your movies in Stremio

The server also offers its own movies and series as a Stremio add-on, at /addon/manifest.json, for Stremio and Noctura alike. Its settings live in server/noctura-server.toml, in the data folder (on macOS, ~/Library/Application Support/Noctura).

[addon]
mode = "private"                  # or "public"
stremio_links = true              # private mode: allow personal Stremio links
public_url = "https://movies.example.com"   # optional
$ ./noctura-server addon-link alice     # a new link replaces the old one
$ ./noctura-server addon-revoke alice

At home, the link on port 8787 works as it is. To use it away from home, put an HTTPS reverse proxy in front of the add-on port, which only listens on 127.0.0.1:8788 and serves nothing but the add-on. With Caddy:

movies.example.com {
    reverse_proxy 127.0.0.1:8788
}

Never point a proxy at port 8787: that port trusts every local address.

S3 buckets

Movies can live in a folder, in an S3-compatible bucket (AWS, Cloudflare R2, Backblaze B2, MinIO), or both. Put this in server/noctura-server.toml and chmod 600 it:

folder = "/srv/movies"            # a folder, a bucket, or both

[s3]
endpoint = "https://<account>.r2.cloudflarestorage.com"
region = "auto"
bucket = "movies"
access_key = "…"                  # never leaves the server
secret_key = "…"

In private mode, files from the bucket are streamed through the server, so no S3 link ever reaches a device. In public mode they redirect to a signed link that lasts six hours. With a bucket and no folder, uploads go into the bucket in 64 MB parts, so large movies work too; with both, uploads go to the folder.

Photos

Every account, members too, can make photo albums under Photos and upload JPEG, PNG, WebP, GIF, TIFF or BMP files, up to 80 MB each, within the account's quota. The server keeps the original and makes a thumbnail and a screen-sized copy, turned the right way up. The date and the camera come from the photo's EXIF, and the album is sorted by date.

An album is private: only its owner sees it, administrators included, until the owner shares it with other accounts or makes a link for people without an account (1, 7 or 30 days, with an optional password; it can be withdrawn). Photos stay in the server's web page: Stremio has no photo gallery, and the Noctura app's gallery doesn't show them yet.

Seeding on BitTorrent

Off by default. When it is on, the server shares every film from the folder that is in no library on the public BitTorrent network. Anyone with the magnet link can download it, and other peers see the server's IP address. Only turn it on for films you have the right to share.

[seed]
enabled = true
port = 51413                      # open this port in your router; no UPnP
trackers = []                     # optional; the DHT is always on

More detail, and the source code, in the server's README.