Configuration

velad is configured with VELA_* environment variables — convenient for docker run --env-file — and the core settings can also be passed as velad serve flags. Configuration is validated before any traffic is served; an invalid value stops startup with a clear message.

Precedence

For each core setting, the first of these wins:

  1. an explicit velad serve flag, such as --max-upload 4GiB;
  2. the environment variable, such as VELA_MAX_UPLOAD=4GiB;
  3. the built-in default.

An environment variable that is set to an empty value counts as set. VELA_ACCEL_PREFIX= therefore means “empty”, not “use the default” — which matters for settings whose default is not empty, such as VELA_SITE_TITLE (which then fails validation).

Storage-backend settings and credentials are environment-only, so secrets never appear in process arguments. Administrative subcommands (key, backup, …) accept the shared --data-dir, --log-level and --log-format flags.

Server settings

VELA_PUBLIC_URL--public-urlrequired to serve

The public origin used to build object, index and link URLs, e.g. https://store.example.com. Must be an absolute http(s) URL that is a bare origin: no path, query, credentials or trailing path. Vela needs its own (sub)domain.

VELA_LISTEN--listendefault :8080

HTTP listen address. Use 127.0.0.1:8080 with --network host. velad healthcheck probes this address.

VELA_DATA_DIR--data-dirdefault /data

Holds vela.db, blobs/ and tmp/. tmp/ and blobs/ must be on the same filesystem (atomic publication). In the container, mount your host directory here.

VELA_ACCEL_PREFIX--accel-prefixdefault empty

Empty: Go streams contents (direct delivery). A non-empty prefix such as /_blobs/ explicitly enables nginx X-Accel-Redirect and must start and end with / and match nginx's internal locations. Must be empty with R2. See nginx accel.

VELA_TRUSTED_PROXIES--trusted-proxiesdefault 127.0.0.1/32,::1/128

Comma-separated CIDRs whose X-Real-IP, X-Forwarded-For and X-Request-ID are trusted. Add your proxy's exact address only. See trusted proxies.

VELA_MAX_UPLOAD--max-uploaddefault 2GiB

Maximum streaming upload size. Enforced from Content-Length before reading and while streaming chunked bodies. Keep your proxy's body limit identical. With R2, must not exceed VELA_R2_PART_SIZE × 10000.

VELA_MAX_CREATE--max-createdefault 1MiB

Maximum decoded size of inline content for POST /api/v1/objects (vela new).

VELA_LINK_DEFAULT_TTL--link-default-ttldefault 24h

Lifetime of a signed link when the client requests none. Must be positive and not exceed the maximum.

VELA_LINK_MAX_TTL--link-max-ttldefault 30d

Longest allowed link lifetime. Longer requests are rejected with 400 invalid_request — never silently shortened.

VELA_LINK_RETENTION--link-retentiondefault 7d

How long records of expired links are kept (visible with vela links ls --all) before the janitor deletes them.

VELA_TRASH_RETENTION--trash-retentiondefault 14d

How long deleted objects stay restorable in the trash. Must be positive.

VELA_JANITOR_INTERVAL--janitor-intervaldefault 24h

Interval between janitor passes; at least 1m. The first pass runs one minute after startup.

VELA_DEFAULT_VISIBILITY--default-visibilitydefault unlisted

public, unlisted or private — used when a client creates an object without choosing. CLI profiles can set their own default.

VELA_ROOT_INDEX--root-indexdefault on

on or off: whether the root HTML index exists when no explicit root rule is stored. A root rule in the database (vela dir private-root) overrides this. Startup logs the final value and its source. Not access control.

VELA_SITE_TITLE--site-titledefault Vela

Title of the public index. Must not be empty.

VELA_THEME_DIR--theme-dirdefault empty

Directory with theme overrides. Missing files fall back to the embedded theme. See Theming.

VELA_ROBOTS--robotsdefault deny

deny serves Disallow: /; allow permits crawling of the index while disallowing /s/ and /api/.

VELA_WEB_AUTH--web-authdefault off

on enables the read-only web sign-in with an API key. Requires an https VELA_PUBLIC_URL. While it is off, no route, cookie, header or page changes.

VELA_WEB_INSECURE_COOKIE--web-insecure-cookiedefault off

Sends the session cookie as vela_session without Secure and the __Host- prefix, so sign-in works over plain HTTP. For local development only; startup logs a warning.

VELA_WEB_SESSION_IDLE--web-session-idledefault 7d

Sliding idle timeout of a web session. At least 1m and not longer than VELA_WEB_SESSION_MAX.

VELA_WEB_SESSION_MAX--web-session-maxdefault 30d

Absolute lifetime of a web session, however active it is. Also the cookie's Max-Age.

VELA_LOG_LEVEL--log-leveldefault info

debug, info, warn or error.

VELA_LOG_FORMAT--log-formatdefault json

json (one structured object per line) or text.

Storage settings

These are read from the environment only.

