EMQX - MQTT broker (with SSL/TLS support for MQTTS and WSS) #3126
nktnet1
started this conversation in
Show and tell
Replies: 1 comment 15 replies
-
|
Are you sure with post numbers? I cannot connect. Als I had to add. networks:
dokploy-network:
external: trueBecause I had an error that dokploy-network does not exists, Also Are ports ok? On you imaged in traefik yaml and traefik config you use 8883. Abd in traefik lables 1883. I cannot if I use remote client I cannot connect. I use dokploy IP or domain nothing seams to work. |
Beta Was this translation helpful? Give feedback.
15 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment



Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Below are instructions for how to set up the EMQX broker in Dokploy with SSL/TLS, and with support for MQTTS and Websocket Secure.
Many steps will be similar to my instructions for encrypted Postgres.
Instructions
In your VPS (e.g. Hetzner), ensure that port
8883(for MQTTS) and443(for WSS) are opened in the firewallEdit
/etc/dokploy/traefik/traefik.yml(you can do this in both CLI or Dokploy UI) to have the following entrypoints:On Dokploy, go to
Web Server -> Traefik -> Additional Port Mappingand add the TCP mapping8883:8883:Note that Traefik may be reloaded in this step which will result in downtime for a few seconds (if not, you will still need to reload Traefik manually).
Add a DNS entry for your domain/subdomain (e.g. an A record pointing to
broker.yourdomain.com). If you're using Cloudflare, make sure to turn off proxy (i.e. DNS Only) if you want to use MQTT over TCP.Create a Dokploy compose service with the following:
Make sure to change your domain (in both the labels above for MQTTS over TCP, as well as Dokploy domain settings for dashboard and WSS) as appropriate.
Personally, I've set the EMQX dashboard to
emqx.yourdomain.com, the MQTTX client onmqttx.yourdomain.com, and the broker onbroker.yourdomain.com.The dashboard and web client can have Cloudflare proxy enabled, but not the broker (for TCP connections). If you're using websocket connections only, then it doesn't matter. You could even introduce a
wss-broker.yourdomain.comwith proxy on if you wish.The initial dashboard credentials are:
For clients to connect, you will need to create client credentials in the EMQX dashboard at
emqx.yourdomain.com:(click "users", then "add")
Then simply connect to
broker.yourdomain.comat either port 8883 (for TCP) or443(for WebSocket) with your user credentials.Template Pull Request:
Beta Was this translation helpful? Give feedback.
All reactions