MQTT hosting
Lightweight messaging protocol for IoT and real-time applications. Deploy to a dedicated VPS in seconds — database auto-created, SSL installed, firewall locked down from the first boot.
5.x
Versions
—
Database
MERN
Category
What is MQTT?
MQTT is a lightweight publish-subscribe messaging protocol designed for constrained devices, low-bandwidth networks and real-time communication. It is widely used in IoT, telemetry, home automation, sensor networks, fleet management and any application that requires efficient message delivery between distributed systems.
MQTT uses a broker-and-client architecture. Clients publish messages to topics and other clients subscribe to those topics. The broker routes messages from publishers to subscribers, handling topic matching, message delivery, quality-of-service levels and persistent sessions.
Unlike HTTP request-response communication, MQTT maintains persistent connections between clients and the broker. This makes it efficient for frequent small messages, real-time data streams and scenarios where devices need to communicate with minimal overhead.
SharkCluster provides the server environment to run an MQTT broker. You can deploy Mosquitto or another MQTT broker, configure TCP and WebSocket listeners, set up authentication and TLS, manage topic access and run the broker as a production messaging service.
Quick facts
- Version
- 5.x
- Database
- —
- Category
- MERN
- SSL included
- Firewall locked
- DB auto-created
- Live in minutes
Why MQTT on SharkCluster?
Lightweight protocol
MQTT has minimal protocol overhead, making it suitable for constrained devices, low-bandwidth networks and high-frequency messaging.
Publish-subscribe model
Decouple publishers and subscribers so producers and consumers of messages can be added, removed or modified independently.
Quality of service levels
Choose between at-most-once, at-least-once and exactly-once delivery depending on message reliability requirements.
Persistent sessions
MQTT supports persistent sessions so clients can receive messages even when temporarily disconnected.
Topic-based routing
Organize messages into hierarchical topics with wildcard matching for flexible message routing.
Real-time communication
Maintain persistent connections for instant message delivery with minimal latency.
IoT and device messaging
MQTT is the standard messaging protocol for IoT devices, sensors, telemetry and machine-to-machine communication.
WebSocket support
MQTT brokers can expose WebSocket endpoints for browser-based and web application clients.
What you get with MQTT
MQTT 5.x broker
TCP listener on configurable port
WebSocket listener
TLS/SSL encryption
Username and password authentication
Access control lists for topic permissions
Quality of service levels (QoS 0, 1, 2)
Persistent sessions
Last Will and Testament messages
Retained messages
Topic wildcards and hierarchical routing
Message size limits
Connection limits
Keep-alive and timeout configuration
Bridge support for broker federation
Logging and monitoring
What MQTT is built for
IoT device communication
Connect sensors, actuators, controllers and other IoT devices through lightweight topic-based messaging.
Telemetry collection
Collect time-series data from distributed devices, vehicles, sensors and monitoring endpoints.
Home automation
Connect smart home devices, controllers and automation rules through a central message broker.
Real-time dashboards
Stream live data to web dashboards, monitoring panels and visualization applications.
Mobile push notifications
Deliver real-time notifications and updates to mobile applications through persistent connections.
Microservice messaging
Use MQTT as a lightweight message bus between microservices for event-driven communication.
Server specs for
MQTT
Not sure which plan to pick? The panel warns you before you deploy so you can choose the right size the first time.
- Minimum specs shown before deploy
- Panel blocks deploy if server is undersized
- Upgrade path available inside the panel
- MQTT Broker
- Mosquitto or another MQTT 5.x compatible broker.
- Operating system
- Linux recommended for production deployments.
- Web server
- nginx recommended for WebSocket and TLS support.
- Memory
- 1 GB RAM minimum; 2 GB+ recommended for production.
- CPU
- 1 vCPU minimum; 2+ vCPU recommended for higher workloads.
- Storage
- 10 GB+ SSD recommended for configuration, logs and persistent data.
How MQTT fits together
Domain
Your MQTT domain or subdomain points to the SharkCluster server through DNS.
nginx
nginx handles WebSocket upgrade and TLS termination for the MQTT WebSocket endpoint.
MQTT broker
The broker receives published messages, matches topics to subscriptions and delivers messages to subscribed clients.
TCP listener
MQTT clients connect to the broker over TCP on the configured port with optional TLS.
WebSocket listener
Browser and web clients connect to the broker through WebSocket endpoints.
Topic tree
The broker maintains a topic tree that maps active subscriptions and routes messages accordingly.
After your MQTT deploy
- 1
Deploy the broker
Install and configure an MQTT broker such as Mosquitto on the server.
- 2
Configure listeners
Set up TCP and WebSocket listeners on appropriate ports.
- 3
Configure authentication
Set up username and password authentication for broker access.
- 4
Configure TLS
Enable TLS for secure client connections on the public-facing port.
- 5
Configure access control
Set up topic-based access control lists to restrict which clients can publish or subscribe to specific topics.
- 6
Configure the domain
Point your MQTT subdomain to the server and configure WebSocket access.
- 7
Enable HTTPS
Configure SSL for the WebSocket endpoint and web interface.
- 8
Test connectivity
Connect a test client, publish and subscribe to topics and verify message delivery.
Ship MQTT your way
Install the broker
Install Mosquitto or another MQTT broker on the server.
Configure ports
Set the TCP listener port and WebSocket listener port.
Configure authentication
Set up password files or authentication plugins for broker access.
Configure TLS
Generate or obtain TLS certificates and configure secure listeners.
Configure access control
Define topic permissions and access control rules.
Start the broker
Start the MQTT broker as a background service.
Test deployment
Verify TCP and WebSocket connections, authentication and message delivery.
Keeping MQTT fast
Use QoS appropriately
Choose the lowest QoS level that meets your reliability requirements to minimize protocol overhead.
Manage persistent sessions
Limit persistent sessions to clients that need them to avoid unnecessary broker state storage.
Monitor connections
Track the number of concurrent connections and adjust broker limits based on server resources.
Use topic hierarchy wisely
Design topic structures that support wildcard matching without creating excessive subscription state.
Batch messages
When possible, batch related messages to reduce per-message overhead.
Before you go live
MQTT broker is installed and running
TCP listener is configured
WebSocket listener is configured
Authentication is enabled
TLS is configured for secure connections
Access control lists are defined
Domain DNS points to the server
WebSocket endpoint is accessible
Test clients can connect and exchange messages
Logging is configured
Ready your MQTT for launch
Use a supported MQTT broker release
Enable TLS for all public connections
Enable authentication
Configure access control lists
Set connection limits
Set message size limits
Configure logging and monitoring
Set appropriate keep-alive values
Configure persistent sessions carefully
Back up broker configuration
Monitor connection count and throughput
Keep the broker updated
Working with MQTT
Check Mosquitto status
Check if the Mosquitto MQTT broker is running.
systemctl status mosquittoStart Mosquitto
Start the Mosquitto broker service.
systemctl start mosquittoStop Mosquitto
Stop the Mosquitto broker service.
systemctl stop mosquittoRestart Mosquitto
Restart the Mosquitto broker service.
systemctl restart mosquittoSubscribe to a topic
Subscribe to a topic and print received messages.
mosquitto_sub -h localhost -t 'test/#' -vPublish a message
Publish a message to a topic.
mosquitto_pub -h localhost -t 'test/topic' -m 'hello'Add a client password
Create a new username and password for MQTT authentication.
mosquitto_passwd -c /etc/mosquitto/passwd <username>Check listening ports
Display ports currently used by the Mosquitto broker.
ss -lntp | grep mosquittoCommon MQTT issues & fixes
Client cannot connect
- Cause
- The broker may not be running, the port may be blocked, authentication may be failing or TLS may be misconfigured.
- Solution
- Check the broker status, verify the port is open, review authentication credentials and check TLS configuration.
Messages are not delivered
- Cause
- The topic may not match, access control may be blocking the message or the subscriber may not be connected.
- Solution
- Verify topic configuration, check access control lists and confirm the subscriber is connected and subscribed.
WebSocket connection fails
- Cause
- The WebSocket endpoint may not be configured, nginx may not be forwarding WebSocket upgrades or TLS may be misconfigured.
- Solution
- Check the WebSocket listener configuration, verify nginx WebSocket proxy settings and review TLS certificates.
Broker disconnects clients
- Cause
- The keep-alive timeout may be too short, the broker may be overloaded or connection limits may be reached.
- Solution
- Adjust keep-alive settings, monitor broker resources and increase connection limits if needed.
TLS handshake fails
- Cause
- The TLS certificate may be expired, the certificate chain may be incomplete or the broker TLS configuration may be incorrect.
- Solution
- Verify the TLS certificate, check the certificate chain and review the broker's TLS listener configuration.
Hardened before your first request
Every deploy is locked down from boot — closed firewall, valid SSL, and restricted access by default.
Enable TLS for all public MQTT connections.
Enable authentication for broker access.
Use access control lists to restrict topic permissions.
Set connection limits to prevent resource exhaustion.
Set message size limits to prevent abuse.
Use strong passwords for MQTT accounts.
Keep the MQTT broker updated.
Restrict broker access to trusted networks where possible.
Monitor connection logs for unauthorized access attempts.
Use secure topic hierarchies that do not expose sensitive data.
The data layer behind MQTT
Broker state storage
MQTT brokers store subscriptions, retained messages and session data in memory or on disk depending on configuration.
Persistence options
Configure broker persistence for retained messages and persistent sessions that need to survive broker restarts.
No traditional database required
MQTT brokers typically do not require a traditional database like PostgreSQL or MySQL for core operation.
MQTT environment configuration
Broker configuration
Configure listener ports, authentication, TLS and access control through the broker configuration file.
TLS certificates
Obtain and configure TLS certificates for secure MQTT connections.
Logging
Configure broker logging levels and log destinations for production monitoring.
Automations that run on schedule
Log rotation
Rotate broker logs to prevent them from growing indefinitely.
Session cleanup
Periodically clean up expired persistent sessions if the broker supports session expiry.
Lock down MQTT from day one
TLS is enabled for public connections
Authentication is required
Access control lists are configured
Connection limits are set
Message size limits are configured
Strong passwords are used
Broker is kept updated
Network access is restricted
Connection logs are monitored
Topic hierarchy follows security best practices
A safe MQTT upgrade path
- 1
Back up configuration
Back up the broker configuration before upgrading.
- 2
Check release notes
Review the broker release notes for breaking changes and deprecated features.
- 3
Test with staging clients
Test client connections with the new broker version before updating production.
- 4
Upgrade the broker
Update the broker package and restart the service.
- 5
Verify connectivity
Test TCP and WebSocket connections, authentication and message delivery after the upgrade.
Take a snapshot before every upgrade so a bad release can be rolled back in minutes.
We manage the server, you own the store
SharkCluster manages
- VPS infrastructure
- MQTT broker runtime
- nginx
- SSL
- Firewall
- Server-level cron
- Backups where enabled
You manage
- Broker configuration
- Topic structure
- Client authentication
- Access control lists
- TLS certificates
- Client applications
- Message schemas
- Monitoring alerts
Everything below the application line — from nginx to backups — is infrastructure. Your code, content and store configuration are always yours, and you keep full SSH and root access.
Frequently Asked Questions
The questions we hear most from people deploying MQTT on SharkCluster.
Contact supportMQTT is a lightweight publish-subscribe messaging protocol designed for constrained devices, IoT, telemetry and real-time communication. It uses a broker to route messages between publishers and subscribers.
Eclipse Mosquitto is a commonly used open-source MQTT broker. Other MQTT-compatible brokers can also be deployed.
MQTT brokers typically do not require a traditional database. Broker state, subscriptions and retained messages are stored in memory or on disk.
Yes. MQTT brokers can expose WebSocket endpoints for browser-based and web application clients alongside TCP connections.
MQTT supports QoS 0 (at-most-once), QoS 1 (at-least-once) and QoS 2 (exactly-once) delivery. Choose the level appropriate for your message reliability requirements.
Yes. MQTT is the standard messaging protocol for IoT devices, sensors, telemetry and machine-to-machine communication due to its lightweight design and efficient message delivery.
SharkCluster manages the server and broker infrastructure. Your topic structure, client configuration and access control remain under your control.
From deploy to live in minutes
Stack configured
Runtime, process manager and config files set up for you.
— wired
Database created with a user and credentials in your config.
SSL + firewall
Free Let's Encrypt certificate and closed-by-default UFW rules.
Deploy anytime
Push with Git, or use the built-in file manager and ZIP upload.
How do you start
with SharkCluster?
To start with SharkCluster, create an account and your first server on DigitalOcean, Contabo or OVHcloud — no credit card or lock-in contract is needed. Every account includes free self-hosted business apps, free local backups, unlimited migrations and a dedicated DevOps manager.