Install Teable

Install teable with cloud or docker-compose

Overview

Image Edition

Teable images are available in two editions: Enterprise Edition (EE) and Community Edition (CE). To switch between versions, simply add the "-ee" suffix to the image name.

EE

Enterprise Edition is now in the preview test, mail to support@teable.io we will give a 1-month trial license

# app
ghcr.io/teableio/teable-ee:latest
# migration
ghcr.io/teableio/teable-db-migrate-ee:latest

The Enterprise Edition offers free access to all features included in the Community Edition. It also supports the use of a License to subscribe to exclusive Enterprise features, which can be reviewed on the . Data in the Enterprise Edition is compatible with the Community Edition, allowing for interchangeable switching between versions.

CE

# app
ghcr.io/teableio/teable:latest
# migration
ghcr.io/teableio/teable-db-migrate:latest

The Community Edition is an image built from open-source code and does not include any features of the Enterprise Edition. Data is compatible with the Enterprise Edition, allowing for seamless switching to the Enterprise version at any time.

Migrate from the CE

Migrating from docker-standalone to Teable Enterprise

Details


One-Click Cloud Deployment

EE

Enterprise Edition offers all of the Community Edition features for free. To activate Enterprise features:

  • Deploy and copy the Instance Id

  • Email support@teable.io with the Instance Id to get a trial LICENSE

Sealos supports deployment in China

CE

Next steps

Configure email service


Docker Compose

Requirement

Ensure your server meets the following basic requirements:

  • Operating System: Recommended to use a Linux distribution, such as Ubuntu 20.04 LTS.

  • Memory: At least 4GB RAM.

  • CPU: Minimum of 2 cores.

  • Disk Space: At least 40GB of available space.

  • Network: Stable internet connection with access to necessary ports.

Before you begin, make sure you have:

  • Basic understanding of Docker and containerization principles.

  • Docker and Docker Compose installed on your machine. Refer to the official Docker documentation for installation guides.

Install Docker

curl -fsSL https://get.docker.com | bash


# verify
docker --version
docker-compose --version

Install Teable

1. create docker-compose YAML

Enter the server, create and navigate to the teable folder

mkdir teable

cd teable

Create a docker-compose.yaml file and a .env file, then paste the following content.

vim docker-compose.yaml

Minimum dependencies**:**

docker-compose.yaml:

version: '3.9'

services:
  teable:
    image: ghcr.io/teableio/teable-ee:latest
    restart: always
    ports:
      - '3000:3000'
    volumes:
      - teable-data:/app/.assets:rw
    env_file:
      - .env
    environment:
      - NEXT_ENV_IMAGES_ALL_REMOTE=true
    networks:
      - teable
    depends_on:
      teable-db-migrate:
        condition: service_completed_successfully
      teable-cache:
        condition: service_healthy
    healthcheck:
      test: ['CMD', 'curl', '-f', 'http://localhost:3000/health']
      start_period: 5s
      interval: 5s
      timeout: 3s
      retries: 3

  teable-db:
    image: postgres:15.4
    restart: always
    ports:
      - '42345:5432'
    volumes:
      - teable-db:/var/lib/postgresql/data:rw
    environment:
      - POSTGRES_DB=${POSTGRES_DB}
      - POSTGRES_USER=${POSTGRES_USER}
      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
    networks:
      - teable
    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-ee:latest
    environment:
      - PRISMA_DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
    networks:
      - teable
    depends_on:
      teable-db:
        condition: service_healthy

  teable-cache:
    image: redis:7.2.4
    restart: always
    expose:
      - '6379'
    volumes:
      - teable-cache:/data:rw
    networks:
      - teable
    command: redis-server --appendonly yes --requirepass ${REDIS_PASSWORD}
    healthcheck:
      test: ['CMD', 'redis-cli', '--raw', 'incr', 'ping']
      interval: 10s
      timeout: 3s
      retries: 3

networks:
  teable:
    name: teable-network

volumes:
  teable-db: {}
  teable-data: {}
  teable-cache: {}

.env:

