Skip to content

bitkidd/dokku-chatwoot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dokku-Chatwoot

Install Chatwoot on Dokku.

Setup

Server Setup

# 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 reload

Then 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

Attachments Storage

Google Cloud
  1. Create a Google Cloud Storage bucket
  2. Create a service account
  3. Grant it access to the bucket with the role "Storage Object Admin"
  4. 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-bucket

App Setup

Clone this repository, then add a remote for Dokku

git remote add dokku dokku@your-dokku-server.com:chatwoot

Then push:

git push dokku main

Upgrade

Upgrade 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.

About

Install Chatwoot on Dokku

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • Shell 61.0%
  • Dockerfile 28.5%
  • Procfile 10.5%