> ## Documentation Index
> Fetch the complete documentation index at: https://help.teable.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Self-hosted environment variable reference

> Look up Teable environment variables, required values and defaults for the app, database, storage and authentication. Review secret generation and rotation guidance.

| Environment Variable | Description | Default Value | Required | Example |
| - | - | - | - | - |
| **Core Configuration** | | | | |
| PUBLIC\_ORIGIN | Public origin for generating complete URLs, must be set to your app's access address | - | Yes | [https://app.teable.ai](https://app.teable.ai) |
| SECRET\_KEY | Root secret for JWTs, sessions, and sharing. Generate a strong random value | - | Yes | `openssl rand -base64 32` |
| BACKEND\_JWT\_SECRET | Signs auth, share, and plugin JWTs. Falls back to SECRET\_KEY | SECRET\_KEY | - | `openssl rand -base64 32` |
| BACKEND\_SESSION\_SECRET | Signs login session cookies. Falls back to SECRET\_KEY | SECRET\_KEY | - | `openssl rand -base64 32` |
| BACKEND\_STORAGE\_ENCRYPTION\_KEY | Encrypts attachment access tokens. Required when BACKEND\_STORAGE\_PROVIDER is `local` | - | Yes | 16-char random string |
| BACKEND\_STORAGE\_ENCRYPTION\_IV | Encryption IV paired with BACKEND\_STORAGE\_ENCRYPTION\_KEY | - | Yes | 16-char random string |
| BACKEND\_ACCESS\_TOKEN\_ENCRYPTION\_KEY | Encrypts personal access tokens | - | Yes | 16-char random string |
| BACKEND\_ACCESS\_TOKEN\_ENCRYPTION\_IV | Encryption IV paired with BACKEND\_ACCESS\_TOKEN\_ENCRYPTION\_KEY | - | Yes | 16-char random string |
| PORT | Port on which the application runs | 3000 | - | 3000 |
| LOG\_LEVEL | Log level, options: fatal, error, warn, info, debug, trace | info | - | debug |
| **Storage Configuration** | | | | |
| BACKEND\_STORAGE\_PROVIDER | Storage provider, options: local, minio, s3, aliyun | local | - | s3 |
| BACKEND\_STORAGE\_LOCAL\_PATH | Local storage path | .assets/uploads | - | .assets/uploads |
| BACKEND\_STORAGE\_PUBLIC\_BUCKET | Public bucket name | public | - | teable-public |
| BACKEND\_STORAGE\_PRIVATE\_BUCKET | Private bucket name for attachments, app files, archived data, and other protected content | private | - | teable-private |
| BACKEND\_STORAGE\_PUBLIC\_URL | Public URL override for public bucket (optional) | - | - | [https://cdn.example.com](https://cdn.example.com) |
| BACKEND\_STORAGE\_PRIVATE\_BUCKET\_ENDPOINT | Private bucket endpoint override (optional) | - | - | [https://private-bucket.endpoint](https://private-bucket.endpoint) |
| BACKEND\_STORAGE\_S3\_REGION | S3 storage region, required when BACKEND\_STORAGE\_PROVIDER is s3 | - | - | us-east-2 |
| BACKEND\_STORAGE\_S3\_ENDPOINT | S3 storage endpoint, required when BACKEND\_STORAGE\_PROVIDER is s3 | - | - | [https://s3.us-east-2.amazonaws.com](https://s3.us-east-2.amazonaws.com) |
| BACKEND\_STORAGE\_S3\_INTERNAL\_ENDPOINT | S3 internal endpoint (optional) | - | - | [http://s3.internal](http://s3.internal) |
| BACKEND\_STORAGE\_S3\_FORCE\_PATH\_STYLE | Use path-style URLs (`endpoint/bucket/key`) for browser-facing S3 requests. Enable this when the public endpoint cannot serve bucket subdomains. Cannot be combined with BACKEND\_STORAGE\_PRIVATE\_BUCKET\_ENDPOINT | false | - | true |
| BACKEND\_STORAGE\_S3\_INTERNAL\_FORCE\_PATH\_STYLE | Override path-style addressing for internal S3 requests. When unset, it inherits the public setting if both clients share an endpoint; a separate internal endpoint keeps virtual-hosted addressing | - | - | true |
| BACKEND\_STORAGE\_S3\_ACCESS\_KEY | S3 storage access key, required when BACKEND\_STORAGE\_PROVIDER is s3 | - | - | your\_access\_key |
| BACKEND\_STORAGE\_S3\_SECRET\_KEY | S3 storage secret key, required when BACKEND\_STORAGE\_PROVIDER is s3 | - | - | your\_secret\_key |
| BACKEND\_STORAGE\_S3\_MAX\_SOCKETS | S3 max sockets (optional) | 100 | - | 100 |
| BACKEND\_STORAGE\_MINIO\_ENDPOINT | MinIO storage endpoint | - | - | minio.example.com |
| BACKEND\_STORAGE\_MINIO\_PORT | MinIO port | 9000 | - | 443 |
| BACKEND\_STORAGE\_MINIO\_USE\_SSL | Whether MinIO uses SSL | false | - | true |
| BACKEND\_STORAGE\_MINIO\_ACCESS\_KEY | MinIO access key | - | - | access-key |
| BACKEND\_STORAGE\_MINIO\_SECRET\_KEY | MinIO secret key | - | - | secret-key |
| BACKEND\_STORAGE\_MINIO\_INTERNAL\_ENDPOINT | MinIO internal endpoint (optional, no HTTPS) | - | - | minio.internal |
| BACKEND\_STORAGE\_MINIO\_INTERNAL\_PORT | MinIO internal port (optional) | 9000 | - | 9000 |
| BACKEND\_STORAGE\_MINIO\_REGION | MinIO region (optional) | - | - | us-east-1 |
| BACKEND\_STORAGE\_UPLOAD\_METHOD | Upload method | put | - | put |
| STORAGE\_PREFIX | Storage prefix, defaults to PUBLIC\_ORIGIN | PUBLIC\_ORIGIN | - | [http://localhost:3000](http://localhost:3000) |
| **Cache Configuration** | | | | |
| BACKEND\_CACHE\_REDIS\_URI | Redis connection URI. Required: the cache, job queues and realtime collaboration all run on Redis | - | Yes | redis\://default:teable\@127.0.0.1:6379/0 |
| **Performance Cache Configuration** | | | | |
| BACKEND\_PERFORMANCE\_CACHE | Performance cache Redis URL for query result caching, improves multi-user collaboration efficiency. Recommended to use separate Redis instance from BACKEND\_CACHE\_REDIS\_URI | - | - | redis\://default:teable\@127.0.0.1:6379/0 |
| **Authentication Configuration** | | | | |
| SOCIAL\_AUTH\_PROVIDERS | List of social auth providers, comma-separated | - | - | github,google,oidc |
| BACKEND\_GITHUB\_CLIENT\_ID | GitHub OAuth client ID | - | - | github\_client\_id |
| BACKEND\_GITHUB\_CLIENT\_SECRET | GitHub OAuth client secret | - | - | github\_client\_secret |
| BACKEND\_GOOGLE\_CLIENT\_ID | Google OAuth client ID | - | - | google\_client\_id |
| BACKEND\_GOOGLE\_CLIENT\_SECRET | Google OAuth client secret | - | - | google\_client\_secret |
| BACKEND\_OIDC\_CLIENT\_ID | OIDC client ID | - | - | google\_client\_id |
| BACKEND\_OIDC\_CLIENT\_SECRET | OIDC client secret | - | - | google\_client\_secret |
| BACKEND\_OIDC\_CALLBACK\_URL | OIDC callback URL | - | - | [https://app.teable.ai/api/auth/oidc/callback](https://app.teable.ai/api/auth/oidc/callback) |
| BACKEND\_SIGNIN\_VERIFICATION\_EXPIRES\_IN | Sign-in verification code lifetime. Falls back to BACKEND\_EMAIL\_CODE\_EXPIRES\_IN when unset | 10m | - | 10m |
| BACKEND\_SIGNIN\_VERIFICATION\_MAX\_ATTEMPTS | Wrong guesses allowed per sign-in code; beyond that the code is discarded and a new one must be requested | 5 | - | 5 |
| **Security & Verification** | | | | |
| TURNSTILE\_SITE\_KEY | Cloudflare Turnstile site key for authentication verification | - | - | 1x00000000000000000000AA |
| TURNSTILE\_SECRET\_KEY | Cloudflare Turnstile secret key for authentication verification | - | - | 1x0000000000000000000000000000000AA |
| TEABLE\_SSRF\_PROTECTION\_DISABLED | Disable protection that blocks outbound requests to loopback, private, link-local, and other reserved network addresses. Set to true only in trusted self-hosted deployments that must access internal endpoints | false | - | true |
| BACKEND\_SIGNUP\_VERIFICATION\_CODE\_RATE\_LIMIT\_SECONDS | Rate limit interval (seconds) for sending signup verification emails | - | - | 30 |
| BACKEND\_TRUST\_PROXY | Reverse proxy trust setting used to resolve the client IP behind a proxy. Affects audit logs and related security records. Accepts `true`, `false`, a hop count, or an IP/CIDR/preset list. Empty trusts private-network proxies | loopback, linklocal, uniquelocal | - | loopback, linklocal, uniquelocal |
| **Email Configuration (Deprecated - Use System Admin > Instance settings > Email)** | | | | |
| BACKEND\_MAIL\_HOST | Default mail server address. We recommend configuring Notify email and Automation email visually in System Admin > Instance settings > Email | smtp.teable.ai | - | smtp.gmail.com |
| BACKEND\_MAIL\_PORT | Default mail server port | 465 | - | 465 |
| BACKEND\_MAIL\_SECURE | Whether the default mail service uses SSL/TLS | true | - | true |
| BACKEND\_MAIL\_SENDER | Default sender address | noreply.teable.ai | - | [noreply@company.com](mailto:noreply@company.com) |
| BACKEND\_MAIL\_SENDER\_NAME | Default sender name | Teable | - | Teable |
| BACKEND\_MAIL\_AUTH\_USER | Default mail server authentication username | - | - | username |
| BACKEND\_MAIL\_AUTH\_PASS | Default mail server authentication password | - | - | usertoken |
| BACKEND\_MAIL\_INVITE\_USER\_NAME\_MAX\_LENGTH | Maximum inviter name length in invitation email subjects. Empty or 0 disables truncation | - | - | 32 |
| BACKEND\_MAIL\_INVITE\_SPACE\_NAME\_MAX\_LENGTH | Maximum space or Project name length in invitation email subjects. Empty or 0 disables truncation | - | - | 32 |
| **Session/JWT Configuration** | | | | |
| BACKEND\_SESSION\_EXPIRES\_IN | Session expiration time | 7d | - | 7d |
| BACKEND\_SESSION\_COOKIE\_SECURE | Whether to secure session cookie | false | - | true |
| BACKEND\_SESSION\_ORIGIN\_CHECK\_ENABLED | Enable Origin and Fetch Metadata checks for unsafe browser session-cookie API requests. Enable only when your reverse proxy or CDN preserves these headers | false | - | false |
| BACKEND\_JWT\_EXPIRES\_IN | JWT expiration time | 20d | - | 20d |
| BACKEND\_RESET\_PASSWORD\_EMAIL\_EXPIRES\_IN | Reset password email expiration time | 30m | - | 30m |
| **Resource Limits** | | | | |
| MAX\_COPY\_CELLS | Maximum number of cells to copy in a single request | - | - | 50000 |
| MAX\_READ\_ROWS | Maximum number of rows to read in a single request | - | - | 10000 |
| MAX\_ATTACHMENT\_UPLOAD\_SIZE | Maximum attachment upload size (bytes) | - | - | 2147483648 |
| TASK\_MAX\_FIELDS\_PER\_BATCH | Maximum number of AI fields sent to the model in one batch request. Values are clamped from 1 to 20 | 5 | - | 5 |
| TASK\_MAX\_CONCURRENCY | Maximum pending AI field task runs dispatched in one scheduling cycle. Values are clamped from 1 to 20 | 5 | - | 5 |
| TABLE\_LIMIT\_FIELD\_OPTIONS\_MAX\_BYTES | Maximum serialized field option bytes | 262144 | - | 262144 |
| TABLE\_LIMIT\_SELECT\_CHOICES\_MAX | Maximum select choices per select field | 1000 | - | 1000 |
| TABLE\_LIMIT\_SELECT\_CHOICE\_NAME\_MAX\_LENGTH | Maximum select choice name length | 1000 | - | 1000 |
| TABLE\_LIMIT\_SELECT\_DEFAULT\_VALUES\_MAX | Maximum select default values | 100 | - | 100 |
| TABLE\_LIMIT\_CELL\_VALUE\_MAX\_BYTES | Maximum cell value bytes | 262144 | - | 262144 |
| TABLE\_LIMIT\_RECORD\_FIELDS\_MAX\_BYTES | Maximum serialized record fields bytes | 1048576 | - | 1048576 |
| TABLE\_LIMIT\_RECORDS\_PER\_MUTATION\_MAX | Maximum records per mutation | 20000 | - | 20000 |
| TABLE\_LIMIT\_COMPUTED\_CELL\_VALUE\_MAX\_BYTES | Maximum computed cell value bytes | 262144 | - | 262144 |
| TABLE\_LIMIT\_FORMULA\_MAX\_LENGTH | Maximum formula length | 8192 | - | 8192 |
| TABLE\_LIMIT\_TABLES\_PER\_BASE\_MAX | Maximum tables per project | 1000 | - | 1000 |
| TABLE\_LIMIT\_FIELDS\_PER\_TABLE\_MAX | Maximum fields per table | 500 | - | 500 |
| TABLE\_LIMIT\_VIEWS\_PER\_TABLE\_MAX | Maximum views per table | 100 | - | 100 |
| TABLE\_LIMIT\_CREATE\_TABLE\_FIELDS\_MAX | Maximum fields accepted when creating a table | 1000 | - | 1000 |
| TABLE\_LIMIT\_CREATE\_TABLE\_VIEWS\_MAX | Maximum views accepted when creating a table | 20 | - | 20 |
| TABLE\_LIMIT\_CREATE\_TABLE\_RECORDS\_MAX | Maximum records accepted when creating a table | 20000 | - | 20000 |
| TABLE\_LIMIT\_RECORDS\_PER\_TABLE\_MAX | Maximum rows per table. Empty means no instance-level row limit | - | - | 1000000 |
| TABLE\_LIMIT\_VIEW\_FILTER\_ITEMS\_MAX | Maximum filter items in a view | 100 | - | 100 |
| TABLE\_LIMIT\_VIEW\_FILTER\_DEPTH\_MAX | Maximum nested filter depth in a view | 5 | - | 5 |
| TABLE\_LIMIT\_VIEW\_SORT\_ITEMS\_MAX | Maximum sort items in a view | 20 | - | 20 |
| TABLE\_LIMIT\_VIEW\_GROUP\_ITEMS\_MAX | Maximum group items in a view | 3 | - | 3 |
| TABLE\_LIMIT\_VIEW\_OPTIONS\_MAX\_BYTES | Maximum serialized view option bytes | 262144 | - | 262144 |
| TABLE\_LIMIT\_NAME\_MAX\_LENGTH | Maximum display name length for supported table objects | 100 | - | 100 |
| TABLE\_LIMIT\_DESCRIPTION\_MAX\_LENGTH | Maximum description length for supported table objects | 2000 | - | 2000 |
| AUTOMATION\_MIN\_SCHEDULED\_MINUTES\_INTERVAL | Shortest interval (minutes) a scheduled trigger may use with the Minutes frequency. Set above 60 to disable minute-level schedules | 10 | - | 15 |
| AUTOMATION\_MIN\_EMAIL\_POLL\_INTERVAL\_MINUTES | Shortest mailbox poll interval (minutes) an email trigger may use | 10 | - | 15 |
| **AI & App Builder (runtime plane connection)** | | | | |
| SANDBOX\_PROVIDER | Sandbox provider for AI sessions; `opensandbox` connects to a self-hosted runtime plane | - | - | opensandbox |
| TEABLE\_INFRA\_API\_URL | Runtime plane entry URL — must be the public entry (it routes `/v1` to the sandbox engine), not an internal service address | - | - | [https://infra.teable.example.com](https://infra.teable.example.com) |
| TEABLE\_INFRA\_API\_KEY | API key shared with the runtime plane | - | - | your-infra-api-key |
| TEABLE\_INFRA\_BUCKET | Bucket for the AI workspace data plane | teable-agent | - | teable-agent |
| SANDBOX\_OPENSANDBOX\_IMAGE | Sandbox agent image **prefix without a tag** — Teable appends its own release tag so the agent always matches the app version. China deployments use the Aliyun mirror prefix | - | - | ghcr.io/teableio/teable-sandbox-agent |
| SANDBOX\_OPENSANDBOX\_RUNTIME | Sandbox engine runtime type: `kubernetes` or `docker`. Must be `docker` on Docker deployments | kubernetes | - | docker |
| SANDBOX\_OPENSANDBOX\_USE\_SERVER\_PROXY | Route sandbox endpoints through the engine's path-based proxy instead of per-port subdomains (used by Docker local mode) | false | - | true |
| APP\_DEPLOY\_PROVIDER | App Builder deployment backend; full-featured self-host uses `docker-runtime` | vercel | - | docker-runtime |
| SANDBOX\_JWT\_SECRET | Secret signing sandbox sessions. Generate a random value per host, and use the same value in the sandbox service | - | Yes | random string |
| SANDBOX\_CPU | vCPUs per sandbox (System Admin settings take precedence) | 2 | - | 2 |
| SANDBOX\_MEMORY | Memory (GiB) per sandbox (System Admin settings take precedence) | 4 | - | 4 |
| SANDBOX\_DISK | Ephemeral disk (GiB) per sandbox (System Admin settings take precedence) | 15 | - | 15 |
| **Feature Toggles** | | | | |
| RECORD\_HISTORY\_DISABLED | Whether to disable record history, defaults to false | false | - | true |
| BACKEND\_STORAGE\_COLD\_ARCHIVE\_DISABLED | Whether to stop scheduled archiving of historical data. Already-archived data stays readable | false | - | true |
| PASSWORD\_LOGIN\_DISABLED | Whether to disable password login (OAuth and OIDC still available) | false | - | true |
| V2\_TABLE\_QUERY\_OPS\_ENABLED | Collect query observations for diagnosing slow queries under **Table operations** → **Search & indexes** in System Admin; restart after changing this value | false | - | true |
| **Analytics & Monitoring** | | | | |
| OTEL\_EXPORTER\_OTLP\_ENDPOINT | OpenTelemetry OTLP endpoint | - | - | [http://jaeger:4317](http://jaeger:4317) |
| TELEMETRY\_REPORT\_DISABLED | Disable self-hosted telemetry reporting, including license compliance reports from connected instances | false | - | true |
| **Database Configuration** | | | | |
| PRISMA\_DATABASE\_URL | Database connection URL, must be configured | - | Yes | postgresql://teable:teable\@127.0.0.1:5432/teable |
| PRISMA\_TRANSACTION\_TIMEOUT | Maximum time (ms) a transaction can run before timing out. Increase for long-running transactions (e.g., bulk updates with many foreign keys) | 5000 | - | 60000 |
| PRISMA\_TRANSACTION\_MAX\_WAIT | Maximum time (ms) to wait to acquire a transaction from the pool | 2000 | - | 5000 |
| BIG\_TRANSACTION\_TIMEOUT | Timeout (ms) for large internal transactions, such as exporting large projects | 600000 | - | 1200000 |

## Secrets and rotation

Every value above marked as a secret should come from your own configuration.
The server checks them once at startup, but a missing secret never blocks
startup: Teable falls back to the default built into older versions, logs the
missing variables, and starts. Those built-in values are public, so anyone can
forge tokens or decrypt data protected by them. That is fine for a quick local
try-out and unsafe for anything else.

**Upgrading an existing deployment.** An instance that ran without these
variables was implicitly using the old built-in values, and still is. The
startup warning prints the exact block to add so current sessions, tokens, and
encrypted data keep working. Copy it as-is, restart, then plan a rotation. If
your configuration format needs it, remember to escape `$` in the values.

**New deployment.** Generate fresh values instead:

```bash theme={null}
openssl rand -base64 32
```

Use `openssl rand -hex 8` for the 16-character `*_ENCRYPTION_KEY` and
`*_ENCRYPTION_IV` slots.

> [!WARNING]
>
> The startup log also warns when a secret is explicitly set to a publicly known
> former default. The instance keeps running so your data stays reachable, but
> anyone can forge tokens or decrypt data protected by that value. Rotate it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.