Eclipse Mosquitto

Estimated reading time: 3 minutes

Eclipse Mosquitto is an open source message broker which implements MQTT version 3.1 and 3.1.1

GitHub repo:

Library reference

This content is imported from the official Docker Library docs, and is provided by the original uploader. You can view the Docker Store page for this repo at

Supported tags and respective Dockerfile links

For detailed information about the published artifacts of each of the above supported tags (image metadata, transfer size, etc), please see the repos/eclipse-mosquitto directory in the docker-library/repo-info GitHub repo.

For more information about this image and its history, please see the relevant manifest file (library/eclipse-mosquitto). This image is updated via pull requests to the docker-library/official-images GitHub repo.

What is Eclipse Mosquitto?

Eclipse Mosquitto is an open source implementation of a server for version 3.1 and 3.1.1 of the MQTT protocol. Main homepage:


How to use this image


Three directories have been created in the image to be used for configuration, persistent storage and logs.



When running the image, the default configuration values are used. To use a custom configuration file, mount a local configuration file to /mosquitto/config/mosquitto.conf

docker run -it -p 1883:1883 -p 9001:9001 -v mosquitto.conf:/mosquitto/config/mosquitto.conf eclipse-mosquitto

Configuration can be changed to:

  • persist data to /mosquitto/data
  • log to /mosquitto/log/mosquitto.log

i.e. add the following to mosquitto.conf:

persistence true
persistence_location /mosquitto/data/
log_dest file /mosquitto/log/mosquitto.log

Note: If a volume is used, the data will persist between containers.


Run a container using the new image:

docker run -it -p 1883:1883 -p 9001:9001 -v mosquitto.conf:/mosquitto/config/mosquitto.conf -v /mosquitto/data -v /mosquitto/log eclipse-mosquitto

Note: if the mosquitto configuration (mosquitto.conf) was modified to use non-default ports, the docker run command will need to be updated to expose the ports that have been configured.


Eclipse Mosquitto is released under the EPL/EDL

Supported Docker versions

This image is officially supported on Docker version 17.04.0-ce.

Support for older versions (down to 1.6) is provided on a best-effort basis.

Please see the Docker installation documentation for details on how to upgrade your Docker daemon.

User Feedback


If you have any problems with or questions about this image, please contact us through a GitHub issue. If the issue is related to a CVE, please check for a cve-tracker issue on the official-images repository first.

You can also reach many of the official image maintainers via the #docker-library IRC channel on Freenode.


You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.

Before you start to code, we recommend discussing your plans through a GitHub issue, especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.


Documentation for this image is stored in the eclipse-mosquitto/ directory of the docker-library/docs GitHub repo. Be sure to familiarize yourself with the repository’s file before attempting a pull request.

library, sample, Eclipse Mosquitto