Log inSign up

A self-hosted Chatwoot inbox for customer conversations

Download Chatwoot's .env.example and docker-compose.production.yaml, set SECRET_KEY_BASE, FRONTEND_URL and the PostgreSQL and Redis passwords, then run docker compose run --rm rails bundle exec rails db:chatwoot_prepare followed by docker compose up -d. The Rails app listens on 127.0.0.1:3000; Nginx adds HTTPS and forwards the /cable WebSocket for live chat. Plan on 4 GB of memory.

Topic: Self-hosted apps · Tested on: Ubuntu 24.04 and 22.04, Debian 12 and 13 · Updated 2026-12-03

What does a Chatwoot server need?

Chatwoot runs a Rails web process, Sidekiq background workers, PostgreSQL (with the pgvector extension) and Redis. Together they want 2 vCPU and 4 GB of memory for a small support team, plus disk for attachments. Before you begin:

  • Install Docker and Compose using Docker Engine, or deploy the Docker app image.
  • Create chat.example.net with A and AAAA records for 198.51.100.24 and 2001:db8:4f2a::24.
  • Have SMTP relay details ready for notifications and email replies.
docker --version && docker compose version
df -h /

How do you download and edit the configuration?

The project maintains a production compose file and an example environment; fetch both into a fresh directory.

mkdir -p ~/chatwoot && cd ~/chatwoot
curl -fsSLo .env https://raw.githubusercontent.com/chatwoot/chatwoot/develop/.env.example
curl -fsSLo docker-compose.yaml https://raw.githubusercontent.com/chatwoot/chatwoot/develop/docker-compose.production.yaml
openssl rand -hex 64     # SECRET_KEY_BASE
openssl rand -hex 24     # database password
openssl rand -hex 24     # Redis password
nano .env

Change these lines in .env:

SECRET_KEY_BASE=paste-the-64-byte-hex
FRONTEND_URL=https://chat.example.net
FORCE_SSL=true
ENABLE_ACCOUNT_SIGNUP=false
POSTGRES_HOST=postgres
POSTGRES_USERNAME=postgres
POSTGRES_PASSWORD=paste-database-password
REDIS_URL=redis://redis:6379
REDIS_PASSWORD=paste-redis-password
ACTIVE_STORAGE_SERVICE=local

Then open docker-compose.yaml and put the same database password into the POSTGRES_PASSWORD line of the postgres service. Check that the rails service publishes 127.0.0.1:3000:3000; the stock file does this, which keeps the app off the public interface.

How do you initialise the database and start the stack?

Run the prepare task once to create and migrate the database, then start every service.

cd ~/chatwoot
docker compose run --rm rails bundle exec rails db:chatwoot_prepare
docker compose up -d
docker compose ps
curl -sI http://127.0.0.1:3000/api | head -n 1
curl -s http://127.0.0.1:3000/api; echo

The /api endpoint returns a short JSON document that includes the installed version, which doubles as a health check. All of rails, sidekiq, postgres and redis should be running.

How do you configure Nginx, HTTPS and the firewall?

Use a server block that upgrades WebSocket connections and turns off buffering, so new messages reach agents instantly.

server {
    listen 80;
    listen [::]:80;
    server_name chat.example.net;
    client_max_body_size 40M;
    underscores_in_headers on;
    location / {
        proxy_pass http://127.0.0.1:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Ssl on;
        proxy_buffering off;
        proxy_read_timeout 300s;
    }
}
sudo apt install -y nginx certbot python3-certbot-nginx
sudo nano /etc/nginx/sites-available/chatwoot     # paste the block
sudo ln -s /etc/nginx/sites-available/chatwoot /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx
sudo certbot --nginx -d chat.example.net
sudo ufw allow OpenSSH && sudo ufw allow 'Nginx Full' && sudo ufw enable

The underscores_in_headers line lets the mobile apps pass their auth headers. With Caddy, a single reverse_proxy 127.0.0.1:3000 inside the site block covers WebSockets too (Caddy HTTPS).

How do you create the first account and add a website widget?

Open https://chat.example.net; a fresh install shows an onboarding form that creates the first administrator and account. Because ENABLE_ACCOUNT_SIGNUP=false, nobody else can register; invite agents from Settings, Agents. To add live chat to your site, go to Settings, Inboxes, Add Inbox, Website, enter the site name and domain, and copy the script snippet into your pages. The platform-wide super admin console lives at /super_admin for instance settings.

How do you set up outgoing email?

Add relay settings to .env and recreate the containers:

MAILER_SENDER_EMAIL=Support <support@example.net>
SMTP_DOMAIN=example.net
SMTP_ADDRESS=smtp.relay.example.net
SMTP_PORT=587
SMTP_USERNAME=relay-user
SMTP_PASSWORD=relay-password
SMTP_AUTHENTICATION=login
SMTP_ENABLE_STARTTLS_AUTO=true
docker compose up -d

The authenticated relay on 587 is the route that works reliably. Port 25 for direct delivery may be closed on a new server; ask support in a ticket before planning on it. SMTP relay for apps covers SPF and DKIM. Receiving customer emails into an inbox is a separate feature (IMAP or inbound forwarding) set up per email inbox.

How do you back up and upgrade Chatwoot?

Dump the whole PostgreSQL instance and archive the storage volume that holds attachments, then keep .env with the backups.

cd ~/chatwoot
docker compose exec -T postgres pg_dumpall -U postgres | gzip > chatwoot-db-$(date +%F).sql.gz
docker volume ls | grep chatwoot

To upgrade, pull new images, run the prepare task (it applies pending migrations) and recreate:

docker compose pull
docker compose run --rm rails bundle exec rails db:chatwoot_prepare
docker compose up -d
curl -s http://127.0.0.1:3000/api; echo

The version in the JSON output confirms the upgrade. Server-level daily backups add a second safety net.

Which issues are typical, and how are they fixed?

  • Messages appear only after a reload: the /cable WebSocket is not upgraded; confirm the Upgrade and Connection headers.
  • Emails never send: Sidekiq handles mail, so read docker compose logs sidekiq --tail 50 for SMTP errors.
  • Containers restart under load: memory is short; check docker stats and the usage graphs.
  • Wrong links in emails: FRONTEND_URL is not the HTTPS address.

Plans that fit this guide

Base city prices. Every plan includes a dedicated IPv4 address, IPv6, full root and all 18 images.

All prices
PlanFits becauseSizeMonthlyOrder from
A2-4a small support team2 vCPU, 4 GB RAM, 100 GB NVMe$14.40/mo$43.20 for 3 months
A4-8busy inboxes and many agents4 vCPU, 8 GB RAM, 180 GB NVMe$28.80/mo$86.40 for 3 months

Questions about Chatwoot support inbox

Which channels can Chatwoot handle?

Website live chat, email, API inboxes and several messaging platforms, each added as an inbox. Some channels need accounts and API keys from the platform involved.

Is there a non-Docker install?

Yes, Chatwoot offers a Linux install script for Ubuntu that sets everything up natively. Docker keeps upgrades and rollbacks simpler.

Can agents use a mobile app?

Yes. The Chatwoot mobile apps connect to a self-hosted instance by entering its URL.

Where are attachments stored?

With ACTIVE_STORAGE_SERVICE=local they sit in the storage volume on the server. Chatwoot can also use an S3-compatible bucket.

How do I turn signups back on?

Set ENABLE_ACCOUNT_SIGNUP=true in .env and run docker compose up -d. Most teams leave it off and invite agents instead.