Back to all templates
Mosquitto logo

Mosquitto

Infrastructure64MB+ RAM

Lightweight MQTT message broker for IoT and messaging

mqttiotmessagingbroker

Deploy Mosquitto in 3 Steps

1

Connect Your VPS

Add your server credentials to Server Compass

2

Select Mosquitto

Choose from our template library

3

Deploy & Configure

Fill in settings and click Deploy

No Docker knowledge required
Step-by-step deployment guide

Deploy Mosquitto on a VPS with Server Compass

Use the Mosquitto template in Server Compass to deploy an MQTT broker on your VPS, then verify it with a disposable publish/subscribe round trip.

About 10 minutesBrowser verified
1
Step 1

Open the server Apps tab

Select the tutorial-vps VPS, open the Apps tab, and start a new app deployment. Keep sensitive server details hidden before capturing or sharing screenshots.

Server Compass Apps tab before creating a Mosquitto app
2
Step 2

Choose an app template

Click New App and choose the template deployment path so Server Compass can load the built-in catalog.

Choosing to deploy an app from a Server Compass template
3
Step 3

Search for Mosquitto

Use the template picker search to find Mosquitto in the Server Compass template catalog.

Searching for Mosquitto in the Server Compass template picker
4
Step 4

Select the Mosquitto template

Choose the Mosquitto template. Server Compass fills the broker service, generated configuration, MQTT/WebSocket ports, and persistent data/log volumes.

Mosquitto template selected in Server Compass
5
Step 5

Review the Mosquitto settings

Confirm the app name and compose service. In this run, the app was named mosquitto-demo and used host port 1883.

Reviewing Mosquitto project settings and compose service
6
Step 6

Deploy Mosquitto

Review the generated compose settings, confirm the MQTT and WebSocket ports are available, and click Deploy.

Reviewing Mosquitto MQTT and WebSocket ports before deployment
7
Step 7

Watch the deployment progress

Keep the deployment modal open while Server Compass uploads the compose file, pulls the Mosquitto image, starts the container, and verifies the stack.

Server Compass deploying the Mosquitto template on the VPS
8
Step 8

Confirm Mosquitto is running

After deployment finishes, return to the Apps tab and confirm the Mosquitto app is marked Running with its published ports available.

Mosquitto template running in the Server Compass Apps tab
9
Step 9

Verify Mosquitto from the container

Run a disposable MQTT subscribe/publish check inside the broker container and confirm the WebSocket listener is open.

Mosquitto service verification output from logs

After Mosquitto Opens

  • Replace anonymous access with a password file before public production use.
  • Restrict MQTT and WebSocket ports to trusted networks or place them behind TLS.
  • Point IoT devices or applications at the MQTT listener.
  • Back up the Mosquitto data volume if retained messages or persistence matter.

Verified Result

A disposable MQTT subscriber received `server-compass-ok`, and the WebSocket port accepted a TCP connection.

Mosquitto deployment questions

What does the Mosquitto template deploy?

It deploys the Eclipse Mosquitto broker with generated configuration for MQTT and WebSocket listeners plus persistent data/log volumes.

Which port did the tutorial use?

The tutorial used host port 1883 for MQTT. The template also publishes the WebSocket listener port.

Does Mosquitto need setup after deployment?

The template starts with anonymous listeners so it is immediately testable. For production, add users/passwords, disable anonymous access, and configure TLS or private networking.

Should this become a blog post?

No. The deployment guide should live on the Mosquitto template detail page and be linked from the reusable template deployment docs page.

Why Self-Host Mosquitto?

Mosquitto is a lightweight MQTT message broker, the standard protocol for IoT devices. Self-hosting means your smart home and IoT data stays on your network — not flowing through corporate cloud servers that mine your data for usage patterns and advertising.

Lightweight MQTT broker running on just 64MB RAM
Keep IoT and smart home data completely local
Support for MQTT 5.0, 3.1.1, and 3.1
TLS encryption for secure device communication
Bridge multiple Mosquitto instances for distributed setups

Mosquitto vs Alternatives

Mosquitto vs EMQX

EMQX is enterprise-grade with more features. Mosquitto is simpler, lighter, and sufficient for most homelab and small-scale IoT.

Mosquitto vs AWS IoT Core

AWS IoT charges per message and sends data to Amazon. Mosquitto keeps all IoT data on your local network.

Mosquitto vs HiveMQ

HiveMQ has commercial licensing. Mosquitto is fully open-source and the most widely deployed MQTT broker.

Why Deploy Mosquitto with Server Compass?

Server Compass deploys Mosquitto with just 64MB RAM — it runs on any server, even alongside dozens of other containers. Persistent configuration ensures your MQTT setup survives updates.

Download Server Compass

After Deployment

After deploying Mosquitto with Server Compass, complete these steps to finish setup

1

Configure authentication

2

Set up topics

3

Connect MQTT clients

Need help? Check out our documentation for detailed guides.

Mosquitto FAQ

Common questions about self-hosting Mosquitto

How do I deploy Mosquitto with Server Compass?

Simply download Server Compass, connect to your VPS, and select Mosquitto from the templates list. Fill in the required configuration and click Deploy. The entire process takes under 3 minutes.

What are the system requirements for Mosquitto?

Mosquitto requires a minimum of 64MB RAM. We recommend a VPS with at least 1024MB RAM for optimal performance. Any modern Linux server with Docker support will work.

Can I migrate my existing Mosquitto data?

Yes! Server Compass provides volume mapping that allows you to import existing data. You can also use standard Mosquitto backup and restore procedures.

How do I update Mosquitto to the latest version?

Server Compass makes updates easy. Simply click the Update button in your deployment dashboard, and the latest Mosquitto image will be pulled and deployed with zero downtime.

Is Mosquitto free to self-host?

Mosquitto is open-source software. You only pay for your VPS hosting (typically $5-20/month) and optionally Server Compass ($29 one-time). No subscription fees or per-seat pricing.

Ready to Self-Host Mosquitto?

Download Server Compass and deploy Mosquitto to your VPS in under 3 minutes. No Docker expertise required.

Download Server Compass