MQTT broker total cost of ownership is the full cost of running messaging for your devices over several years, not just the server or subscription line on an invoice. In this guide you will build a TCO model that captures infrastructure, engineering time, on-call, incidents and risk, apply it to self-hosted and managed options, and learn which assumptions move the result most. The model contains no vendor prices; you plug in your own rates and quotes.
Why TCO Beats Sticker Price
The visible cost of a self-hosted broker is a virtual machine and perhaps a load balancer. The visible cost of a managed broker is a subscription. Comparing those two numbers almost always makes self-hosting look cheaper, and the comparison is almost always wrong, because the largest costs of self-hosting are people and risk, which never appear on a cloud bill.
The reverse can also be true. For a large, stable workload operated by a team that already runs similar infrastructure, self-hosting can be the cheaper option over several years. A good TCO model does not assume an answer; it makes the assumptions explicit so you can argue about them.
The Cost Categories
1. Infrastructure
- Compute for broker nodes, sized for peak connections and message rate, plus redundancy if you need high availability.
- Load balancers and public IP addresses.
- Storage for persistence, logs and backups.
- Network egress, which can be significant for high fan-out workloads.
- Monitoring and logging services.
- Non-production environments: staging and test brokers.
2. Initial Engineering
- Selecting, installing and hardening the broker.
- TLS certificate automation and renewal.
- Authentication: password files, an auth plugin or an identity integration.
- Monitoring dashboards and alert rules.
- Infrastructure as code, backups and runbooks.
- Security review and penetration testing.
3. Ongoing Operations
- Operating system and broker patches, and testing them before rollout.
- Certificate rotation, credential management and onboarding of new devices.
- Capacity planning and scaling events.
- Upgrades across major broker versions.
- Answering "is the broker the problem?" for application teams.
4. On-Call
If devices in the field depend on the broker around the clock, someone must be reachable around the clock. On-call has a cost even in quiet weeks: rota allowances, the constraint on personal time, and the fact that a rota needs several trained people to be sustainable.
5. Incidents
Incidents cost engineering hours to resolve, but often more in business impact: lost data, missed commands, field service visits, SLA penalties to your own customers and reputational damage. Estimate them as expected value: likely incidents per year multiplied by average impact.
6. Opportunity Cost
Every hour spent on broker plumbing is an hour not spent on your product. This is hard to quantify but often decisive for small teams.
7. Managed Service Costs
For a managed broker, add the subscription or usage charges (see MQTT broker pricing for the models), plus the remaining internal work: credential management, client-side monitoring and integration services. Operations do not drop to zero, but broker infrastructure, patching, certificates and broker-level on-call move to the provider.
Building the TCO Model
Model at least three years, because initial engineering is front-loaded and migrations are expensive. Work in hours for people and convert at your loaded hourly rate (salary plus overhead).
Inputs
H_rate loaded cost per engineering hour
Y years in the model (3 recommended)
Infra_m monthly infrastructure cost (all environments)
Build_h initial engineering hours
Ops_h_m ongoing operations hours per month
OnCall_m monthly on-call cost (allowances + rota overhead)
Inc_y expected incidents per year
Inc_h engineering hours per incident
Inc_impact business impact per incident
Sub_m monthly managed-service subscription or usage
Int_h_m internal hours per month that remain with a managed service
Self-hosted TCO
= Build_h x H_rate
+ Y x 12 x (Infra_m + Ops_h_m x H_rate + OnCall_m)
+ Y x Inc_y x (Inc_h x H_rate + Inc_impact)
Managed TCO
= Onboarding_h x H_rate
+ Y x 12 x (Sub_m + Int_h_m x H_rate)
+ Y x Inc_y_managed x (Inc_h_managed x H_rate + Inc_impact)
Note that the managed formula still includes incidents. A provider operates the broker, but your network, devices and integrations can still fail, and provider outages happen too. What changes is usually the frequency of self-inflicted incidents, such as expired certificates or a full disk, and who does the recovery work.
A Worked Example in Hours
To show the shape of the result without inventing prices, here is an illustrative effort estimate for a modest production deployment: a few hundred devices, high availability required, and a team without existing broker expertise. Replace every number with your own.
| Item | Self-hosted (example assumption) | Managed (example assumption) |
|---|---|---|
| Initial build and hardening | 120 hours | 16 hours onboarding |
| Ongoing operations | 16 hours / month | 4 hours / month |
| On-call rota | Required for broker | Not required for broker infrastructure |
| Incidents per year | 3 | 1 |
| Hours per incident | 12 | 4 |
| Infrastructure | Your cloud bill for 2+ nodes, LB, monitoring | Included in subscription |
Over three years, those assumptions give roughly 120 + 36 x 16 + 3 x 3 x 12 = 804 engineering hours for self-hosting, against 16 + 36 x 4 + 3 x 1 x 4 = 172 hours for a managed service, before infrastructure, subscription, on-call and business impact. Multiply by your hourly rate, add the money lines, and the comparison becomes concrete. Your assumptions may differ widely; the point is to write them down.
Sensitivity: Which Assumptions Matter Most
Run the model with optimistic and pessimistic values for each input. In most models, a few inputs dominate:
- Loaded hourly rate: high rates make every operational hour expensive and favour managed services.
- Incident impact: if a broker outage stops production lines or customer-facing features, expected incident cost can dwarf everything else.
- High availability: requiring HA multiplies self-hosted infrastructure and complexity.
- Existing expertise: a team already running similar systems has lower build and ops hours.
- Scale: at very large, steady scale, infrastructure efficiency matters more, and self-hosting or dedicated capacity can win.
- Compliance: data residency or isolation requirements may rule options in or out regardless of cost.
Self-Hosted, Managed and the Options in Between
TCO is not a binary choice. ConnectMQ, for example, offers several deployment models that shift the balance differently:
| Model | Who runs infrastructure | Who operates the broker | TCO profile |
|---|---|---|---|
| Self-hosted open source | You | You | Lowest direct cost, highest people cost |
| Serverless managed | Provider | Provider | Usage-based, minimal operations |
| Dedicated managed | Provider | Provider | Predictable capacity, isolation |
| BYOC | Your cloud account | Provider | Uses existing cloud commitments, provider operates |
| Self Managed Enterprise | You | You, with vendor software | Full control on your infrastructure |
For a balanced view of the operational differences, read self-hosted vs managed MQTT broker, and see migrate Mosquitto to cloud MQTT if the model points towards moving.
TCO Checklist
- Model at least three years.
- Include all environments, not only production.
- Convert all people time at a loaded hourly rate.
- Include on-call as a standing cost.
- Estimate incidents as frequency times impact.
- Include migration costs in and out.
- Run optimistic and pessimistic scenarios.
- Revisit the model after six months with measured data.
Model Your Costs with ConnectMQ
The most reliable input to any TCO model is measured usage. Create a free broker at app.connectmq.com on the Serverless plan, with no credit card, run a pilot and record the hours you actually spend. ConnectMQ is a managed MQTT broker that lets you move from Serverless to Dedicated, BYOC or Self Managed Enterprise without changing client code. Our cloud MQTT broker guide explains the deployment models, and you can explore what an MQTT broker does if you are new to the topic.
Frequently Asked Questions
What is the biggest hidden cost of a self-hosted MQTT broker?
Usually people time: initial hardening, ongoing patching, certificate management and on-call. Incident impact can be even larger if devices or customers depend on the broker.
Is a managed MQTT broker always cheaper?
No. For large, steady workloads run by an experienced team, self-hosting or dedicated capacity can cost less over time. A TCO model with your own assumptions shows which applies to you.
How many years should an MQTT broker TCO model cover?
At least three years. Shorter horizons overweight initial build costs and ignore upgrades, staff changes and the cost of migrating later.
Does TCO include the cost of leaving a vendor?
It should. Standard MQTT clients and topic structures keep exit costs low, while proprietary APIs and rule engines raise them. Include an estimate for migrating out.



