Skip to content
Vaulthalla LogoVaulthalla

Architecture

One daemon, so every way in follows the same rules

Vaulthalla Server is one compiled C++ process that serves the mount, the console's API, the CLI, S3 and paired Macs from one cache and one permission resolver. Here is how the pieces fit, and what the design deliberately leaves out.

  • Restarts in about a second
  • 64 KiB authenticated chunks
  • Metadata in your PostgreSQL
Odin, in a winged helmet, seats a cartridge marked FUSE into a server rack among the clouds
Daemon
1
FUSE, HTTP, WebSocket, CLI, S3 and the device listener
Restart
~1 s
Stop takes tens of milliseconds, with a hard 10-second exit
Authenticated chunks
64 KiB
AES-256-GCM, each bound to its index
Format overhead
0.025%
On large files; 120 bytes on small ones
Mirror bookkeeping
<0.1 ms
Per write, on the test machine

One daemon, and why

The filesystem, the web API, sync, the S3 gateway and the device listener are services inside one process. They share one metadata cache, one dependency graph and one permission resolver. A Finder download, a FUSE read and an S3 GET resolve permissions with the same code against the same in-memory state, with no IPC between services on the hot path and no second copy of the rules to drift out of step.

One process is also one failure domain, and the design pays for that in two ways. An internal watchdog keeps the services alive (The service watchdog reigns supreme), and a restart takes about a second, so an upgrade or a recovery is a short pause rather than an outage. Uploads resume after an interruption, resending only the missing parts, and S3 multipart parts survive a daemon restart.

Around the daemon sit a few ordinary neighbors. The web console's front end is a Next.js app packaged with the server and run as its own service; it never receives key material and talks to the daemon over the WebSocket. On Linux without a hardware TPM, a managed swtpm service seals the master keys. nginx (Linux) or Caddy (macOS) terminates HTTPS in front.

Listeners

Every way in, one rulebook

Each listener is a different protocol over the same vaults. None of them has its own copy of users, roles or keys.

One platform where there used to be three

Six ways in: Finder through Vaulthalla Desktop on the Mac, a mounted folder through FUSE on Linux at /mnt/vaulthalla, the web console and share links, S3 clients such as the AWS CLI, rclone and boto3, AI agents over MCP, and the vh command line. All of them reach one Vaulthalla server, a single daemon on hardware you control, with one permission model, per-vault AES-256-GCM keys, a sync engine, an S3 gateway and an audit trail. The server keeps the bytes on local disks, in your own S3-compatible buckets at your storage provider (Backblaze B2, Cloudflare R2, AWS S3 and others), or on a second Vaulthalla server that holds a mirrored vault.

01Ways in

02One daemon

03Where bytes live

Mac

Finder

Vaulthalla Desktop

Linux

Mounted folder

FUSE at /mnt/vaulthalla

Browser

Web console

and share links

S3 API

S3 clients

AWS CLI, rclone, boto3

MCP

AI agents

As your account

CLI

vh

The command line

Hardware you control

Vaulthalla server

One daemon

  • One permission model
  • Per-vault AES-256-GCM keys
  • Sync engine
  • S3 gateway
  • Audit trail
Hardware you control

On the host

Local disks

Encrypted at rest

Your storage provider

Bring your own

Your S3-compatible buckets

Backblaze B2, Cloudflare R2, AWS S3, and others

Hardware you control

Linked server

A second Vaulthalla server

Holds a mirrored vault

Every way in answers to the same roles, groups and path rules, and every vault has its own key. Architecture map.

What each listener serves

Listener Serves Default exposure
FUSE mount /mnt/vaulthalla on Linux; each process's uid maps to a Vaulthalla user Linux only; the server never mounts on macOS
HTTP and WebSocket (/ws) The console's API, share links, previews and downloads Behind nginx or Caddy; the WebSocket refuses cross-origin pages
CLI socket vh commands and local MCP (vh mcp) Local; the Linux user maps to a Vaulthalla user
S3 gateway (port 39000) The S3 API, with each bucket bound to a vault 127.0.0.1, until you add an HTTPS hostname
Device listener (port 36972) Vaulthalla Desktop, remote MCP at /mcp, linked servers Mutual TLS 1.3 with pinned keys; loopback until vh device remote enable