# replace the default password
POSTGRES_PASSWORD=replace_this_password
REDIS_PASSWORD=replace_this_password
SECRET_KEY=replace_this_secret_key

# replace the following with a publicly accessible address
PUBLIC_ORIGIN=http://127.0.0.1:3000

# ---------------------

# Postgres
POSTGRES_HOST=teable-db
POSTGRES_PORT=5432
POSTGRES_DB=teable
POSTGRES_USER=teable

# Redis
REDIS_HOST=teable-cache
REDIS_PORT=6379
REDIS_DB=0

# App
PRISMA_DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
BACKEND_CACHE_PROVIDER=redis
BACKEND_CACHE_REDIS_URI=redis://default:${REDIS_PASSWORD}@${REDIS_HOST}:${REDIS_PORT}/${REDIS_DB}

Adding Storage Service (Optional):

By default, Teable uses local storage to manage attachment resources. You can add MinIO or cloud storage for a more powerful and stable service.

MinIO provides an additional storage management interface (port 9001) and a more robust and stable file service.

docker-compose.yaml:

version: '3.9'

services:
  # ...previous content
  teable-storage:
    image: minio/minio:RELEASE.2024-02-17T01-15-57Z
    ports:
      - "9000:9000"
      - "9001:9001"
    environment:
      - MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY}
      - MINIO_SECRET_KEY=${MINIO_SECRET_KEY}
    volumes:
      - teable-storage:/data:rw
    networks:
      - teable
    command: server /data --console-address ":9001"
  createbuckets:
    image: minio/mc
    networks:
      - teable
    entrypoint: >
      /bin/sh -c "
      /usr/bin/mc alias set teable-storage http://teable-storage:9000 ${MINIO_ACCESS_KEY} ${MINIO_SECRET_KEY};
      /usr/bin/mc mb teable-storage/public;
      /usr/bin/mc anonymous set public teable-storage/public;
      /usr/bin/mc mb teable-storage/private;
      exit 0;
      "
    depends_on:
      teable-storage:
        condition: service_started

networks:
  teable:
    name: teable-network

volumes:
  teable-db: {}
  teable-cache: {}
  # Add an extra volume
  teable-storage: {}

.env:

# replace the default password
POSTGRES_PASSWORD=replace_this_password
REDIS_PASSWORD=replace_this_password
SECRET_KEY=replace_this_secret_key

# if enabled https please replace it
PROTOCAL=http
# Please set PUBLIC_HOST to the IP address or domain name of the currently deployed host. You cannot use localhost or 127.0.0.1.
PUBLIC_HOST=192.168.x.x
# Please modify the final port to the port of the official access address. If it's 80 or 443, you can remove the : and port number.
PUBLIC_ORIGIN=${PROTOCAL}://${PUBLIC_HOST}:3000

# ---------------------

# Postgres
POSTGRES_HOST=teable-db
POSTGRES_PORT=5432
POSTGRES_DB=teable
POSTGRES_USER=teable

# Redis
REDIS_HOST=teable-cache
REDIS_PORT=6379
REDIS_DB=0


# Minio
MINIO_ACCESS_KEY=teable_minio_access
MINIO_SECRET_KEY=${SECRET_KEY}

# App
PRISMA_DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
BACKEND_CACHE_PROVIDER=redis
BACKEND_CACHE_REDIS_URI=redis://default:${REDIS_PASSWORD}@${REDIS_HOST}:${REDIS_PORT}/${REDIS_DB}
BACKEND_STORAGE_PROVIDER=minio
BACKEND_STORAGE_PUBLIC_BUCKET=public
BACKEND_STORAGE_PRIVATE_BUCKET=private
BACKEND_STORAGE_MINIO_USE_SSL=false # if https enabled please change it to true
BACKEND_STORAGE_MINIO_ENDPOINT=${PUBLIC_HOST}
BACKEND_STORAGE_MINIO_PORT=9000
BACKEND_STORAGE_MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY}
BACKEND_STORAGE_MINIO_SECRET_KEY=${MINIO_SECRET_KEY}
BACKEND_STORAGE_MINIO_INTERNAL_ENDPOINT=teable-storage
BACKEND_STORAGE_MINIO_INTERNAL_PORT=9000
STORAGE_PREFIX=${PROTOCAL}://${PUBLIC_HOST}:${BACKEND_STORAGE_MINIO_PORT}

