On this page
- What does a Chatwoot server need?
- How do you download and edit the configuration?
- How do you initialise the database and start the stack?
- How do you configure Nginx, HTTPS and the firewall?
- How do you create the first account and add a website widget?
- How do you set up outgoing email?
- How do you back up and upgrade Chatwoot?
- Which issues are typical, and how are they fixed?
- Questions
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.netwith A and AAAA records for198.51.100.24and2001: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 .envChange 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=localThen 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; echoThe /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 enableThe 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=truedocker compose up -dThe 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 chatwootTo 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; echoThe 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
/cableWebSocket is not upgraded; confirm the Upgrade and Connection headers. - Emails never send: Sidekiq handles mail, so read
docker compose logs sidekiq --tail 50for SMTP errors. - Containers restart under load: memory is short; check
docker statsand the usage graphs. - Wrong links in emails:
FRONTEND_URLis 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.
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.
More in Self-hosted apps
- Nextcloud on Nginx
- ownCloud Infinite Scale
- Seafile file sync
- Vaultwarden password vault
- Passbolt team password manager
- Gitea Git hosting
- Forgejo Git server
- GitLab Community Edition
- Gogs Git service
- Wiki.js
- BookStack documentation
- Outline knowledge base
- Paperless-ngx documents
- n8n workflow automation
- Activepieces automation
- Plausible Analytics (Community Edition)
- Umami analytics
- Mattermost team chat
- Matrix Synapse with Element
- Jitsi Meet video calls
- ONLYOFFICE Docs with Nextcloud
- HashiCorp Vault secrets server
- OpenBao secrets management
- Infisical secrets manager
- Authelia SSO and forward auth
- Zitadel identity platform
- VS Code in the browser (code-server)
- Joplin Server for notes sync
- Firefly III personal finance
- Snipe-IT asset tracking
- Odoo ERP on Ubuntu or Debian
- ERPNext with frappe_docker
- Dolibarr ERP and CRM with Nginx
- Penpot design tool with Docker
- Planka kanban boards
- Leantime project management
- Wekan boards with Docker
- Cal.com scheduling
- Mautic marketing automation
- DocuSeal document signing
- Metabase dashboards
- Appwrite backend server
- Self-hosted Supabase
- PocketBase backend
- RustDesk relay server
- Traccar GPS tracking
- Redmine project tracker
- The Lounge IRC client
- CyberChef data toolbox
- Typebot chat forms
- AFFiNE workspace
- Overleaf Community Edition
- Neko shared virtual browser
- imgproxy image resizing
- NetBox network inventory
- UVdesk help desk
- YetiForce CRM