Metadata in PostgreSQL, bodies on disk or in a bucket

PostgreSQL holds the tree: names, paths, permissions, shares, the audit trail, and each vault's keys wrapped by a sealed vault master. File bodies live on the host for a local vault, or in the bucket for an S3 vault, with an encrypted local cache that depends on the sync strategy.

Keeping the two apart is what makes the bucket cheap to use. A rename rewrites no object, and an idle sync pass over an opaque vault costs one HEAD. It also sets a limit worth knowing: names are stored in plain columns in PostgreSQL, so protect the database host and its backups as you would the data itself, and on a Mac keep FileVault on. In-flight data never touches the disk in plaintext: working copies, uploads and S3 request bodies are encrypted under a per-boot memory key. See encryption.

Inside the core

Format, permissions and sessions

Vault file format

VHF1: every byte authenticated

Every file is stored as VHF1: a 120-byte authenticated header that binds the vault, the file generation and the key version, followed by 64 KiB AES-256-GCM chunks, each authenticated with its index and a final flag. Truncating, reordering or splicing chunks is refused, and a range read authenticates every byte it returns. Overhead is about 0.025% on large files and 120 bytes on small ones.

In a bucket, the default opaque layout stores each file as one object named o/<random id> with no metadata. Names, folders and history live in an encrypted manifest under .vaulthalla/ in the same bucket, beside the key envelopes of any recovery kit you enroll. The specification and test vectors are in the repository.

Read the format specification

Permission resolver

Permissions are resolved, not just checked

Admin roles cover the instance, vault roles cover each vault, groups carry roles, and path overrides adjust a rule for a folder pattern:

vh vault role override add archive --user alice --pattern "/finance/*" --download --disable

The resolver evaluates all of them together with the action being taken. The console, the CLI, the mount, Finder, MCP and S3 all go through it. An S3 key adds its scope on top, so a key can never exceed the user who owns it: allowed means the user's roles, the key's scope and the budget check all agree. Even folder sizes count only what the viewer may see.

Scaling RBAC when permissions aren't enough
Access, Roles in Vaulthalla Desktop: built-in and custom admin roles with what each grants and how many accounts hold it

Sessions

Sessions bound to a live WebSocket

Web sessions ride the WebSocket at /ws, and a connection signs in once, which closed session fixation in 1.22.1. Access tokens last 15 minutes and refresh tokens 30 days by default, idle sessions sign out after 30 minutes, and the socket refuses cross-origin pages. Account › Security › Sessions lists every browser session and revokes any of them. Administrators can require passkeys or TOTP, and sensitive actions ask for a fresh confirmation.

Vaulthalla WebSocket authentication

The sync engine

A vault in a bucket follows one of three strategies: cache (the default, a local working cache), sync (two-way) or mirror (local publishes, and remote changes are not authoritative). The engine is built to be correct first and cheap second.

  • Three-way baseline. Under the ask conflict policy, a baseline means only real two-sided changes become conflicts. Each is recorded once, and closes itself if the two sides converge.
  • An index it does not trust blindly. The remote index is built from the manifest, database rows, S3 Inventory imports and events. A stale index stalls sync instead of being trusted, and an unbounded LIST needs a budget or an explicit flag.
  • Budgets. Request budgets per operation and price budgets per run, day and month. A pass that would cross one stalls with a reason, and the next pass continues where it stopped.
  • Event-driven sync. AWS S3 through SQS and Cloudflare R2 through Queues, with no Lambda, Worker or webhook deployed. Events are durable before they are acknowledged, and a removal is believed only after a HEAD confirms it.
  • Defaults. One sync thread per core, four concurrent passes, a database pool of 24.
1vh vault sync set archive --s3-budget-preset conservative2vh pricing budget set-vault archive --mode enforce --max-run 0.253vh vault sync dry-run archive

See sync, event sync and cost control.

Linked servers and mirrored vaults

A second server, one core per vault

