The velad Server
velad is both the HTTP server and the administration tool. Without a subcommand it runs serve; the other subcommands operate on the same data directory and are safe to run next to a live server.
Running commands
In the Docker image the binary is on PATH, so administrative commands are run with docker exec and inherit the container's environment:
docker exec vela velad key list
docker exec vela velad janitor run
With a bare binary, point it at the data directory: VELA_DATA_DIR=/var/lib/vela velad key list (run as the user that owns the directory).
Global flags
| Flag | Env | Default | Description |
|---|---|---|---|
--data-dir | VELA_DATA_DIR | /data | Data directory (database, blobs, tmp) |
--log-level | VELA_LOG_LEVEL | info | debug, info, warn or error |
--log-format | VELA_LOG_FORMAT | json | json or text |
-v, --version | Print the version |
Commands at a glance
| Command | Purpose |
|---|---|
velad serve | Run the HTTP server (default) |
velad key create|list|revoke | Manage API keys |
velad signing rotate | Rotate the keys that sign links |
velad session revoke-all | End every web sign-in session |
velad janitor run | Run one cleanup pass now |
velad backup DEST_DIR | Consistent backup of database and filesystem blobs |
velad storage migrate | Copy blobs between filesystem and R2/S3 |
velad migrate | Apply database migrations explicitly |
velad healthcheck | Probe the local server (Docker HEALTHCHECK) |
velad version | Print the version |
velad serve
Runs the HTTP server. On startup it validates configuration and the theme, applies pending database migrations, ensures a link signing key exists, checks the storage backend and logs the effective delivery mode. Then it starts the janitor (first pass after one minute) and the blob collector (every five minutes).
All core settings can be given as flags; see Configuration for meanings and defaults:
velad serve [--public-url URL] [--listen ADDR] [--data-dir DIR]
[--accel-prefix PREFIX] [--trusted-proxies CIDRS]
[--max-upload SIZE] [--max-create SIZE]
[--link-default-ttl D] [--link-max-ttl D] [--link-retention D]
[--trash-retention D] [--janitor-interval D]
[--default-visibility V] [--root-index on|off] [--robots deny|allow]
[--site-title TEXT] [--theme-dir DIR]
[--log-level L] [--log-format F]
Process behavior
- Graceful shutdown on
SIGTERM/SIGINT: stop accepting connections, let API work drain and give active requests up to 30 seconds, stop background jobs, close the database. - Timeouts: request headers must arrive within 10 seconds (max 128 KiB); request bodies have a one-minute idle deadline per read; there is no global duration cap, so large transfers are fine.
- Logging: one structured line per request with method, route, path, status, bytes, duration, request ID, client IP and key ID. Never keys, signatures or query strings.
- Panics are recovered into a
500 internalresponse and logged with a stack trace.
velad key
API keys are managed only here — never over HTTP. See API Keys & Scopes for strategy.
key create
velad key create --name NAME --scope ro|rw|admin [--prefix DIR/]
| Flag | Description |
|---|---|
--name string | Human-readable key name (required, unique among active keys) |
--scope string | ro, rw or admin (required) |
--prefix string | Restrict the key to this directory, e.g. docs/ |
The full key is printed to stdout exactly once; details go to stderr, so KEY=$(velad key create …) captures only the key.
$ docker exec vela velad key create --name ci --scope rw --prefix ci/
Created key "ci": id k3aexph8fa, scope rw, prefix ci/.
Store it now; it cannot be shown again.
vela_k3aexph8fa_…
key list
$ docker exec vela velad key list
ID NAME SCOPE PREFIX CREATED LAST USED REVOKED
7apjsr2yg5 demo admin - 2026-10-13 14:06Z 2026-10-13 14:10Z -
k3aexph8fa ci rw ci/ 2026-10-13 14:06Z - -
Secrets are never shown. LAST USED is updated at most once per minute per key.
key revoke
docker exec vela velad key revoke k3aexph8fa [MORE_IDS...]
Requests with a revoked key fail immediately with 401, and browser sessions signed in with it become anonymous on their next request. A revoked key's name becomes available again.
velad signing rotate
velad signing rotate [--revoke-all]
Activates a new link signing key. The previous key is retired: it keeps verifying the links it signed until they expire, and the janitor deletes it once nothing depends on it. With --revoke-all, every older key is destroyed instead and all existing signed links stop working immediately. See Signed Links.
velad session revoke-all
Ends every browser session of the web sign-in at once — for example after a session cookie may have leaked. The next request from each signed-in browser is simply anonymous.
$ docker exec vela velad session revoke-all
Revoked 3 web session(s).
API keys are unaffected, so their owners can sign in again. To lock out one key everywhere, revoke the key — its sessions end with it.
velad janitor run
Runs one cleanup pass now and prints a report. It is safe while the server runs: passes never overlap, even across processes.
$ docker exec vela velad janitor run
TASK COUNT DURATION ERROR
expired_links 0 0s -
expired_objects 0 0s -
trash 2 3ms -
signing_keys 0 0s -
web_sessions 1 0s -
tmp_files 0 0s -
orphan_blobs 0 12ms -
blob_gc 2 1ms -
Each task is explained in Janitor & Cleanup.
velad backup
velad backup DEST_DIR [--verify]
Writes a consistent backup into DEST_DIR, which must not exist or must be empty. SQLite is copied with VACUUM INTO, safe while the server runs. With filesystem storage every referenced blob is hard-linked (or copied across filesystems) and size-checked; --verify also checks every SHA-256. No blob is deleted anywhere while the backup runs. A missing or damaged blob fails the backup and partial output is removed. With R2 storage the backup contains only metadata and --verify is rejected.
$ docker exec vela velad backup /data/backups/2026-10-13 --verify
Backup written to /data/backups/2026-10-13: 5 object(s), 5 blob(s): 5 linked, 0 copied, all verified.
Procedures for both backends and restoration: Backups & Restore.
velad storage migrate
velad storage migrate --from fs|r2 --to fs|r2 [--dry-run] [--delete-source]
| Flag | Description |
|---|---|
--from string | Source backend |
--to string | Destination backend |
--dry-run | Verify sources and report planned copies without writing |
--delete-source | Delete source blobs only after every destination has been verified; stop writes first |
Copies all referenced blobs (live and trash) between backends without changing the database. Full procedure in Storage Migration.
velad migrate
Applies embedded database migrations and exits. serve does this automatically at startup, so you only need it to prepare a database ahead of time or to check that migrations apply.
$ docker exec vela velad migrate
Schema is up to date (version 5).
velad healthcheck
Exits 0 if the server listening on VELA_LISTEN reports healthy at /healthz. The image's HEALTHCHECK runs it every 30 seconds — distroless images have no curl.
docker exec vela velad healthcheck && echo healthy
docker inspect --format '{{.State.Health.Status}}' vela
velad version
$ docker exec vela velad version
velad v0.9.0 (commit 81a2424f3d3b, built 2026-10-31T04:13:51Z, go1.27.2, linux/amd64)