Rocket.Chat logo

Rocket.Chat

Open-source team communication and collaboration platform

Alternative to: Slack, Microsoft Teams, Discord


Rocket.Chat is an open-source, secure, fully customizable communications platform for organizations that require high standards of data protection. It enables real-time messaging, voice calls, and collaboration between colleagues, other companies, and customers, with support for end-to-end encryption, federation, and an extensible apps marketplace.

Rocket.Chat Docker Compose example

Self-host Rocket.Chat on your own server, homelab, or VPS starting from this Docker Compose example. It runs Rocket.Chat in Docker containers using the official rocketchat/rocket.chat:latest, mongo:8.0 images, with persistent volumes and automatic restarts preconfigured. Review the environment variables and adjust them to your setup, save the file as compose.yml (or docker-compose.yml), and start the stack with docker compose up -d.

services:
  # Rocket.Chat application server (serves the web UI and REST/real-time API)
  rocketchat:
    image: rocketchat/rocket.chat:latest
    restart: unless-stopped
    environment:
      # Connection string to the MongoDB replica set (oplog tailing requires a replica set)
      MONGO_URL: "mongodb://mongodb:27017/rocketchat?replicaSet=rs0"
      # Public URL where users reach this instance; set this to your https:// domain
      ROOT_URL: "http://localhost:3000"
      # Port the Rocket.Chat process listens on inside the container
      PORT: "3000"
      # How the deployment reports itself in the admin panel
      DEPLOY_METHOD: "docker"
      # Username for the administrator account created automatically on first launch
      ADMIN_USERNAME: "admin"
      # Password for the administrator account created on first launch
      ADMIN_PASS: "changeme"
      # Email address for the administrator account created on first launch
      ADMIN_EMAIL: "changeme"
    depends_on:
      mongodb:
        condition: service_healthy

  # MongoDB running as a single-node replica set, required by Rocket.Chat.
  # The healthcheck initiates the replica set on first start and reports healthy once it is up.
  mongodb:
    image: mongo:8.0
    restart: unless-stopped
    command: ["mongod", "--replSet", "rs0", "--bind_ip_all"]
    volumes:
      - mongodb_data:/data/db
      - mongodb_config:/data/configdb
    healthcheck:
      test: >
        echo "try { rs.status() } catch (err) { rs.initiate({ _id: 'rs0', members: [{ _id: 0, host: 'mongodb:27017' }] }) }" | mongosh --port 27017 --quiet
      interval: 10s
      timeout: 30s
      start_period: 20s
      retries: 30

volumes:
  mongodb_data:
  mongodb_config:

Values set to changeme are required — replace them with your own values before starting Rocket.Chat.

Prefer a managed setup? WinterFlow installs, configures, and updates Rocket.Chat for you using this same Docker Compose configuration.