Skip to main content
50% off all plans, limited time. Starting at $2.48/mo
Eclipse Mosquitto

Eclipse Mosquitto

Eclipse Mosquitto is an open-source MQTT broker for machine-to-machine messaging. It speaks MQTT 5.0, 3.1.1, and 3.1, runs in a few megabytes of RAM, and handles IoT fleets from one board to thousands. 11,100+ GitHub stars.

At a glance

Version Latest OS Ubuntu Server 24.04 LTS Min RAM 1 GB IP IPV4,IPV6

Connection Information

  • MQTT Broker: mqtt://<SERVER-IP>:1883
  • WebSocket Endpoint: ws://<SERVER-IP>:9001
  • Credentials are stored in: /root/.cloudzy-creds

Important Files & Directories

  • Install Path: /root/mosquitto
  • Compose File: /root/mosquitto/docker-compose.yml
  • Configuration File: /etc/mosquitto/mosquitto.conf
  • Password File: /etc/mosquitto/passwd
  • Data Volume: /var/lib/docker/volumes/mosquitto_mosquitto-data
  • Log Volume: /var/lib/docker/volumes/mosquitto_mosquitto-log

Testing the Broker

Subscribe to a topic:

mosquitto_sub -h <SERVER-IP> -p 1883 \
  -u client \
  -P '<PASSWORD>' \
  -t <TOPIC>

Publish a message:

mosquitto_pub -h <SERVER-IP> -p 1883 \
  -u client \
  -P '<PASSWORD>' \
  -t <TOPIC> \
  -m "Hello Mosquitto"

Service Management

View running containers:

docker compose -f /root/mosquitto/docker-compose.yml ps

Restart containers:

docker compose -f /root/mosquitto/docker-compose.yml restart

View logs:

cd /root/mosquitto && docker compose logs -f

Stop containers:

docker compose -f /root/mosquitto/docker-compose.yml stop

Start containers:

docker compose -f /root/mosquitto/docker-compose.yml start

Recreate containers:

docker compose -f /root/mosquitto/docker-compose.yml up -d

Notes

  • Anonymous connections are disabled by default. All MQTT clients must authenticate using the configured username and password.
  • The broker listens on port 1883 for MQTT clients and port 9001 for MQTT over WebSockets.
  • Review and update /etc/mosquitto/mosquitto.conf based on your requirements before using the broker in production.

More in Networking

Related apps.

Deploy Eclipse Mosquitto now. From $2.48/mo.