VariableDefaultValid values
VELA_STORAGEfsfs or r2
VELA_MAX_CONCURRENT_UPLOADS41–1024; excess uploads wait (cancellable)
VELA_R2_ACCOUNT_IDemptyCloudflare account ID; needed unless the endpoint is explicit
VELA_R2_ENDPOINTderivedBare http(s) origin without credentials or query
VELA_R2_REGIONautoNon-empty, no spaces or slashes
VELA_R2_BUCKET—Bucket name (required for r2)
VELA_R2_PREFIXblobs/Non-empty relative prefix ending in /
VELA_R2_ACCESS_KEY_ID—Required for r2
VELA_R2_SECRET_ACCESS_KEY—Required for r2
VELA_R2_DELIVERYproxyproxy or redirect
VELA_R2_PRESIGN_TTL5mGo duration, 1s – 1h
VELA_R2_PART_SIZE8MiB5MiB – 64MiB
VELA_R2_UPLOAD_CONCURRENCY21–16
VELA_R2_PATH_STYLEtruetrue or false

The R2 guide explains each one: Cloudflare R2 & S3.

Value syntax

Sizes

A whole number followed by an optional, case-insensitive unit. Binary units are powers of 1024; decimal units powers of 1000.

UnitMeaningExample
none, bbytes1048576
k, KiB / kb1024 / 1000 bytes512KiB
m, MiB / mb1024² / 1000² bytes8MiB
g, GiB / gb1024³ / 1000³ bytes2GiB
t, TiB / tb1024⁴ / 1000⁴ bytes1TiB

Durations

Core durations (link TTLs, retention, janitor interval) and every TTL in the CLI and API use Vela's duration syntax: one or more number + unit pairs with units s, m, h, d (24 h) and w (7 d). Examples: 90m, 2h, 7d, 2w, 1d12h. Fractions are not accepted. VELA_R2_PRESIGN_TTL is the exception: it uses Go's syntax (90s, 5m, 1h; no days).

The API reports durations in hours, so VELA_LINK_MAX_TTL=30d appears as "link_max_ttl": "720h" in /api/v1/info.

Validation rules

  • VELA_PUBLIC_URL is required by velad serve (other subcommands do not need it).
  • Sizes must be positive; link default TTL must be positive and ≤ the maximum; trash retention must be positive; janitor interval ≥ 1 minute.
  • VELA_ACCEL_PREFIX must be empty with VELA_STORAGE=r2.
  • With R2, upload and create limits must fit within VELA_R2_PART_SIZE × 10000.
  • CIDRs, log levels, log formats, visibility, robots and root-index values are checked against their allowed sets.
  • Switches such as VELA_WEB_AUTH accept on/off, true/false, yes/no or 1/0.
  • Web sign-in needs an https public URL unless VELA_WEB_INSECURE_COOKIE is on; the session idle timeout is ≥ 1 minute and ≤ the absolute lifetime.
  • Custom themes are parsed and sample-rendered; a broken template or missing asset prevents startup.

Problems are reported before the server binds its port, and the process exits non-zero:

$ velad serve
velad: VELA_PUBLIC_URL is required (for example https://store.example.com)

$ VELA_PUBLIC_URL=https://store.example.com/files velad serve
velad: VELA_PUBLIC_URL: "https://store.example.com/files" must be a bare origin without path, query or credentials

$ VELA_PUBLIC_URL=http://store.example.com VELA_WEB_AUTH=on velad serve
velad: VELA_WEB_AUTH needs an https VELA_PUBLIC_URL; set VELA_WEB_INSECURE_COOKIE=on only for plain-HTTP development

A complete example

VELA_PUBLIC_URL=https://store.example.com
VELA_LISTEN=:8080
VELA_DATA_DIR=/data
VELA_TRUSTED_PROXIES=127.0.0.1/32,::1/128,172.17.0.1/32

VELA_MAX_UPLOAD=4GiB
VELA_MAX_CREATE=1MiB
VELA_MAX_CONCURRENT_UPLOADS=4

VELA_LINK_DEFAULT_TTL=24h
VELA_LINK_MAX_TTL=30d
VELA_LINK_RETENTION=7d
VELA_TRASH_RETENTION=30d
VELA_JANITOR_INTERVAL=12h

VELA_DEFAULT_VISIBILITY=private
VELA_ROBOTS=deny
VELA_ROOT_INDEX=off
VELA_SITE_TITLE=Example Files
VELA_THEME_DIR=

VELA_WEB_AUTH=on
VELA_WEB_SESSION_IDLE=7d
VELA_WEB_SESSION_MAX=30d

VELA_LOG_LEVEL=info
VELA_LOG_FORMAT=json

VELA_STORAGE=fs
VELA_ACCEL_PREFIX=

Reloading configurationDocker reads --env-file only when a container is created. After editing the file, docker stop vela && docker rm vela and run the container again; docker restart keeps the old values.

CLI environment variables

The vela CLI is configured through profiles (see Profiles & Login) and these variables:

VariableEquivalent flagMeaning
VELA_URL--urlServer URL, overriding the profile
VELA_PROFILE--profileProfile name to use
VELA_KEYnone, deliberatelyAPI key, overriding the saved key. There is no key flag so keys never appear in shell history or process lists.
VELA_CONFIG--configPath of the config file
NO_COLOR--no-colorDisable colors
VISUAL, EDITOR—Editor for vela new --edit (fallback vi)
XDG_CONFIG_HOME—Base of the default config path on Unix