Skip to main content
MinIOAmazon S3
A storage destination is an S3-compatible bucket the control plane can write to. Log archive and the remote build cache use it, and database and volume backups use the same destinations: a destination is a backup target with a few extra options, so anything you connect appears in both Settings, Storage destinations and Settings, Backup targets. Supported providers: AWS S3, Cloudflare R2, Backblaze B2, MinIO, Wasabi, Tigris, Google Cloud Storage, Oracle Cloud Object Storage (preset oracle), and any custom S3-compatible endpoint.

Connect a destination

Go to Settings, Storage destinations, Add destination. Pick a provider, fill in the fields it asks for, and leave “Test the connection before saving” on.
Credentials are encrypted with the control plane master key, never logged, and never returned by the API. Connecting a destination needs a master key to be configured. Everything except AWS and Tigris uses path-style addressing by default. Pass --virtual-hosted (or tick the box in the dialog) for a provider that needs the bucket in the hostname. The preset IDs are aws, r2, b2, wasabi, tigris, gcs, oracle, minio, garage and custom. storage providers lists what the API knows. The help text printed by storage add names fewer of them (it leaves out tigris and oracle). The --provider value goes to the API unchanged, so the API decides which names it accepts (pending run).

Presets: Tigris, Oracle Object Storage and GCS HMAC

These three presets are not yet verified against a real bucket (pending run). The values below are the ones the code sends, from internal/objectstore/presets.go. Tigris (--provider tigris): endpoint https://t3.storage.dev, region auto, virtual-hosted addressing, so path style is off. Create an access key in the Tigris console and give it access to the bucket. Check the Tigris pricing page before you size a bucket. Google Cloud Storage (--provider gcs): endpoint https://storage.googleapis.com (the XML API), region auto, path-style. It needs an HMAC key, not a service account JSON file. In Cloud Storage, open Settings, then Interoperability, create an HMAC key for a service account that has Storage Object Admin on the bucket, and use the access ID as the access key id and the secret as the secret access key. The console path is pending run. Oracle Cloud Object Storage (--provider oracle): the preset takes the tenancy namespace, sent as the account id (--account-id), and the OCI region. The endpoint is built from both, and addressing is always path-style. In the dashboard, pick the Oracle Cloud preset and fill in its namespace and region fields (dashboard labels pending run). The same settings by hand with the custom provider: The namespace is under Tenancy details. Oracle shows the secret once, so copy it when you create the pair. The preset host is fixed to oraclecloud.com. If that host does not resolve for your region, the preset cannot point elsewhere, so use the custom provider with the endpoint you need (pending run).

What the connection test does

The test writes a small random object under .probe/, reads it back, compares it, and deletes it. Each step is reported, and a failure carries a stable reason: invalid_credentials, access_denied (valid key, missing permission), bucket_not_found, region_mismatch, endpoint_blocked, tls_error, or unreachable. The key needs permission to put, get, delete, and list objects in the bucket.

Private endpoints

Outbound connections to a destination go through the same SSRF guard as webhooks and log drains: loopback, private, link-local, and other internal addresses are refused after DNS resolution. A MinIO on a private network needs APP_NOTIFY_ALLOW_PRIVATE_NETWORKS=true on the control plane.

Provider walkthroughs

1

Create a bucket

In the Cloudflare dashboard, create a bucket under R2 (for example app-logs).
2

Create an API token

Create an R2 API token with Object Read and Write scoped to that bucket. Copy the access key id, the secret access key, and your account id (shown on the R2 overview page).
3

Add the destination

In Levelrail, add a destination with provider Cloudflare R2, the account id, the bucket, and the key pair. The endpoint is filled in for you and the region is auto.
4

Run the connection test

Every step should be green.
5

Start archiving

Under an app’s Logs, Archive tab (or Settings, Storage destinations for every app), choose the destination and click Start archiving.

Log archive

Log archive ships node-local container logs to a destination as gzip-compressed NDJSON, on a schedule or on demand. See Log archive for what gets archived, retention, dump, and how to retrieve archived objects.

Build cache

BuildKit can keep its layer cache in a storage destination, so a rebuild skips unchanged steps even after the build host’s local cache is gone. It uses BuildKit’s s3 cache backend, so it works with every provider above. Dashboard: an app’s Settings, Deploy settings, Build cache card, or Settings, Storage destinations, Build cache for all apps for a default that every app without its own setting inherits. Pick a destination and an export mode, and save.
  • Per-app prefix: layers live under build-cache/<app>/ (change the root with APP_BUILD_CACHE_PREFIX), so apps never share cache and one app can be cleared without touching another. An app can opt out of the global default by saving a setting with the cache disabled (--disable).
  • Mode: max (the default) caches every layer and gives the fastest rebuilds. min caches only the final image layers and keeps the bucket smaller.
  • Credentials: they come from the destination’s encrypted secrets, are passed to BuildKit for the one build, and are never logged, stored in build logs, or returned by the API.
  • Fails open: if the cache cannot be read or written (bad credentials, bucket gone, network), the build carries on without it. The reason is written to the build log as a warning, shown on the deploy attempt (cache_warning), and kept on the setting as the last build result. A build that genuinely fails is still a failed build.

More behavior and limits

