Deploy Rocket.Chat with Dokploy: Docker Compose Setup Guide
Step-by-step guide to deploying Rocket.Chat team communication platform on your VPS using Dokploy and Docker Compose. Includes MongoDB database, persistent storage, and SSL configuration.
Deploy Rocket.Chat with Dokploy
Dokploy is an open-source server management platform that simplifies deploying Docker Compose applications on your VPS. It handles reverse proxy configuration, SSL certificates, and deployment management — making it practical to run Rocket.Chat as a fully-featured team communication platform.
This guide walks you through deploying Rocket.Chat with a MongoDB database backend, persistent message storage, file uploads, and automatic HTTPS.
Prerequisites
- A VPS with at least 2 vCPUs, 4 GB RAM, and 20 GB storage
- Dokploy installed and running on your server (installation docs)
- A domain name (e.g.,
chat.yourdomain.com) with DNS A record pointing to your server's IP
Docker Compose Configuration
Create a new Compose project in Dokploy and paste the following configuration:
version: "3.8"
services:
rocketchat:
image: registry.rocket.chat/rocketchat/rocket.chat:latest
restart: unless-stopped
ports:
- "3000:3000"
environment:
- ROOT_URL=https://${ROCKETCHAT_DOMAIN}
- PORT=3000
- MONGO_URL=mongodb://rocketchat-db:27017/rocketchat?replicaSet=rs0
- MONGO_OPLOG_URL=mongodb://rocketchat-db:27017/local?replicaSet=rs0
- DEPLOY_METHOD=docker
- DEPLOY_PLATFORM=dokploy
volumes:
- ../files/rocketchat-uploads:/app/uploads
depends_on:
rocketchat-db:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:3000/api/info || exit 1"]
interval: 30s
timeout: 10s
retries: 5
rocketchat-db:
image: bitnami/mongodb:5.0
restart: unless-stopped
environment:
- MONGODB_REPLICA_SET_MODE=primary
- MONGODB_REPLICA_SET_NAME=rs0
- MONGODB_PORT_NUMBER=27017
- MONGODB_INITIAL_PRIMARY_HOST=rocketchat-db
- MONGODB_INITIAL_PRIMARY_PORT_NUMBER=27017
- MONGODB_ADVERTISED_HOSTNAME=rocketchat-db
- MONGODB_ENABLE_JOURNAL=true
- ALLOW_EMPTY_PASSWORD=yes
volumes:
- ../files/rocketchat-db-data:/bitnami/mongodb
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 10s
timeout: 5s
retries: 5
Note: Rocket.Chat requires MongoDB with a replica set for oplog tailing (real-time message delivery). The Bitnami MongoDB image simplifies replica set setup with environment variables. The
ALLOW_EMPTY_PASSWORD=yesis for the replica set initialization — for production, addMONGODB_ROOT_PASSWORDand update theMONGO_URLwith credentials.
Environment Variables
Set these in Dokploy's Environment tab for your compose project:
| Variable | Purpose | Example |
|---|---|---|
ROCKETCHAT_DOMAIN |
Your Rocket.Chat domain | chat.yourdomain.com |
In Dokploy, environment variables are set via the Environment editor in the project settings. Do not create a .env file manually — Dokploy manages this for you. The ROOT_URL must match your public HTTPS domain for proper link generation and WebSocket connections.
Volumes & Data Persistence
This setup uses Dokploy's ../files convention for bind-mounted volumes:
../files/rocketchat-uploads— File uploads shared in chats (images, documents, media)../files/rocketchat-db-data— MongoDB data files containing messages, users, channels, and settings
The ../files path is relative to the compose file inside Dokploy's project directory. This ensures your data persists across redeployments. Avoid using absolute paths because Dokploy may clean them during redeployment.
For large deployments, consider mounting a dedicated disk for the MongoDB data directory.
Domain & SSL Setup
- In your Dokploy project, navigate to the Domains tab
- Click Add Domain and enter your domain (e.g.,
chat.yourdomain.com) - Set the container port to
3000 - Enable HTTPS — Dokploy automatically provisions a Let's Encrypt SSL certificate
- Save and wait for the certificate to be issued (usually under a minute)
Dokploy's built-in Traefik reverse proxy handles TLS termination and routes traffic to the Rocket.Chat container. WebSocket connections for real-time messaging are supported by default.
Verifying the Deployment
- In Dokploy, go to your project's Deployments tab and click Deploy
- Watch the build logs — you should see both
rocketchatandrocketchat-dbcontainers start - Check the Logs tab for the
rocketchatservice. Look for:SERVER RUNNINGwith the port number - Open
https://chat.yourdomain.comin your browser — you should see the Rocket.Chat setup wizard - Create the admin account, set organization info, and configure your workspace
- Invite users and test messaging in real-time
Troubleshooting
Rocket.Chat shows "Connection refused" or won't start
Verify that MongoDB is healthy and the replica set is initialized. The Bitnami MongoDB image handles replica set setup automatically, but first boot may take a minute. Check rocketchat-db logs for Replica set initialized messages.
Real-time messaging not working (messages require refresh)
Rocket.Chat requires MongoDB oplog for real-time updates. Ensure MONGO_OPLOG_URL is set and the replica set is working. Check the Rocket.Chat admin panel under Administration > Room to verify oplog status.
File uploads failing
Ensure the ../files/rocketchat-uploads volume is correctly mapped and writable. The Rocket.Chat container runs as user rocketchat — adjust directory permissions if needed. Check the upload size limit in Admin > Settings > File Upload.
Memory issues with MongoDB
MongoDB's WiredTiger cache defaults to using about 50% of available RAM. On a 4 GB VPS, this leaves enough for Rocket.Chat. If you experience memory pressure, add --wiredTigerCacheSizeGB=1 to the MongoDB command.
SSL certificate not issuing Ensure your domain's DNS A record points to your server's IP and has propagated. Dokploy uses Let's Encrypt HTTP-01 challenges, so port 80 must be accessible. Check Traefik logs in Dokploy for certificate-related errors.
Learn more about Rocket.Chat in our complete overview.
Need a VPS? Hostinger VPS starts at $4.99/mo — perfect for running Rocket.Chat.
For more on Docker Compose deployments in Dokploy, see the Dokploy Docker Compose documentation.
App data sourced from selfh.st open-source directory.
Ready to get started?
Get the best VPS hosting deal today. Hostinger offers 4GB RAM VPS starting at just $4.99/mo.
Get Hostinger VPS — $4.99/mo// up to 75% off + free domain included
// related topics
fordnox
Expert VPS reviews and hosting guides. We test every provider we recommend.
// last updated: February 12, 2026. Disclosure: This article may contain affiliate links.