Starting the Application

Execute the application launch command in the current directory. Once the startup is complete, access 127.0.0.1:3000 to enter the application.

Note that if HTTPS is not configured, you won't be able to use the copy and paste functions within the tables.

docker-compose pull

docker-compose up -d

Using a Hosted Database (Optional)

If you wish to use a hosted database, you can further streamline the deployment process:

  1. Remove services.teable-db

  2. Remove service.teable-db-migrate.depends_on

  3. Remove volumes.teable-db

  4. Update the .env file, replacing it with the configuration for your hosted database

Full example

docker-compose.yaml

version: '3.9'

services:
  teable:
    image: ghcr.io/teableio/teable-ee:latest
    restart: always
    ports:
      - '3000:3000'
    env_file:
      - .env
    environment:
      - NEXT_ENV_IMAGES_ALL_REMOTE=true
    networks:
      - teable
    depends_on:
      teable-db-migrate:
        condition: service_completed_successfully
      teable-cache:
        condition: service_healthy
    healthcheck:
      test: ['CMD', 'curl', '-f', 'http://localhost:3000/health']
      start_period: 5s
      interval: 5s
      timeout: 3s
      retries: 3

  teable-db-migrate:
    image: ghcr.io/teableio/teable-db-migrate-ee:latest
    environment:
      - PRISMA_DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
    networks:
      - teable

  teable-cache:
    image: redis:7.2.4
    restart: always
    expose:
      - '6379'
    volumes:
      - teable-cache:/data:rw
    networks:
      - teable
    command: redis-server --appendonly yes --requirepass ${REDIS_PASSWORD}
    healthcheck:
      test: ['CMD', 'redis-cli', '--raw', 'incr', 'ping']
      interval: 10s
      timeout: 3s
      retries: 3
networks:
  teable:
    name: teable-network
    driver: bridge

volumes:
  teable-cache: {}

.env

Fill in the database parameters with the connection parameters for your hosted database.

POSTGRES_HOST=your-database.com
POSTGRES_PORT=5432
POSTGRES_DB=teable
POSTGRES_USER=teable

Note that 127.0.0.1 is the internal network of the container. If you want to connect to a database deployed on your local machine, do not use 127.0.0.1 for POSTGRES_HOST. Instead, use host.docker.internal as the local address, otherwise, the connection will fail.

The same principle applies if you're using an externally hosted Redis:

  • Remove service.teable-cache

  • Remove service.teable.depends_on.teable-cache

  • Remove volumes.teable-cache

  • Update the .env file, replacing it with the configuration for your hosted Redis

Next steps

Configure email service

Configure external database connection for base


Enabling email service

Enabling the email service allows for in-site email notifications, user self-service password changes, and other features. Please configure the following environment variables according to your email service provider's information to enable the email service:

BACKEND_MAIL_HOST=mail.example.com
BACKEND_MAIL_PORT=465
BACKEND_MAIL_SECURE=true
BACKEND_MAIL_SENDER=noreply@company.com
BACKEND_MAIL_SENDER_NAME=noreply
BACKEND_MAIL_AUTH_USER=username
BACKEND_MAIL_AUTH_PASS=usertoken

Enabling external database connection for base

Teable can automatically create database roles within the application to allow secure access to table data from external applications. To enable this feature, you need to additionally configure the PUBLIC_DATABASE_PROXY environment variable.

This parameter should be set to an externally accessible database IP or domain + port number. If you're using the docker-compose deployment method mentioned earlier, the external access port would be 45432. For other deployment methods, please configure according to your specific setup.

PUBLIC_DATABASE_PROXY=db-proxy.example.com:port

Environment variables

Environment variables table


Support and Feedback

If you encounter any issues during the deployment process, please contact our support team at support@teable.io or submit an issue.

License

The Teable Community Edition is open-source under the AGPL-3.0 license. For the Enterprise Edition, please contact us to obtain a commercial license.

Last updated