To learn more about TypingMind Team Self-host version, visit https://custom.typingmind.com/self-host
Installation Instructions
To setup a self-host instance, you will need the following:- A server that support Docker.
- MySQL 8.x for storing data.
- An SMTP credential for sending emails.
Step 1: Prepare a MySQL database
Use any database hosting provider that support MySQL 8.x. Requirements:- MySQL 8.x
- At least 1 dedicated CPU
- At least 4GB of RAM
Step 2: Prepare SMTP credentials
The self-host instance uses SMTP to send emails (i.e., login OTP). You can use any SMTP provider. The only requirement is that it must support secure email transport (TLS) via port465 or 587. If you are using a self-signed certificate for your SMTP server, you need to set the SMTP_ALLOW_SELF_SIGNED_CERTIFICATE environment variable to 1.
Step 3: Prepare Environment Variables
Before going to the next step, make sure you have all of these environment variables ready. Hostname: the hostname where you intend to deploy the app to.ssl, timezone,namedPlaceholders), in the connection string as shown below.
--require_secure_transport=ON.), add ssl={"rejectUnauthorized":true} to the URL parameter. Then add this additional environment variable:
APP_CLOUD_EMAIL_DOMAIN hostname, otherwise, emails may land in users’ Spam folder.
SMTP_ALLOW_SELF_SIGNED_CERTIFICATE environment variable to 1.
1.
Step 4: Deploy with Docker
Connect this repository to your hosting provider to start the deployment. Here are some relevant details to help you with the setup: Hardware requirements:- At least 1 dedicated CPU
- At least 4GB of RAM
ghcr.io/typingmind/tm-self-host:latest. To run the docker image, use the following command (change the 12151 port and the environment variables to your own):
Step 5: Verify your deployment
The HTTP server will run on the specified port number based on thePORT environment variable set by your hosting provider.
To verify that the app is running properly, send a request to the HTTP server (by visiting the hostname URL). If the request hit the server, you will see this log in the server’s output:
/setup URL to set up your instance.
Receiving Updates
To receive new updates, pull the docker image again from our official registry atghcr.io/typingmind/tm-self-host:latest
Changelog can be viewed from the Admin panel or you can see it online here:
https://www.typingmind.com/changelog
Recommended modules
Blob Storage
Blob Storage module is required if you want to use attachments features (upload images, files, documents). TypingMind can be connected to a S3-compatible bucket for better storing files. When connected, TypingMind will use the S3-compatible bucket for storing various files during its operation like user chat attachments, admin-user uploaded files, support faster user data sync, and other purposes. To connect the app to a S3-compatible bucket, set the following environment variables:- Standard object operation: HeadObject, ListObjects, GetObject, PutObject, DeleteObject.
- Signed requests: GET and PUT.
- CORS configuration that allow TypingMind to call the service API from the browser.
Optional modules
Enable metrics tracking
Metrics tracking can be enable by setting theDB_TRACK_METRICS:
tbl_metrics table in your database and can be synced to your data warehouse for analytics.
The metric payload is a schema-less JSON object contains useful information like: token usage, user, AI agent used, etc.
Enable background cron jobs
Cron jobs are required for some features like sending daily/weekly report emails, cleaning up expired data, etc. To enable cron jobs, set theCRON_SECRET environment variable to a secure secret string.
Custom SMTP email settings
UseSMTP_SENDER_ADDRESS to customize the sender address of the email sent by the app. By default, it uses no-reply@${APP_CLOUD_EMAIL_DOMAIN}.
DISABLE_SMTP_SECURE to disable secure connection to SMTP server. This is useful in some cases where your SMTP server needs the connection to be created on insecure mode then upgrade to secure mode at a later step.
Knowledge Base
Knowledge Base is an optional module that provide RAG (retrieval-augmented generation) processing pipeline TypingMind. This module can only be enabled when:- You are using the pre-built TypingMind Docker image provided above.
- Your TypingMind instance must be served over secure HTTPS connection.
OPENAI_API_KEY is used to access the OpenAI API.
The PG_DATABASE_URL is a connection strings to a PostgreSQL database with the following requirements:
- PostgreSQL version 16.x
- Must support
pgvectorextension for storing vector embeddings. - At least 1 dedicated CPU, recommended at 2 dedicated CPUs.
- At least 4GB of RAM, recommended at 8GB of RAM.
- At least 30GB of storage space, recommended at 100GB of storage space.
Example deployment with docker compose
Below is an exampledocker-compose.yml file that you can use to deploy TypingMind with Docker Compose with minimal environment variables set.
docker-compose.yml file will create 4 services, including the Blob Storage module. You can run this file by running the following command in the same directory as the file: