Install RocketChat with Docker Compose for Development

If you ask me: what the hell Rocketchat is, then you should better ask Google. This article notes steps to install RocketChat with Docker Compose for development purpose.

1. Create docker-compose.yml

I want to expose the mongo port (27017) to the host network so I also declare it in the ports param. I also map the default rocketchat port (3000) to port 4000 in the host since I am using port 3000 for another service.


2. Start services

It is worth noting that you need to start mongo and rocketchat sequentially. If you simply run docker-compose up, the rocketchat service cannot recognize mongo service is completely started, so it fails since there is no retry after that. Even if you put the depends info in the docker-compose.yml, it still fails. The following error will appear:

So, you should start mongo service first, and then start the rocketchat service as follows:



Leave a Reply