Installing Rocket.Chat with Docker on Your VPS
To install Rocket.Chat with Docker and use it. You'll first download the official Rocket.Chat docker compose file, set up environment variables, run the container, then secure it with an SSL certificate. This is everything you need to have a fully functional self-hosted communications platform.Why Use a Self-hosted Slack Alternative?
We originally published this Rocket.Chat tutorial back in 2017 after a highly publicized series of Slack service outages. When your entire team is reliant on an externally-hosted solution, that’s a risk you run. Additionally, Slack isn’t entirely free, as it requires you to purchase a plan for unlimited message history and other basic features. Rocket.Chat offers this and more, with control and flexibility. By self-hosting a Slack alternative, you avoid depending on third-party services and gain full ownership of your data.What You Need to Install Rocket.Chat with Docker
- A Docker-ready VPS. If you haven't noticed, we offer the best priced, most reliable VPS servers in the world. Take a look at our offerings and prepare for your mind to be blown 🤯.
- A functioning Docker installation, plus Docker Compose—see our Getting Started tutorial for more details.
- A non-root user account to SSH into. Check out How to access your server using SSH to learn how to access your server and create a
sudo
user.
Step 1 - Downloading the Rocket.Chat Docker Compose File
Once you've SSH-ed into your VPS, and you have Docker up and running, you can get started on setting up
docker compose
to automate the process of deploying your Rocket.Chat app.
First, create a nice space for our docker-compose.yml
file. You can place this wherever you'd like, but I think your user's home
directory is a good choice.
$ cd ~
$ mkdir rocket.chat && cd rocket.chat
Now that you're in the rocket.chat
folder, you can download the official docker-compose.yml
file to tell Docker how you want the system configured:
curl -L https://raw.githubusercontent.com/RocketChat/Docker.Official.Image/master/compose.yml -O
Step 2 - Configuring Your Rocket.Chat Environment
You'll now set up your Rocket.Chat environment with a.env
file. This file will contain environment variables to configure your Rocket.Chat application, such as your domain name, your preferred Rocket.Chat release, and other configurations.
Open a new .env
file inside your rocket.chat
directory:
nano .env
Add the following configuration to it:
### Rocket.Chat configuration
# Rocket.Chat version
# see:- https://github.com/RocketChat/Rocket.Chat/releases
RELEASE=6.11.0
# MongoDB endpoint (include ?replicaSet= parameter)
#MONGO_URL=
# MongoDB endpoint to the local database
#MONGO_OPLOG_URL=
# IP to bind the process to
#BIND_IP=
# URL used to access your Rocket.Chat instance
ROOT_URL=http://rocket.example.com
# Port Rocket.Chat runs on (in-container)
#PORT=
# Port on the host to bind to
#HOST_PORT=
### MongoDB configuration
# MongoDB version/image tag
#MONGODB_VERSION=
# See:- https://hub.docker.com/r/bitnami/mongodb
### Traefik config (if enabled)
# Traefik version/image tag
#TRAEFIK_RELEASE=
# Domain for https (change ROOT_URL & BIND_IP accordingly)
#DOMAIN=
# Email for certificate
Continue reading this article
by subscribing to our newsletter.
Subscribe nowby subscribing to our newsletter.
A note about tutorials: We encourage our users to try out tutorials, but they aren't fully supported by our team—we can't always provide support when things go wrong. Be sure to check which OS and version it was tested with before you proceed.
If you want a fully managed experience, with dedicated support for any application you might want to run, contact us for more information.