When Docker Compose is the right production path for Rocket.Chat
A team that needs self-hosted messaging inside its own infrastructure should first decide whether a single-host Docker Compose stack is enough. The official rocketchat-compose repository provides the files to build that stack: Rocket.Chat, a MongoDB replica set, and optional reverse proxy and monitoring files that you combine according to your needs. Its value is that the moving parts are already wired together and documented, so your team spends its effort on settings, certificates, storage and operations rather than on writing container definitions from scratch. Node.js is bundled in the official Docker image, so you do not install or patch it separately on the host. For 8.x releases, Rocket.Chat requires MongoDB 8.0 or later running as a replica set, so the database design belongs in the Compose plan from day one, not as an afterthought.
Compose fits when one instance is enough. Rocket.Chat's reference architectures suggest a single instance with a MongoDB replica set for up to 500 concurrent users. Above that, the vendor's guidance moves you to multiple load-balanced instances linked by NATS, and above 5,000 to microservices on Kubernetes with the official Helm chart. Both of those designs require a paid plan, so the choice is also a licensing and budget decision. Ask your team to measure expected peak concurrent users, not total headcount, and confirm the figure with Rocket.Chat before you commit to a topology.
Compose is also a poor fit if your organization already runs a standard Kubernetes platform, needs high availability across hosts, or must meet a recovery objective that a single host cannot meet. Plan those requirements before you write the first .env file, because moving a live workspace between topologies is far harder than choosing correctly up front. Confirm with your platform and security teams which hosting model they will support and operate.
Which compose files to combine for your environment
Choose this path when the server is reachable from the internet and you want the compose stack to handle routing and certificates. The official repository includes a Traefik override that adds a proxy service, labels on the Rocket.Chat service and a Let's Encrypt resolver, so you do not write routing rules by hand. Traefik is an MIT-licensed proxy that reads container labels and can request Let's Encrypt certificates on its own.
- Proxy service: Adds Traefik as the only container that publishes ports 80 and 443 on the host.
- Certificate resolver: Requests and renews Let's Encrypt certificates for the domain set in
.env, so the domain must resolve to the host before the first start. - Rocket.Chat labels: Routes the public hostname to the Rocket.Chat container and passes WebSocket traffic through.
- Forwarded headers: Sets the client address headers that Rocket.Chat relies on for rate limits, and confirm which settings your release expects.
Check that the override file names, label syntax and resolver settings match the release you pin, and confirm that ports 80 and 443 are open before the first certificate request.
Choose this path when your organization already runs a reverse proxy, a hardware or cloud load balancer, or an ingress layer that handles TLS for other services. You combine the base file and skip the Traefik override, so Rocket.Chat listens on a port your existing layer can reach. Your team keeps ownership of certificates, routing and access rules, and the compose stack only runs the application and its supporting containers.
- Base file only: Starts Rocket.Chat and its supporting containers without a proxy service, leaving TLS termination to your existing layer.
- Exposed port: Publishes the Rocket.Chat HTTP port on an internal interface, which you restrict with host firewall rules.
- WebSocket upgrades: Your proxy must upgrade connections for real-time messaging, so test a live chat session through the proxy before users depend on it.
- Certificate handling: Certificates stay in your existing process, so the stack needs no ACME settings for this path.
Confirm with your network team which proxy settings, forwarded headers and trusted address ranges apply, and check the reverse proxy guidance for your release before go-live.
Choose this path when MongoDB runs outside the compose stack, for example on a replica set that your database team manages or on a managed service. Rocket.Chat 8.x requires MongoDB 8.0 or later running as a replica set, so you remove the bundled database service from the combined files and point the connection settings at your cluster. The application host then depends on a database you operate elsewhere, which changes who gets paged during an incident.
- Removed database service: Drop the bundled MongoDB container from the combined files so that no second database starts on the host.
- Connection string: Set the MongoDB connection settings in
.env, including the replica set name and every member, as supplied by your database team. - Dedicated account: Create a database user for Rocket.Chat only, with the roles the release documentation specifies.
- Network path: Open the route from each Rocket.Chat host to every replica set member, including any firewall rules between zones.
Check the MongoDB version and member count against the system requirements before the first start, and confirm in writing who owns backups and restores for the external cluster.
Compose settings and what each choice means
This table compares the main .env values and compose file choices for a production Rocket.Chat stack built from the official rocketchat-compose repository. Read each row for what the setting controls and the trade-off it creates. The main takeaway is that pinning the release, deciding where MongoDB runs, and choosing between file-driven and admin-managed settings will shape every later upgrade, backup and recovery task.
| Setting | What it controls | Trade-off to weigh |
|---|---|---|
| RELEASE | Sets the Rocket.Chat image version the stack runs. | A pinned version gives reproducible builds and planned upgrades. Tracking newer releases automatically means less review before each change lands. |
| Domain and TLS variables | Public hostname and certificate handling through Traefik and Let's Encrypt. | Simple on one host with a public name. Confirm the exact key names in the repository's example env file before editing. |
| MongoDB connection string | Points Rocket.Chat at a MongoDB replica set, either bundled or external. | A separate database tier supports independent backups and failover, but adds network paths, credentials and patching work for a second system. |
| Compose file combination | Which override files you layer onto the base stack, such as the proxy or monitoring files. | Each added file adds containers to patch, monitor and restart. Keep the set to what your operations team will maintain. |
| OVERWRITE_SETTING variables | Forces selected server settings from the environment at startup. | Configuration stays consistent across rebuilds. Admins may find those settings locked or reset in the UI, so agree which settings live in env files. |
| Monitoring compose file | Adds metrics and log collection around the running stack. | Gives visibility into workspace health. Plan for extra resource use and for who reviews the dashboards and alerts. |
Setup sequence for a production Compose stack
This sequence takes a Rocket.Chat Docker Compose stack from DNS and host preparation to a verified first admin login and client connections, with a check at every stage so each layer is confirmed before the next depends on it.
Prepare DNS and host sizing
The platform team creates the public DNS record for the workspace hostname, confirms that inbound ports 80 and 443 reach the host, and checks that the host meets the system requirements for the Rocket.Chat version you plan to run. Confirm the CPU, memory and disk figures with the current Rocket.Chat system requirements page rather than a figure from an older guide. Done when the hostname resolves to the host's public address from outside your network and both ports accept connections from a test client. Install Docker and Docker Compose on the host and confirm both respond to a version check.
Provision the MongoDB 8.0 replica set
Rocket.Chat 8.x requires MongoDB 8.0 or later running as a replica set, so the database must be initialized as a replica set before Rocket.Chat starts, even for a single node. Decide whether MongoDB runs on the same host, a separate host, or as a managed service, and record the connection string the stack will use. A three-member replica set is strongly recommended for high availability, so confirm whether your environment can support that layout. Verification: connect with the mongosh client, run the replica set status command, and confirm the member reports a primary state with the expected member count.
Clone rocketchat-compose and select files
Clone the official rocketchat-compose repository onto the host and check out the branch or tag that matches the Rocket.Chat release you intend to run. Choose the compose files that match your design, such as the base file, the Traefik overlay for TLS, and any optional monitoring file, and combine them in the order the repository documents. Using an external MongoDB means removing or disabling the bundled database service in the chosen files. Verification: run the compose configuration check, which prints the merged file and fails on syntax or missing variable errors.
Set .env values and pin RELEASE
Edit the .env file to set the public domain, the MongoDB connection string with the replica set name, the Let's Encrypt contact address if you use it, and any OVERWRITE_SETTING variables your team needs at first boot. Set RELEASE to a specific supported version instead of a floating tag so upgrades happen on purpose, and check the version durability page to confirm that version is still supported. Keep the file out of public version control because it holds credentials. Verification: the merged configuration check shows the expected domain, image tag and connection string with no placeholder values left in place.
Start Traefik and confirm certificate issuance
Bring up the Traefik service first, before Rocket.Chat, so the certificate workflow can run and the routing layer is proven in isolation. Traefik requests Let's Encrypt certificates for the configured hostname over the public address, so the DNS record and port 80 or 443 access from step one must already work. Watch the Traefik logs and confirm the ACME challenge completes and a certificate is stored. Verification: an HTTPS request to the hostname from outside your network returns a valid certificate chain issued to that name, and the Traefik dashboard or logs show no repeated challenge errors.
Start Rocket.Chat and verify WebSocket connectivity
Start the Rocket.Chat and supporting services, then watch the container logs until the server reports that it is listening and has connected to MongoDB. Open the workspace in a browser through the public hostname, and confirm the page loads over HTTPS with the expected static assets. Rocket.Chat depends on WebSocket connections for live messaging, so check the browser developer tools for an established WebSocket connection to the same host rather than long polling fallbacks. Verification: the browser shows a connected status and sending a test message in a temporary channel appears in a second session without a page refresh.
Create the first admin account
Complete the setup wizard in the browser to create the first administrator, set the workspace name and confirm the site URL matches the public hostname. Record the admin credentials in your secrets store and enable multi-factor authentication for that account at once. Confirm the site URL in the administration settings so that links, notifications and client connections point to the correct address. Verification: the admin can sign out and back in, and the administration console shows the workspace registration and server information without errors.
Confirm mobile and desktop client connections
Connect the official desktop client and a mobile client to the workspace URL, signing in with a test user account rather than the admin. Check that each client completes sign-in, receives a test message and shows presence updates. Because unsupported versions may lose the ability to connect with official clients, confirm that the client versions you distribute are compatible with the server release you pinned. Verification: both clients remain connected after a server container restart, and the test account can send and receive messages from each client type.
Why pinning RELEASE and planning upgrades matter
Pin the RELEASE value in your .env file to a specific version and treat every change to it as a planned upgrade. Rocket.Chat standard releases are supported for 6 months and LTS releases for 12 months. After end of life, a version receives no security or bug fixes, and cloud services such as the push notification gateway, Marketplace and Omnichannel integrations stop working. Rocket.Chat also notes that unsupported versions may lose the ability to connect with its official mobile and desktop clients. A compose stack that floats on a moving tag can therefore change behavior, or stop receiving fixes, without anyone deciding that it should.
A pinned RELEASE turns each upgrade into a deliberate change with a tested rollback point. Before you change the value, take a backup of MongoDB and your uploads, restore it into a separate stack, and confirm that users can sign in and that files open. Then read the release notes for every version between your current and target release, since skipping steps can cause problems that a single jump hides. Confirm the support window of your target line against the version durability documentation before you commit to it. Note that the MongoDB prerequisites for 8.x differ from earlier lines, so check the system requirements at the same time.
Use the release page as the reference point when you choose a version. Rocket.Chat 8.9.0 was published on October 5, 2026, and patch releases 8.6.3 and 8.5.4 followed on October 16, 2026, for older supported lines. These dates are examples of how the lines run in parallel, not a recommendation of any specific tag. Check the Rocket.Chat releases page on the day you plan the change, pick the newest patch within the line your organization has approved, and record that choice in your change log so the next operator knows which version is running and why.
How the Compose stack connects Traefik, Rocket.Chat and MongoDB
Requests start with users and clients on the public network and reach Traefik, which terminates TLS and routes traffic to the Rocket.Chat container on the internal Docker network. Rocket.Chat then talks to the external MongoDB replica set, which sits outside the Compose stack. The trust boundary marks where public traffic stops and internal service traffic begins. When you review the setup, confirm that only the proxy publishes ports, that Rocket.Chat is reachable only through the proxy, and that the database connection string points to the replica set you operate.
Traffic enters through the proxy and reaches the database only from the Rocket.Chat container.
Security settings to decide before go-live
Most of the security exposure in a Docker Compose deployment comes from a few settings: where secrets live, which ports are reachable, how client addresses reach Rocket.Chat, and whether data can be recovered. Decide each one before users arrive, and record the decision so the next person can check it.
Protect the .env file and secrets
The .env file in the rocketchat-compose directory holds settings that affect access to your workspace and database. Restrict its file permissions to the account that runs Compose, keep it out of version control, and store a copy of the values in your organization's secrets manager. Rotate any value that was pasted into a ticket, chat or shared document. Confirm which values in your copy are secrets and which are plain configuration before you grant anyone read access.
Keep MongoDB on the internal network
The MongoDB service should be reachable only from the Rocket.Chat containers, never from the public network or the proxy's external interface. Enable authentication on the database and use a dedicated account for Rocket.Chat with the access it needs and nothing more. Check the published ports in your Compose setup, because a port mapping left in place for testing is a common cause of exposure. If you use an external MongoDB host, confirm that the firewall rules limit access to the Rocket.Chat hosts only.
Set client IP handling behind Traefik
Behind a reverse proxy, Rocket.Chat sees the proxy's address unless it is told how many forwarding hops to trust. Set HTTP_FORWARDED_COUNT to match your proxy chain, and make sure the proxy overwrites rather than forwards any client-supplied X-Real-Ip header. If these are wrong, rate limits will apply to one shared address or can be bypassed by a client that sets its own header. Follow the reverse proxy guide to confirm the values against your actual network path.
Expose only the proxy ports
Only the proxy should accept traffic from outside. Publish ports 80 and 443 on the Traefik container and leave the Rocket.Chat application, MongoDB and any monitoring endpoints off the host's public interface. Check the host firewall and any cloud security group against the same list, since Docker can publish ports in ways that bypass some host firewall rules. Write the expected listening ports into your deployment record and compare them after every change.
Plan MongoDB and upload backups
A working deployment still needs recoverable data. Back up MongoDB with a tested dump process and keep uploads in a location you can copy, whether that is the file storage you chose or a volume on the host. Store backups off the host and restrict who can read them, since they contain messages and files. Restore a backup to a separate environment before go-live and before every upgrade. The restore procedure is covered in the backup and restore guide.
Restrict monitoring and admin access
Metrics endpoints, dashboards and the Rocket.Chat administration console reveal how your workspace runs and who uses it. Decide which networks can reach the monitoring stack and make sure Grafana and Prometheus require their own authentication. Limit administrator accounts to named people, enable two-factor authentication for them, and review the list each quarter. Confirm the monitoring setup against the monitoring guide before exposing any of these services through the proxy.
Questions teams ask before running Rocket.Chat on Compose
What does running Rocket.Chat on Compose cost, and what drives it?
The software is MIT licensed for the core code, so the main costs are people, infrastructure and, if you need them, paid plan fees. Internal hours cover planning, the build, identity and TLS work, testing and recurring upgrades. Host and database sizing depends on expected concurrent users, which decides whether one instance with a MongoDB replica set is enough. Paid plans (Commercial, Government or Defense) are priced by quote, so ask for a written quote tied to your user count, features such as SAML group mapping or audit trails, and support terms. Ongoing costs are upgrades, patching and on-call time, which recur for the life of the deployment. Ask any partner to split one-time and recurring fees in the quote.
How long does a first production Compose setup take?
Duration depends on the steps you need, not on a fixed figure. The sequence is: confirm the plan and user scale, choose the compose files to combine, set the .env values, pin the RELEASE version, provision an external MongoDB replica set, configure the reverse proxy and certificates, wire identity and storage, then test sign-in, file upload, mobile and desktop connections, and a restore. Each step waits on a decision or an access request, so the calendar time is usually longer than the technical time. Ask any partner for a written plan with each step, its owner and its exit test.
What must our team provide before a Compose deployment starts?
You need to provide several things before work begins:
- DNS records for the public hostname, and access to change them.
- A certificate path: either ACME access for Let's Encrypt through Traefik, or your own certificate and key.
- A host or hosts with Docker and Compose available, network access to MongoDB, and firewall rules you approve.
- MongoDB operators who can run the replica set, take backups and approve upgrades.
- An identity provider contact for SSO or LDAP, and a storage decision for uploads.
- On-call coverage for upgrade windows and security advisories.
Confirm each item with your own change process before the build starts.
Can our own team run Rocket.Chat on Compose without a partner?
Yes, if your team has Docker, reverse proxy, MongoDB and identity skills and can keep a regular upgrade cadence. The official rocketchat-compose repository gives you a documented starting point. The risks are mostly operational: Rocket.Chat versions reach end of life, and after that they get no security or bug fixes and some cloud services stop working. Unsupported versions may also lose the ability to connect with the official mobile and desktop clients, so upgrades are part of running it. Test whether your team can complete a restore and an upgrade on a copy before you go live.
When should we bring in a partner for Rocket.Chat on Compose?
Bring in a partner when the deployment has regulatory or audit requirements, several identity sources, a tight go-live date, or no staff who can own upgrades. DeployOpen plans, implements, hardens, backs up, upgrades and documents self-hosted open-source platforms inside your own infrastructure, under fixed-scope agreements with written deliverables. Ongoing support, upgrades and testing are available as retainers. DeployOpen does not issue audit reports or certifications; independent auditors do that. Ask for the written scope, the handover material and the exit test before you sign.
Can a Compose deployment of Rocket.Chat later move to Kubernetes or OpenShift?
A move is possible, but it is a re-platforming project rather than a file change. Compose settings, Traefik labels and .env values do not carry over directly, and the Kubernetes and OpenShift paths use the official Helm chart with their own storage, networking and monitoring choices. Multi-instance and microservice designs also require a paid plan. Plan the move around your user growth, keep MongoDB and upload storage decisions stable where you can, and verify backups before you cut over. Ask whether the target platform and the database design are already fixed.
Which Compose settings are hardest to change after go-live?
The settings that tie data or identity to the deployment are the hardest to change. Check these before go-live:
- The public domain and TLS setup, since clients and redirect URLs depend on them.
- The MongoDB connection and replica set name, which hold all messages and metadata.
- The upload storage choice, because switching later can strand existing files.
- The
HTTP_FORWARDED_COUNTvalue and proxy trust, which affect rate limits and client IP handling. - The identity provider mapping for users and groups.
Record each decision in your change log and test a restore against it.
Is Rocket.Chat on Compose suitable for regulated workloads?
Compose can host a regulated workload, but the suitability depends on your plan, controls and evidence, not on the platform name. Starter includes LDAP, single sign-on, MFA, end-to-end encryption and retention, while tamper-evident audit trails and group mapping are listed on paid plans. Confirm with the vendor which features your sector needs, then document how each control is configured and tested. DeployOpen prepares systems and evidence for compliance assessments, but independent auditors issue any formal opinion.
How DeployOpen works on this
DeployOpen plans, implements, hardens, documents and supports self-hosted open-source platforms inside your own infrastructure, including Rocket.Chat production deployments on Docker Compose. Work starts with a written scope that fixes the compose files, external MongoDB, TLS path and access model before any server is touched.
How we scope
- Confirm the Rocket.Chat edition, license tier and expected concurrent users before choosing a single-instance layout.
- Record the MongoDB replica set plan, file storage location, DNS names and TLS approach in the written scope.
- Agree which compose files, .env settings and OVERWRITE_SETTING values are in scope, with fixed deliverables and timelines.
How we build
- Deploy from the official rocketchat-compose repository with a pinned RELEASE value and a tested upgrade path.
- Configure the reverse proxy and Let's Encrypt or your own certificates, then verify WebSocket connectivity end to end.
- Test login, file upload, notification delivery and a restore from backup in a staging copy before production cutover.
How we hand over
- Deliver the configured compose project, environment file notes, and a runbook covering upgrades and rollback steps.
- Document the MongoDB, backup, monitoring and outbound network requirements your security team needs to review.
- Walk your administrators through daily operations, pinned version management and where to find logs and settings.
How we support
- Support is available as a retainer for patching, version upgrades and continuous checks against your written scope.
- Upgrades are planned against the Rocket.Chat support lifecycle so unsupported versions do not reach production.
- Security testing of the deployed workspace can be scoped separately, with a findings report, fixes and a retest.

