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:
- an explicit
velad serveflag, such as--max-upload 4GiB; - the environment variable, such as
VELA_MAX_UPLOAD=4GiB; - 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 serveThe 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 :8080HTTP listen address. Use 127.0.0.1:8080 with --network host. velad healthcheck probes this address.
VELA_DATA_DIR--data-dirdefault /dataHolds 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 emptyEmpty: 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/128Comma-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 2GiBMaximum 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 1MiBMaximum decoded size of inline content for POST /api/v1/objects (vela new).
VELA_LINK_DEFAULT_TTL--link-default-ttldefault 24hLifetime of a signed link when the client requests none. Must be positive and not exceed the maximum.
VELA_LINK_MAX_TTL--link-max-ttldefault 30dLongest allowed link lifetime. Longer requests are rejected with 400 invalid_request — never silently shortened.
VELA_LINK_RETENTION--link-retentiondefault 7dHow long records of expired links are kept (visible with vela links ls --all) before the janitor deletes them.
VELA_TRASH_RETENTION--trash-retentiondefault 14dHow long deleted objects stay restorable in the trash. Must be positive.
VELA_JANITOR_INTERVAL--janitor-intervaldefault 24hInterval between janitor passes; at least 1m. The first pass runs one minute after startup.
VELA_DEFAULT_VISIBILITY--default-visibilitydefault unlistedpublic, unlisted or private — used when a client creates an object without choosing. CLI profiles can set their own default.
VELA_ROOT_INDEX--root-indexdefault onon 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 VelaTitle of the public index. Must not be empty.
VELA_THEME_DIR--theme-dirdefault emptyDirectory with theme overrides. Missing files fall back to the embedded theme. See Theming.
VELA_ROBOTS--robotsdefault denydeny serves Disallow: /; allow permits crawling of the index while disallowing /s/ and /api/.
VELA_WEB_AUTH--web-authdefault offon 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 offSends 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 7dSliding idle timeout of a web session. At least 1m and not longer than VELA_WEB_SESSION_MAX.
VELA_WEB_SESSION_MAX--web-session-maxdefault 30dAbsolute lifetime of a web session, however active it is. Also the cookie's Max-Age.
VELA_LOG_LEVEL--log-leveldefault infodebug, info, warn or error.
VELA_LOG_FORMAT--log-formatdefault jsonjson (one structured object per line) or text.
Storage settings
These are read from the environment only.
| Variable | Default | Valid values |
|---|---|---|
VELA_STORAGE | fs | fs or r2 |
VELA_MAX_CONCURRENT_UPLOADS | 4 | 1–1024; excess uploads wait (cancellable) |
VELA_R2_ACCOUNT_ID | empty | Cloudflare account ID; needed unless the endpoint is explicit |
VELA_R2_ENDPOINT | derived | Bare http(s) origin without credentials or query |
VELA_R2_REGION | auto | Non-empty, no spaces or slashes |
VELA_R2_BUCKET | — | Bucket name (required for r2) |
VELA_R2_PREFIX | blobs/ | Non-empty relative prefix ending in / |
VELA_R2_ACCESS_KEY_ID | — | Required for r2 |
VELA_R2_SECRET_ACCESS_KEY | — | Required for r2 |
VELA_R2_DELIVERY | proxy | proxy or redirect |
VELA_R2_PRESIGN_TTL | 5m | Go duration, 1s – 1h |
VELA_R2_PART_SIZE | 8MiB | 5MiB – 64MiB |
VELA_R2_UPLOAD_CONCURRENCY | 2 | 1–16 |
VELA_R2_PATH_STYLE | true | true 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.
| Unit | Meaning | Example |
|---|---|---|
none, b | bytes | 1048576 |
k, KiB / kb | 1024 / 1000 bytes | 512KiB |
m, MiB / mb | 1024² / 1000² bytes | 8MiB |
g, GiB / gb | 1024³ / 1000³ bytes | 2GiB |
t, TiB / tb | 1024⁴ / 1000⁴ bytes | 1TiB |
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_URLis required byvelad 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_PREFIXmust be empty withVELA_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_AUTHaccepton/off,true/false,yes/noor1/0. - Web sign-in needs an
httpspublic URL unlessVELA_WEB_INSECURE_COOKIEis 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:
| Variable | Equivalent flag | Meaning |
|---|---|---|
VELA_URL | --url | Server URL, overriding the profile |
VELA_PROFILE | --profile | Profile name to use |
VELA_KEY | none, deliberately | API key, overriding the saved key. There is no key flag so keys never appear in shell history or process lists. |
VELA_CONFIG | --config | Path of the config file |
NO_COLOR | --no-color | Disable colors |
VISUAL, EDITOR | — | Editor for vela new --edit (fallback vi) |
XDG_CONFIG_HOME | — | Base of the default config path on Unix |