Running Discourse on Coolify

Discourse does not officially provide a Docker image to run their forum software, which makes it harder to install on Coolify.

Solution:

Use the Bitnami Discourse Docker Image with a custom docker-compose file.

⚠️
Make sure to replace the following placeholders👇
PASSWORD_YOUR_DISCOURSE_PASS (all occurrences)
PASSWORD_YOUR_PG_PASS (all occurrences)

Passwords placeholders

  - DISCOURSE_HOST=yourdomain.com (all occurrences)
  - [email protected]
  - DISCOURSE_SITENAME=Forum

Branding placeholders

  - DISCOURSE_SMTP_HOST=in-v3.mailjet.com
  - DISCOURSE_SMTP_PORT=587
  - DISCOURSE_SMTP_USER=YOUR_MAILJET_USER
  - DISCOURSE_SMTP_PASSWORD=YOUR_MAILJET_PASSWORD

Email/SMTP placeholders

Discourse docker-compose.yml for Coolify:

services:
  postgresql:
    image: 'docker.io/bitnami/postgresql:16'
    volumes:
      - 'postgresql_data:/bitnami/postgresql'
    environment:
      - POSTGRESQL_DATABASE=discourse_db
      - POSTGRESQL_PASSWORD=PASSWORD_YOUR_PG_PASS
  redis:
    image: 'docker.io/bitnami/redis:7.4'
    environment:
      - REDIS_PASSWORD=PASSWORD_YOUR_DISCOURSE_PASS
    volumes:
      - 'redis_data:/bitnami/redis'
  discourse:
    image: 'docker.io/bitnami/discourse:3.3.2'
    ports:
      - '3145:3000'
    volumes:
      - 'discourse_data:/bitnami/discourse'
    depends_on:
      - postgresql
      - redis
    environment:
      - DISCOURSE_HOST=yourdomain.com
      - DISCOURSE_DATABASE_HOST=postgresql
      - DISCOURSE_USERNAME=admin
      - DISCOURSE_PASSWORD=PASSWORD_YOUR_DISCOURSE_PASS
      - [email protected]
      - DISCOURSE_SITENAME=Forum
      - DISCOURSE_POSTGRESQL_NAME=discourse_db
      - DISCOURSE_POSTGRESQL_USERNAME=postgres
      - DISCOURSE_POSTGRESQL_PASSWORD=PASSWORD_YOUR_PG_PASS
      - DISCOURSE_SMTP_HOST=in-v3.mailjet.com
      - DISCOURSE_SMTP_PORT=587
      - DISCOURSE_SMTP_USER=YOUR_MAILJET_USER
      - DISCOURSE_SMTP_PASSWORD=YOUR_MAILJET_PASSWORD
      - DISCOURSE_REDIS_HOST=redis
      - DISCOURSE_REDIS_PORT_NUMBER=6379
      - DISCOURSE_REDIS_PASSWORD=PASSWORD_YOUR_DISCOURSE_PASS
      - POSTGRESQL_CLIENT_POSTGRES_USER=postgres
      - POSTGRESQL_CLIENT_POSTGRES_PASSWORD=PASSWORD_YOUR_PG_PASS
      - POSTGRESQL_CLIENT_CREATE_DATABASE_NAME=discourse_db
      - 'POSTGRESQL_CLIENT_CREATE_DATABASE_EXTENSIONS=hstore,pg_trgm'
      - BITNAMI_DEBUG=true
  sidekiq:
    image: 'docker.io/bitnami/discourse:3.3.2'
    depends_on:
      - discourse
    volumes:
      - 'sidekiq_data:/bitnami/discourse'
    command: /opt/bitnami/scripts/discourse-sidekiq/run.sh
    environment:
      - DISCOURSE_HOST=yourdomain.com
      - DISCOURSE_DATABASE_HOST=postgresql
      - DISCOURSE_DATABASE_PORT_NUMBER=5432
      - DISCOURSE_DATABASE_USER=postgres
      - DISCOURSE_DATABASE_NAME=discourse_db
      - DISCOURSE_DATABASE_PASSWORD=PASSWORD_YOUR_PG_PASS
      - DISCOURSE_REDIS_HOST=redis
      - DISCOURSE_REDIS_PASSWORD=PASSWORD_YOUR_DISCOURSE_PASS
      - DISCOURSE_REDIS_PORT_NUMBER=6379
      - DISCOURSE_SMTP_HOST=in-v3.mailjet.com
      - DISCOURSE_SMTP_PORT=587
      - DISCOURSE_SMTP_USER=YOUR_MAILJET_USER
      - DISCOURSE_SMTP_PASSWORD=YOUR_MAILJET_PASSWORD

Use this in Coolify → New Resource → Docker Compose Empty

Read more

Bitnami Discourse 3.3.2 update error

Problem: Do you get this error trying to update your Bitnami Discourse installation? NameError: uninitialized constant ChatMessageSerializer::BasicUserWithStatusSerializer (NameError) has_one :user, serializer: BasicUserWithStatusSerializer, embed: :objects ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Did you mean? BasicUserSerializer /opt/bitnami/discourse/plugins/chat/app/serializers/chat_message_serializer.rb Solution: You can fix this error and finalize the

By Cristian Buleandra