# Set these:
APP_NAME=your-app
DOMAIN=chatwoot.your-domain.com
dokku apps:create "$APP_NAME"
dokku domains:set "$APP_NAME" "$DOMAIN"
# Postgres (use an image with pgvector included)
dokku postgres:create "$APP_NAME"-db --image "pgvector/pgvector" --image-version "pg17"
dokku postgres:link "$APP_NAME"-db "$APP_NAME" --no-restart
# Redis
dokku redis:create "$APP_NAME"-redis
dokku redis:link "$APP_NAME"-redis "$APP_NAME" --no-restart
# Config: review these
dokku config:set --no-restart "$APP_NAME" \
SECRET_KEY_BASE="$(head -c 1000 /dev/urandom | shasum -a 512 | awk '{print $1}')" \
RAILS_ENV=production \
FRONTEND_URL="https://$DOMAIN" \
DEFAULT_LOCALE=en \
FORCE_SSL=true \
MAILER_SENDER_EMAIL='Your Company <contact@your-domain.com>'
# Fix the nginx config to support underscores in headers
# https://www.chatwoot.com/docs/self-hosted/deployment/docker/
sudo -u dokku mkdir -p "/home/dokku/$APP_NAME/nginx.conf.d"
echo 'underscores_in_headers on;' | sudo tee /home/dokku/$APP_NAME/nginx.conf.d/chatwoot-specific.conf
sudo nginx -t
# if the above doesn't show any error (warnings are ok):
sudo service nginx reloadThen push your app (see below). Once it's deployed, set the HTTPS config up:
dokku proxy:ports-clear $APP_NAME
dokku proxy:ports-add $APP_NAME http:80:3000
dokku letsencrypt:enable $APP_NAME
dokku letsencrypt:cron-job --add $APP_NAME- Create a Google Cloud Storage bucket
- Create a service account
- Grant it access to the bucket with the role "Storage Object Admin"
- Create a JSON key for it and copy it here:
dokku config:set $APP_NAME \
ACTIVE_STORAGE_SERVICE=google \
GCS_PROJECT=your-gcloud-project-id \
GCS_CREDENTIALS='{"type":"service_account",...}' \
GCS_BUCKET=your-bucketClone this repository, then add a remote for Dokku
git remote add dokku dokku@your-dokku-server.com:chatwootThen push:
git push dokku mainUpgrade the version in the Dockerfile and push to your remote.
You may need to update the database with dokku run $APP_NAME web 'rails bundle exec rails db:chatwoot_prepare. See the docs on deploying with Docker.