Chathouse

How to self-host Chathouse

Get Chathouse running on your own server with Docker Compose.

Chathouse supports self-hosting via Docker. You can run Chathouse on your own server or on a cloud provider of your choice. It's easy to set up and maintain, no need to be a Docker expert.

Prerequisites

  • A server (or local machine) with Docker and Docker Compose installed
  • At least 2 GB of RAM is recommended for the best performance
  • An API key from at least one provider: OpenAI, Anthropic, or Google

You don't need API keys to deploy, but you'll need to add them through the web UI after your first login in order to use the chat.

Installation

Clone the self-hosting repository

Download the self-hosting repository from GitHub.

git clone https://github.com/ChathouseHQ/selfhosting
cd selfhosting

The repository contains a compose.yaml file with all the necessary configuration to run Chathouse.

compose.yaml
.env.example
config

Create your environment file

cp .env.example .env

Configure required variables

Open .env and set the two required variables:

SECRET_KEY_BASE — a master secret used to derive encryption keys. Generate one with:

openssl rand -base64 32

CLIENT_URL — the public URL where Chathouse will be accessible:

SECRET_KEY_BASE="paste-generated-value-here"
CLIENT_URL="https://chat.yourdomain.com"

If you're running locally, use http://localhost (or whichever port you've configured).

Both variables are required. docker compose up will refuse to start without them.

You can also configure the database, SMTP server, and other optional services by following the configuration reference.

Start Chathouse

docker compose up -d

This pulls the images and starts five containers:

ContainerPurpose
nginxReverse proxy (port 80)
appThe web application
workerBackground job processor for AI responses
mariadbMariaDB database
redisRedis for sessions and job queuing

First startup takes a few minutes while Docker pulls the application images. Subsequent starts are near-instant.

Create your account

Open http://your-server-ip in your browser and register your account.

Registration automatically closes after the first user signs up. Chathouse is designed as a single-user (or small team) application.

Connect your AI providers

Navigate to Settings > Connections and add API keys for the providers you want to use:

Your API keys are encrypted at rest using a key derived from SECRET_KEY_BASE before being stored in the database.

Updating

To update to the latest version:

cd selfhosting
git pull
docker compose pull
docker compose up -d

Your data is persisted in Docker volumes (mariadb_data, redis_data, uploads_data) and survives container updates.

Backups

The important data lives in two Docker volumes:

  • mariadb_data — all your chats, user data, and settings
  • uploads_data — uploaded files

To back up the database:

docker compose exec mariadb mariadb-dump -u chathouse -pchathouse chathouse > backup.sql

To restore:

docker compose exec -T mariadb mariadb -u chathouse -pchathouse chathouse < backup.sql

Troubleshooting

Containers won't start

Check the logs:

docker compose logs -f

The most common issue is a missing SECRET_KEY_BASE in your .env file.

Database connection errors

Make sure the MariaDB container is healthy before the app starts. The compose file handles this automatically with healthchecks, but if you're seeing connection errors, wait a moment and try again:

docker compose restart app worker

Resetting everything

To wipe all data and start fresh:

docker compose down -v
docker compose pull
docker compose up -d

The -v flag deletes all Docker volumes, including your database and uploads. This is irreversible.

On this page