Pair two Vaulthalla servers with vh peer pair and vh peer link; an admin picks the matching six-digit code from three, and keys are pinned on both sides with no CA. A mirrored vault has a core and one copy on the linked server that follows every change in order. Contents travel as the core's sealed bytes, never decrypted on the way, each step is checked for an exact match, and a daily scrub compares the trees. People can work in the copy while the link is up; the core applies each change as that person. While the link is down, the copy turns read-only and says why: EROFS on the mount, 503 on S3.

Linked servers and mirrored vaults

Two linked servers, both on hardware you control. One server is the vault’s core; the other holds a full encrypted copy that follows every change in order. Contents travel as the core’s sealed bytes: they are never decrypted in transit, and no bucket sits in the path. Vault keys cross the link wrapped to the other server’s pinned key. Four verbs act on the link: switch, a planned role swap; take over, when the core is gone; detach, to walk away with the copy; and relink, to reconnect and resolve drift entry by entry.

Hardware you control

Linked server

core.example.net

Vault finance

The core

Every change starts here and is applied in order.

Vault key

Sealed on this server

Hardware you control

Linked server

backup-box

Vault finance

The mirror

A full encrypted copy that follows every change.

Vault key

Arrives wrapped and attested

  • SwitchA planned role swap. It completes, or nothing changes.vh mirror switch
  • Take overThe core is gone. The mirror becomes the core.vh mirror takeover
  • DetachWalk away with the copy as an ordinary vault.vh mirror detach
  • RelinkReconnect a split pair and resolve drift entry by entry.vh mirror relink

vh mirror switch swaps roles or changes nothing. vh mirror takeover --confirm replaces a core that is gone. vh mirror detach turns the copy into an ordinary vault without asking the core. vh mirror relink reconciles two copies that drifted apart, entry by entry. Release notes: 1.27.1, 1.28.0.

Vaulthalla Desktop

A thin client of the same operations

Desktop holds no business logic. Every action in it is a daemon operation the server authorizes, the same one the console and the CLI call, so a permission or a refusal reads the same everywhere.

It connects to the device listener over mutual TLS 1.3, with its private key in the Mac's Secure Enclave, pins the server's key and never consults the system trust store. Its Finder extension is one File Provider domain per vault, and its MCP bridge exposes each paired node's own tool catalog, adding only nodes_list.

Vaulthalla Desktop
The All Nodes dashboard in Vaulthalla Desktop: four servers with health, storage used, vaults, S3 spend, key backups and linked servers

What the architecture does not do

  • No clustering and no erasure coding. One server serves each vault. There is no multi-node object cluster and no distributed object store.
  • One core per mirrored vault, and one mirror per vault. A mirror is core plus copy, not a quorum, and the copy does not accept writes while the link is down.
  • One remote bucket per vault. Several equal remotes per vault are designed, not built.
  • No device-held keys. The daemon holds a vault's unwrapped key in memory while the vault runs, so whoever administers the server can read its vaults.
  • No Windows, ARM Linux or Intel Mac builds, and no reproducible builds yet.

FAQ

Questions

Why one daemon instead of microservices?

So every way in shares one cache and one permission resolver, with no IPC between services on the hot path and no second copy of the rules. An internal watchdog and restarts of about a second cover the single process.

What does Vaulthalla need besides the daemon?

PostgreSQL for metadata (16 is packaged; 11 or later, or a remote server, works) and nginx or Caddy in front. The web console runs as its own packaged service, and Linux hosts without a hardware TPM use a managed swtpm.

Can Vaulthalla run across several nodes?

Not as a cluster. Two servers can link and mirror vaults between them, one core plus one copy per vault, with switch, takeover and detach.

Where are file names stored?

In PostgreSQL, in plain columns, beside permissions and shares. In a bucket with the default opaque layout, names live only inside an encrypted manifest, so the provider never sees them.

How much overhead does encryption add?

VHF1 adds about 0.025% on large files and 120 bytes on small ones, and a range read authenticates every byte it returns. AES-NI is expected in production; Apple Silicon has it.

What happens to transfers during a restart?

Resumable uploads resend only the missing parts, and S3 multipart parts are stored encrypted and survive a daemon restart.

A shipyard in the clouds builds a great vessel in its drydock

Read the source

Every line of it is yours to read

Vaulthalla Server and Desktop are AGPL-3.0-or-later. Start with the architecture map, then follow any request from the listener to the disk.