Storage UI reads all server-side settings from environment variables. Storage credentials stay on the server and are never shipped to the browser.
For local development, copy the example file and edit it:
cp .env.example .env.local
On a hosting platform (Vercel, Docker, etc.), set the same variables in that platform's environment settings.
Application
| Variable | Default | Description |
|---|---|---|
NEXT_PUBLIC_APP_URL | localhost:3000 | Public URL of the app. |
NEXT_PUBLIC_BASE_PATH | (root) | Serve from a subpath, e.g. |
NEXT_PUBLIC_ASSET_PREFIX | (none) | Set only when static assets are served from a separate origin. |
Authentication
Set a username and password to turn on the built-in login screen. Leave either blank to keep the app open.
AUTH_USERNAME=admin
AUTH_PASSWORD=change-me
AUTH_SECRET=a-long-random-string
| Variable | Required | Description |
|---|---|---|
AUTH_USERNAME | For login | Login username. |
AUTH_PASSWORD | For login | Login password. |
AUTH_SECRET | Recommended | Signs the session cookie. Without it, the password doubles as the signing key, so changing the password logs everyone out. |
Sessions last 7 days.
Storage connections
Each connection is a numbered group of variables, STORAGE_1_* through STORAGE_50_*. Users can still add more connections from the UI at runtime.
A connection loads once its BUCKET, ACCESS_KEY_ID, and SECRET_ACCESS_KEY are set (plus REGION or ENDPOINT for some providers, noted below).
| Variable | Required | Description |
|---|---|---|
STORAGE_n_BUCKET | Yes | Bucket name. |
STORAGE_n_ACCESS_KEY_ID | Yes | Access key ID (Tencent SecretId, B2 key ID). |
STORAGE_n_SECRET_ACCESS_KEY | Yes | Secret access key (Tencent SecretKey, B2 application key). |
STORAGE_n_PROVIDER | No ( | Provider, see list below. |
STORAGE_n_NAME | No | Display name in the sidebar. Defaults to the bucket name. |
STORAGE_n_REGION | Provider | Required for |
STORAGE_n_ENDPOINT | Provider | Required for |
STORAGE_n_ACCOUNT_ID | R2 only | Cloudflare account ID (R2 derives its endpoint from this). |
STORAGE_n_FORCE_PATH_STYLE | No | Path-style addressing. Defaults to |
STORAGE_n_PUBLIC_BASE_URL | No | Public or CDN base URL for file links. |
STORAGE_n_READ_ONLY | No | Set to |
Supported providers: s3, r2, alibaba, tencent, backblaze-b2, minio, s3-compatible.
Examples
Always set a real region.
STORAGE_1_PROVIDER=s3
STORAGE_1_NAME=Production
STORAGE_1_BUCKET=my-bucket
STORAGE_1_REGION=us-east-1
STORAGE_1_ACCESS_KEY_ID=...
STORAGE_1_SECRET_ACCESS_KEY=...