MQTT Broker with Docker Compose
Install, update and uninstall MQTT Broker in one place.
Community Edition runs locally without an account or licence.
Install
Before you start, install Docker and make sure it is running. These commands work in PowerShell, macOS Terminal or a Linux shell.
Download the file and save it in an empty folder
docker-compose.yml
Open a terminal in that folder and start it
Check that it is running (look for “Up”)
Check that the broker responds
Operational endpoints are available only on the computer running Docker.
Once it is running, connect Hub or your MQTT client to localhost:1883. For another computer, use its address and MQTT port. Use your broker credentials when prompted.
Update
Back up your configuration and saved data before updating. Plan for a brief interruption while the broker restarts.
Run these commands in the folder containing your docker-compose.yml. Compose recreates the service with the new image and keeps its named data volumes.
Pull and restart MQTT Broker
Uninstall
Back up any data you want to keep before removing the application.
Open a terminal in the folder containing your deployment’s docker-compose.yml. This removes all containers and networks in that Compose project, keeping named data volumes.
Remove the Compose deployment (keeps saved data)
Optional: permanently delete the project’s named volumes too. Back up their data first. This affects every volume declared in that Compose file, including other services.
Remove the Compose deployment and permanently delete its data
Uninstalling locally does not remove a broker from Fleet or cancel a licence. Manage those separately in the portal.