
Typebot is an open-source, visually-driven conversational form and chatbot builder. It serves as a self-hosted alternative to hosted form and chatbot builders, giving you full data ownership and control over integrations and embedding.
This article explains how to deploy Typebot on a Linux server using Docker Compose with PostgreSQL, Redis, and Traefik for reverse proxy and TLS termination.
Before you begin, you need to:
sudo privileges.builder.example.com and viewer.example.com.To prevent data loss during container restarts or updates, the deployment relies on host-mounted volumes for PostgreSQL, Redis, and TLS certificates. Docker Compose reads secrets, URLs, and credentials from a .env file in the project directory and substitutes them into the service definitions at startup.
Create a project directory for the Typebot deployment.
The command creates four subdirectories:
pgdata: Persists PostgreSQL database files.redisdata: Stores Redis data used by Typebot's Redis-backed features, such as sign-in rate limiting and media uploads.letsencrypt: Stores Traefik ACME certificates for automatic HTTPS renewal.data: Stores Mailpit local email data.Navigate to the project directory.
Generate a strong random encryption secret that is used to encrypt sensitive data such as credentials and bot content.
Copy the output. Use this value for the ENCRYPTION_SECRET variable in the next steps when creating the .env file.
Store this value securely and never change it once the deployment starts handling real data. Typebot uses ENCRYPTION_SECRET to encrypt stored credentials, and rotating it makes any previously encrypted data unreadable.
Create a .env file to store the environment variables.
Add the following variables.
DEFAULT_WORKSPACE_PLAN=UNLIMITED applies the unlimited plan to every new workspace, not only the administrator's. Signup stays open until later in this guide, so anyone who registers during that window also receives an unlimited workspace.
Replace the following:
builder.example.com and viewer.example.com with your actual domains pointing to the server.admin@example.com with your email for Let's Encrypt and admin access.YOUR_GENERATED_SECRET with the output from the openssl command.STRONG_DATABASE_PASSWORD with a secure password for PostgreSQL.YOUR_SMTP_USERNAME with your username.YOUR_SMTP_PASSWORD with a strong, secure password for your mail.notifications@example.com in NEXT_PUBLIC_SMTP_FROM with a sender address on your own domain.Save and close the file.
Docker Compose orchestrates the full Typebot stack: Traefik for reverse proxy and HTTPS, PostgreSQL for persistent storage, Redis for sessions and caching, the Builder and Viewer services, and Mailpit for email. This configuration is adapted from the official Typebot Docker setup to use Traefik and persistent volumes.
Create the Docker Compose manifest.
Add the following content:
traefik
LETSENCRYPT_EMAIL../letsencrypt directory.postgres
.env file../pgdata directory on the host.redis
./redisdata directory.typebot-builder
.env file.typebot-viewer
.env file.mailpit
127.0.0.1 so it is not exposed publicly.8025 and the SMTP service on port 1025 locally../data directory.http://localhost:8025 via an SSH tunnel after deployment.Mailpit only captures mail locally. It never delivers to a real inbox, so it is not a production email path. To send real email, either request that Vultr unblock outbound port 25 on this instance and self-host a mail delivery service such as Postal, pointing SMTP_HOST, SMTP_PORT, SMTP_USERNAME, and SMTP_PASSWORD at it, or route outbound mail through an authenticated relay on port 587 or 465. Outbound port 25 is blocked by default on new Vultr instances. See Why Is SMTP Blocked? before choosing a self-hosted mail path.
Save and close the file.
Validate the syntax of the file.
Start the services in detached mode.
Verify that the containers are running and healthy.
All six containers should show a status of Up, with mailpit, typebot-postgres, and typebot-redis also showing (healthy).
View the logs for the Builder service to ensure it connected successfully to the database and Redis.
View the logs for the Viewer service to ensure it connected successfully to the database and Redis.
Typebot requires email-based verification instead of a password for the first sign-in, which this deployment routes through Mailpit. This section confirms the administrator account, verifies that both the Builder and Viewer domains are reachable, and closes public registration.
Open your web browser and navigate to the Builder domain using HTTPS.
Replace builder.example.com with the actual domain you set in the .env file for the Builder.
Sign in with the email address defined in the ADMIN_EMAIL variable. A six-digit verification code is sent to your Mailpit email server.
Because Mailpit is bound to 127.0.0.1 and not exposed publicly, access its web interface by setting up an SSH local port forwarding tunnel from your local terminal.
Replace USERNAME with your server's username and YOUR_SERVER_IP with your server's IP. If your server uses key-based SSH authentication, add -i /path/to/your-private-key before -N. The -N flag tells SSH to only forward the port instead of opening a remote shell.
Open your local web browser and navigate to the Mailpit inbox at http://localhost:8025.
Open the Mailpit inbox and copy the verification code sent by Typebot.
Return to the Builder tab and enter the code to complete sign-in.
Return to the terminal running the SSH tunnel and press Ctrl + C to close it, since Mailpit access is no longer needed until the next sign-in.
Open the Viewer domain in a new tab.
Replace viewer.example.com with the domain you configured in the .env file.
Click the dashboard link on the Viewer page to verify that it opens the Builder interface.
Open your .env file to disable public registrations now that your admin account is created.
Update the signup configuration.
Save and close the file, then apply the changes to the Builder container.
This prevents unauthorized users from registering new accounts on your public Builder instance.
Typebot publishes each bot as a hosted page on the Viewer domain and provides a JavaScript snippet that embeds that page into any website. Publishing a bot makes it reachable at that public link before you add it to a page.
In the Builder tab still open from the previous section, click Create a typebot.
Select Start from scratch to create a new bot manually.
From the top left corner, change the typebot name to your preferred title, for example, My first bot.
In the visual editor, drag a Text bubble block onto the canvas and enter a welcome message, for example, "Hello! How can I help you today?"
Drag a connection line from the Start block's output dot to the Text bubble block so the flow begins there.
Drag an Input block, for example Text, and connect it to the previous block.
Click Publish in the top-right corner.
Under Embed your typebot, click Iframe.
Copy the <iframe> snippet shown in the dialog.
Open the main HTML file of your sample website or any page where you want to add the bot.
Paste the snippet just before the closing </body> tag.
Replace viewer.example.com/your-bot-id with the link shown in the Iframe dialog.
Save the file and open your website in a browser to test the bot.
Return to the Typebot Builder, open the Results tab, and verify that responses are being captured.
Typebot's built-in templates route respondents through a Choice input block, so each button ends its own path through the flow instead of all leading to the same message. The Results tab records which option a respondent picked as its own column, alongside any text or email fields the flow collects.
You have deployed a self-hosted Typebot instance with Docker Compose, PostgreSQL, Redis, and Traefik for automatic HTTPS, with separate Builder and Viewer services on their own domains. For more information, see the official Typebot documentation.
0 Comments
Be the first to comment and share your perspective with the community.