---
title: "Free Public MQTT Broker — MQTT 5 Test Server | ConnectMQ"
description: "A free public MQTT broker at broker.connectmq.com for learning, prototyping and testing: MQTT 3.1.1 and 5 over TCP, TLS, WebSocket and secure WebSocket."
url: "https://connectmq.com/public-mqtt-broker/"
language: "en"
---

Public MQTT broker

# Free public MQTT broker

A free, shared MQTT broker for learning, prototyping and testing. Connect any MQTT 3.1.1 or MQTT 5 client and start publishing in seconds.

Broker address`broker.connectmq.com`

-   MQTT 3.1.1 and MQTT 5
-   TCP, TLS, WebSocket and secure WebSocket
-   Works with any MQTT client

Connect

## Connection details

Use the port that matches your client. Browsers need WebSocket; prefer the encrypted ports whenever your client supports them.

| Protocol | Port | Address | Description |
| --- | --- | --- | --- |
| MQTT | 1883 | `mqtt://broker.connectmq.com:1883` | Unencrypted TCP |
| MQTT over TLS | 8883 | `mqtts://broker.connectmq.com:8883` | TLS-encrypted TCP |
| WebSocket | 8083 | `ws://broker.connectmq.com:8083/mqtt` | WebSocket, path /mqtt |
| Secure WebSocket | 8084 | `wss://broker.connectmq.com:8084/mqtt` | Secure WebSocket, path /mqtt |

### Before you use the public broker

-   It is public and shared: anyone can subscribe to any topic, including yours.
-   Never send passwords, personal data or anything confidential.
-   Use a unique topic prefix (for example your-project/…) so your messages do not mix with others.
-   There is no guarantee of availability or message retention, and abusive traffic may be blocked.
-   For real devices and production data, use a private ConnectMQ broker.

Try it

## Your first message in two commands

With the mosquitto command-line tools installed, subscribe in one terminal and publish from another.

[Code samples for Python, Node.js, browsers, ESP32 and Go](https://connectmq.com/code-samples/)

Subscribe

```
mosquitto_sub -h broker.connectmq.com -p 1883 -t "your-project/#" -v
```

Publish

```
mosquitto_pub -h broker.connectmq.com -p 1883 -t "your-project/hello" -m "Hello from ConnectMQ"
```

Going to production

## From the public broker to your own

### Public broker

-   Free and shared with everyone
-   No authentication or access control
-   No guarantees — for learning and tests

### Private ConnectMQ broker

-   Isolated broker for your devices only
-   TLS, username/password and per-topic access control
-   Dashboard, rules, alerts and Digital Twin

[Get started](https://app.connectmq.com/signup) [See pricing](https://connectmq.com/pricing/)

## Public broker FAQ

Is the public MQTT broker free?

Yes. The public broker at broker.connectmq.com is free to use for learning, prototyping and testing.

Is it secure to use?

Traffic on the TLS and secure WebSocket ports is encrypted, but the broker itself is public: anyone can subscribe to your topics. Do not send sensitive data through it.

Which MQTT versions are supported?

MQTT 3.1.1 and MQTT 5, over TCP (1883), TLS (8883), WebSocket (8083) and secure WebSocket (8084), both WebSocket ports with the path /mqtt.

Can I use it in production?

No. The public broker has no access control and no guarantees. For real devices, create a private ConnectMQ broker — start on the Free plan with no card.

## Ready for your own private broker?

Create an account, get your broker credentials and connect your first device — no servers to install, patch or scale.

[Get started](https://app.connectmq.com/signup) [See pricing](https://connectmq.com/pricing/)

## Articles

[All articles](https://connectmq.com/blog/)

IoT Tutorials

### [Free Public MQTT Broker for Testing: Connect to broker.connectmq.com in Minutes](https://connectmq.com/blog/free-public-mqtt-broker/)

broker.connectmq.com is a free public MQTT broker for testing and learning. Here are the ports, the anonymous access rules, the limits and copy-paste examples for the CLI, Python, Node.js and the browser.

September 20, 20267 min read

MQTT Fundamentals

### [What Is an MQTT Broker? A Beginner's Guide to Publish/Subscribe Messaging](https://connectmq.com/blog/what-is-an-mqtt-broker/)

An MQTT broker is the hub that routes every message between IoT devices and apps. Learn publish/subscribe, topics and wildcards, sessions, QoS, retained messages and last will, then try it hands-on in minutes.

August 25, 20269 min read

MQTT Fundamentals

### [MQTT QoS Levels Explained: QoS 0, 1 and 2 with Packet Flows and Examples](https://connectmq.com/blog/mqtt-qos-levels-explained/)

A practical guide to MQTT QoS: how QoS 0, 1 and 2 work on the wire, why the delivered QoS can be lower than you asked for, how sessions queue messages and which level to choose for each use case.

August 20, 20269 min read
