Create a directory for your Rocket Chat configuration files:
mkdir rocket-chat
cd rocket-chat
Create a docker-compose.yml
file with the following contents:
version: '3'
services:
rocketchat:
image: rocketchat/rocket.chat:latest
container_name: rocketchat
restart: always
environment:
- ROOT_URL=https://your.domain.com
- MONGO_URL=mongodb://mongo:27017/rocketchat
depends_on:
- mongo
ports:
- 3000:3000
mongo:
image: mongo:4.4
container_name: mongo
restart: always
volumes:
- ./data/db:/data/db
This configuration file sets up a Rocket Chat instance and a MongoDB database container. The rocketchat
service listens on port 3000
and depends on the mongo
service.
Make sure to replace https://your.domain.com
with the actual URL you want to use for your Rocket Chat instance.
docker-compose up -d
This command will start the Rocket Chat and MongoDB containers in the background.
Configure your Apache proxy to forward requests to the Rocket Chat instance.
Here is an example configuration:
<VirtualHost *:80>
ServerName your.domain.com
ProxyPreserveHost On
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
</VirtualHost>
This configuration assumes that your Apache proxy is running on the same host as your Docker containers. Replace your.domain.com
with your actual domain name.
sudo systemctl restart apache2
Above apache proxy is not listening on SSL port. You need to adapt the config and use a ssl cert. A quick way to issue a cert is to install certbot. Certbot will also reconfigure your Webserver. See our Apache & certbot Tutorials on this wiki.