BuildKit dials the bucket itself, so the SSRF guard is applied to a custom endpoint before each build. An endpoint that resolves to an internal address is skipped with a warning unless APP_NOTIFY_ALLOW_PRIVATE_NETWORKS=true.
A build dispatched to a dedicated build node does not receive bucket credentials, so it runs without the s3 cache and records a warning. Local builds on the control plane use it. Railpack builds do not use the s3 cache yet; Dockerfile builds do.
The app card and build-cache show list the app’s prefix (bounded to APP_BUILD_CACHE_STATS_MAX_OBJECTS, default 2000) for object count, size, and last export time, plus the last build outcome. Clear cache deletes the prefix in pages, at most APP_BUILD_CACHE_CLEAR_MAX_OBJECTS (default 5000) objects per call. When it reports more remaining, run it again. Removing a setting stops using the cache but leaves the objects, so clear first if you want the space back, or add a bucket lifecycle rule on build-cache/.

App buckets

A bucket is a private folder (a key prefix) inside a connected destination, bound to an app. Create one from the app’s Integrations page (Storage buckets, New bucket) or with levelrail-cli storage buckets create --name uploads --destination <id> --app web.
  • Env vars. At the next container start the app gets S3_ENDPOINT, S3_BUCKET, S3_PREFIX, S3_REGION, S3_ACCESS_KEY_ID and S3_SECRET_ACCESS_KEY. Give a second bucket another prefix with --env-prefix MEDIA to get MEDIA_*. Binding or unbinding a bucket restarts a running app automatically so it picks up the change. The app’s Environment card lists these variables (and database links) as read-only Connected resources with secrets masked, and env pull includes them, masked unless you reveal after step-up.
  • Files. Browse files lists (virtualized), uploads, downloads and deletes. Console uploads are capped by APP_API_MAX_BODY_BYTES (default 16 MiB); use storage buckets presign <id> <key> --method PUT for bigger files.
  • Presigned links. Time-limited GET or PUT URLs, up to 7 days, from the console (copy link), CLI or POST /api/v1/storage/buckets/{id}/presign.
  • Size limit. Enforced for console, CLI and presign issuing (a PUT presign for a full bucket fails with 413 and says to delete objects or raise quota_bytes), not for the app writing straight to S3 with its env credentials.
  • Expire after N days. A rule that deletes older files, run hourly and on demand (Run expiry now, storage buckets sweep).
  • Public read. The toggle serves files without sign-in at /api/v1/public/buckets/<id>/<key>, sandboxed with a restrictive content security policy. Everything else is private. The route is rate limited per client IP (APP_PUBLIC_BUCKET_RATE_PER_MIN, default 120, answers 429 with Retry-After), refuses objects over APP_PUBLIC_BUCKET_MAX_BYTES (default 100 MiB, 413), and always serves HTML, SVG, XML and JavaScript as a download instead of rendering them.
Prefix scoping is not a security boundary. The injected credentials are the destination’s own, so an app can read, write and delete every object in the whole provider bucket, including other apps’ prefixes. The prefix only scopes where this feature’s console, CLI, quota, lifecycle and public route read and write. There is no embedded S3 gateway that issues per-bucket keys. For apps you do not fully trust, create a dedicated destination (its own provider bucket and its own scoped key) and bind only that.

Node directory destinations

A destination can be a confined directory on an enrolled node instead of a bucket. Backups and dumps stream to it over the node’s existing agent connection: no SSH, no shell, no credentials, nothing new listening on the node.
  1. On the node, set APP_AGENT_STORAGE_DIR to a directory the agent may write to and restart the agent. Without it the agent refuses every file request.
  2. Add the destination: Settings, Storage, Add node directory, or levelrail-cli storage destinations add --name vault --node <node-id> --directory backups.
  3. Test it. The probe writes, reads back and deletes a small file. A failure comes with a typed fix (bring the node online, give it a storage directory).
The agent resolves every path under that root and rejects .., absolute paths and symlinks that leave it. Uploads land through a temp file, so a failed upload never leaves a partial object. Node directories serve backups and dumps only. Archives, artifacts, build cache and buckets need an S3 API, and WAL shipping, base backups and point in time restore stay on S3 destinations.

Quota, usage, cost and defaults

Each destination shows what its successful backups occupy, an estimated monthly cost (list prices per preset, override with APP_STORAGE_PRICE_PER_GB_MONTH_<PRESET>, for example ..._R2=0.015), and an optional soft quota that flags the destination when exceeded (--quota-gb). The quota warns, it does not block uploads. Pick a default destination per data class (backups, archives, artifacts, cache, dumps) on the Storage page or with storage destinations default set <class> <id>. A failed test can suggest typed fixes: wrong credentials, missing bucket, wrong region, clock skew, path-style addressing (one click switches it on and re-checks), or a node that is offline or has no storage directory.

Alerting

Create a log_archive_stale alert rule (dashboard: Alerts, or levelrail-cli apps alerts create <app> --kind log_archive_stale). It fires when any enabled policy’s last run failed, or when a policy has gone longer than the rule’s for_duration without a success (default: three intervals, at least two hours). It notifies through the same channels as every other rule.

API and MCP

REST routes live under /api/v1/storage (including /api/v1/storage/buckets), /api/v1/log-archive, and /api/v1/build-cache (see the API reference). Reads need the read ability, policy changes and dumps need write, and anything that handles credentials needs write:sensitive. The MCP server exposes read and control tools (list_storage_destinations, test_storage_destination, list_log_archive_policies, set_log_archive_policy, start_log_archive_dump, list_log_archive_runs, list_archived_logs, get_build_cache, set_build_cache) but deliberately has no tool that accepts bucket credentials.

Next steps

Log archive

Ship container logs to a destination on a schedule.

Backups and storage

Use a destination for database and volume backups.
Last modified on November 2, 2026