Skip to content

Deploying a Typebot App

Introduction

Typebot lets you build conversational flows and embed them anywhere. This guide shows how to containerize Typebot with a Dockerfile, connect it to PostgreSQL and Redis, add optional storage, and deploy it to Klutch.sh over HTTP.

Prerequisites

  • GitHub repository containing your Dockerfile.
  • PostgreSQL database (managed or deployed separately).
  • Redis instance for cache/queues.
  • Klutch.sh project ready in klutch.sh/app.

Project structure

.
└── Dockerfile

Sample Dockerfile

FROM baptistearno/typebot:latest
# Default port
ENV PORT=3000
EXPOSE 3000

Required environment variables

  • DATABASE_URL – PostgreSQL connection string, e.g., postgres://USER:PASSWORD@HOST:PORT/DB
  • REDIS_URL – Redis connection string, e.g., redis://:PASSWORD@HOST:6379
  • NEXTAUTH_URL – public URL, e.g., https://example-app.klutch.sh
  • NEXTAUTH_SECRET – strong secret for sessions
  • ENCRYPTION_SECRET – strong secret for flow encryption
  • PORT – internal port (default 3000)

Optional environment variables

  • STORAGE_LOCAL – set to true to store assets locally.
  • STORAGE_BUCKET / STORAGE_ENDPOINT / STORAGE_ACCESS_KEY_ID / STORAGE_SECRET_ACCESS_KEY – if using S3-compatible storage.
  • NODE_ENV=production

Persistence

If using local storage, attach a volume:

  • Mount path: /app/storage
  • Size: based on expected assets/exports

Networking

  • Protocol: HTTP
  • Internal port: 3000
  • Users reach https://example-app.klutch.sh while Klutch.sh routes to port 3000 inside the container.
Terminal window
curl -I http://localhost:3000

Deployment on Klutch.sh

  1. Push your Dockerfile to GitHub.
  2. In klutch.sh/app, create a new app and select GitHub as the source.
  3. Klutch.sh automatically detects the Dockerfile in the repository root.
  4. Choose HTTP traffic and set the internal port to 3000.
  5. Add environment variables for DATABASE_URL, REDIS_URL, NEXTAUTH_URL, NEXTAUTH_SECRET, and ENCRYPTION_SECRET. Mark secrets as sensitive.
  6. Optionally attach a persistent volume at /app/storage if storing assets locally.
  7. Deploy. After the app starts, sign in and create your first bot.

Verification

  • UI: open https://example-app.klutch.sh and confirm the dashboard loads.

  • Quick API check (if applicable):

    Terminal window
    curl -I https://example-app.klutch.sh

Next steps

  • Configure custom domains and email providers.
  • Enable object storage for better scalability if you handle large assets.
  • Set up backups for PostgreSQL and Redis snapshots.