As of March 18, the default environment configuration template has been updated to the following:
TIMEZONE=UTC
# Postgres configuration
POSTGRES_HOST=teable-db
POSTGRES_PORT=5432
POSTGRES_DB=example
POSTGRES_USER=example
POSTGRES_PASSWORD=example-password
# Backend application configuration
PUBLIC_ORIGIN=http://127.0.0.1
PRISMA_DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
PUBLIC_DATABASE_PROXY=127.0.0.1:42345
# Uncomment and modify below to enable email functionality
#BACKEND_MAIL_HOST=smtp.teable.io
#BACKEND_MAIL_PORT=465
#BACKEND_MAIL_SECURE=true
#BACKEND_MAIL_SENDER=noreply.teable.io
#BACKEND_MAIL_SENDER_NAME=Teable
#BACKEND_MAIL_AUTH_USER=username
#BACKEND_MAIL_AUTH_PASS=password
Always check the latest official documentation for the most up-to-date configuration when self-hosting: https://github.com/teableio/teable/tree/develop/dockers/examples/standalone
Below is a working example env.txt configuration for self-hosting on a Synology NAS:
TIMEZONE=Asia/Shanghai
# Postgres configuration
POSTGRES_HOST=teable-db
POSTGRES_PORT=5432
POSTGRES_DB=example
POSTGRES_USER=example
POSTGRES_PASSWORD=standalone_replace_me
# Backend application configuration
PUBLIC_ORIGIN=http://192.168.0.197:3091
PRISMA_DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
PUBLIC_DATABASE_PROXY=192.168.0.197:42345
# Uncomment and modify below to enable email functionality
#BACKEND_MAIL_HOST=smtp.teable.io
#BACKEND_MAIL_PORT=465
#BACKEND_MAIL_SECURE=true
#BACKEND_MAIL_SENDER=noreply.teable.io
#BACKEND_MAIL_SENDER_NAME=Teable
#BACKEND_MAIL_AUTH_USER=username
#BACKEND_MAIL_AUTH_PASS=password
In this example, 192.168.0.197 is the local IP address of the Synology NAS host.
Docker Compose Installation
Teable requires 3 linked containers to run, so we use Docker Compose for deployment. Save the following content as docker-compose.yml:
version: '3.9'
services:
teable-app:
image: ghcr.io/teableio/teable:latest
container_name: teable-main-app
restart: always
ports:
- '3091:3000'
volumes:
- ./data:/app/.assets:rw
env_file:
- env.txt
environment:
- TZ=${TIMEZONE}
- NEXT_ENV_IMAGES_ALL_REMOTE=true
depends_on:
- teable-db-migrate
teable-db:
image: postgres:15
container_name: teable-postgres
restart: always
ports:
- '42345:5432'
volumes:
- ./db:/var/lib/postgresql/data:rw
environment:
- TZ=${TIMEZONE}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
healthcheck:
test: ['CMD-SHELL', "sh -c 'pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}'"]
interval: 10s
timeout: 3s
retries: 3
teable-db-migrate:
image: ghcr.io/teableio/teable-db-migrate:latest
container_name: teable-db-migration
environment:
- TZ=${TIMEZONE}
- PRISMA_DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@teable-db:5432/${POSTGRES_DB}
depends_on:
- teable-db
Run the following commands to set up and start the service:
# Create project directory and subdirectories
mkdir -p /volume1/docker/teable/{data,db}
# Enter the project directory
cd /volume1/docker/teable
# Place your env.txt and docker-compose.yml in this directory
# Start all containers in detached mode
docker-compose --env-file env.txt up -d
HTTPS Requirement
HTTPS is mandatory for account registration, otherwise you will encounter a 500 Internal Server Error during sign up. Two commmon solutions for self-hosting without a public static IP are:
- Tailscale + Nginx Proxy Manager
- Cloudflared Tunnel + Nginx Proxy Manager
An example reverse proxy configuration is shown below:
| Domain | Local Address | Note |
|---|---|---|
teable.your-domain.com |
http://192.168.0.197:3091 |
Teable public access address |
First Run
Wait a few minutes for the first launch to complete all initial setup. Navigate to your domain in the browser to register your admin account. Note that while registration requires HTTPS, you can access the instance via local HTTP after registration is complete. If you encounter errors when registering over HTTP, you will see the following message in your browser developer console: The Cross-Origin-Opener-Policy header has been ignored, because the URL's origin was untrustworthy. It was defined either in the final response or a redirect. Please deliver the response using the HTTPS protocol. You can also use the 'localhost' origin instead.
After logging in for the first time, a default workspace is already created for you, with an interactive guide to introduce the core features.
To create a new database, you can start with an empty database. A step-by-step guide will walk you through creating your first table. You can click the + button in the left sidebar to create a new table, and import data directly from an Excel file.
Teable has built-in Chinese language support, making it easy for new users to get started.
References
- Official Teable source code: https://github.com/teableio/teable
- Official Teable website: https://teable.io/
- Official standalone deployment example: https://github.com/teableio/teable/tree/develop/dockers/examples/standalone