Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk10 min

How to Self-Host an EMQX MQTT Broker on a VPS

A practical guide to running EMQX on your own VPS: choose Docker, set a stable node name, persist data and logs, expose the right listeners, secure MQTT with TLS and ACLs, and validate backups and recovery.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The fastest repeatable way to run EMQX on your own VPS is the official Docker image on a supported Linux host. Give the node a permanent name such as [email protected], persist /opt/emqx/data and /opt/emqx/log, expose only the listeners your clients need, and complete authentication, ACL, and TLS configuration before accepting Internet traffic.

This guide covers a single-node deployment, the ports and firewall rules it needs, first login, hardening, backups, and checks to run before production use.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose Docker or package installation

Docker is the shortest documented path

Docker makes the deployment reproducible: the broker version is explicit, upgrades can be rolled back to an earlier image, and the container can be replaced without losing state when its data and log directories are mounted on the VPS. The example in this guide uses the official emqx/emqx-enterprise:6.3.1 image. Image tags are time-sensitive, so check the current EMQX release and deliberately pin the version you intend to operate rather than silently tracking a moving tag.

Package installation is also supported

EMQX provides packages for a computer or virtual machine running Ubuntu, Debian, Rocky Linux/RHEL, or Amazon Linux. This route integrates the broker with the host’s service manager and filesystem, but it requires you to manage package repositories, upgrades, service limits, and configuration directly on the operating system. Use it when your organization standardizes on native packages or does not permit Docker; otherwise, Docker is usually easier to reproduce on a fresh VPS.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

Plan the VPS before installing EMQX

Use a supported Linux host with a stable name

Choose a Linux VPS on which you control the firewall, DNS, storage, and backups. Create a DNS record such as broker.example.com and make sure it resolves to the VPS address before starting the node. EMQX’s node name should follow the form emqx@<host>, using a stable fully qualified domain name or IP address. Treat that name as part of the node’s identity: changing it later can cause data loss.

Resolve the hostname from the VPS and from an administrative workstation before deployment. If the name resolves differently inside and outside your network, select one stable identity and correct DNS or use the VPS address consistently. Do not rename a running node casually during a migration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Size storage and compute from workload, not a universal number

There is no single official VPS size that fits every EMQX deployment. CPU, memory, disk capacity, and connection limits depend on client count, message rate, payload size, retained messages, rules, integrations, and logging. Estimate those variables, leave headroom, and monitor the host after representative traffic is connected.

  • Use a disk with enough capacity for EMQX state, retained data, logs, crash dumps, and backup staging.
  • Use a UTF-8 locale on the Linux host.
  • Check that every listener port you plan to use is free before launching the container.
  • Set file-descriptor and service limits appropriate to the expected number of connections; a default VPS limit may be too low for a large fleet.

Decide which listeners clients actually need

Do not publish every EMQX listener by default. Native MQTT clients commonly need encrypted MQTT on 8883. Browser applications need secure WebSocket on 8084. Plain MQTT on 1883 and unencrypted WebSocket on 8083 should be limited to internal or transitional networks. The Dashboard and REST API on 18083 should be reachable only by administrators, preferably through a VPN or an allowlisted management network.

Port Protocol and purpose Internet exposure
1883/TCP MQTT over unencrypted TCP Keep internal or transitional; do not use for untrusted networks.
8883/TCP MQTT over SSL/TLS Preferred native MQTT listener for untrusted networks.
8083/TCP MQTT over unencrypted WebSocket Use only where the network is trusted or during a controlled transition.
8084/TCP MQTT over secure WebSocket Preferred browser/WebSocket listener on untrusted networks.
18083/TCP EMQX Dashboard and REST API over HTTP Restrict to an administrator network or VPN.
4370/TCP Erlang distribution Internal control traffic; never open publicly.
5370/TCP and offset ports Cluster RPC Internal cluster traffic; never open publicly.

Prepare the VPS

Create persistent directories

Make host directories before starting the container so replacing the container does not remove broker state or crash evidence:

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
sudo mkdir -p /opt/emqx/data /opt/emqx/log
sudo chown -R 1000:1000 /opt/emqx/data /opt/emqx/log

The container runs as the emqx user with UID 1000. The log directory must be writable by that UID; otherwise EMQX may start with missing file logs or fail when it writes a crash dump. Keep the data and log paths on persistent VPS storage rather than an ephemeral container layer.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Open only required firewall paths

Use both the VPS provider’s security group and the Linux host firewall. Start with no public broker ports, then add only the listeners required by your client population. For example, an administrator allowlist can be expressed with a host firewall rule like:

sudo ufw allow from <admin-cidr> to any port 18083 proto tcp
sudo ufw allow 8883/tcp
sudo ufw allow 8084/tcp

Replace <admin-cidr> with the real management range. Omit 1883 or 8083 unless a defined internal or transitional use requires them. Never add 4370 or 5370 to public rules; cluster and Erlang control traffic belongs on a private network between nodes.

Start a single EMQX node with Docker

Run a pinned image with a permanent node name

After installing Docker Engine on the supported Linux VPS, create the container with persistent mounts and only the ports you selected. This representative command publishes all five client and management listeners so you can remove any that you do not need:

sudo docker run -d 
  --name emqx 
  --restart unless-stopped 
  -e [email protected] 
  -p 1883:1883 
  -p 8883:8883 
  -p 8083:8083 
  -p 8084:8084 
  -p 18083:18083 
  -v /opt/emqx/data:/opt/emqx/data 
  -v /opt/emqx/log:/opt/emqx/log 
  emqx/emqx-enterprise:6.3.1

Replace broker.example.com with the name that resolves to this VPS. Keep the node name unchanged for the life of the node. If you need only encrypted MQTT and secure WebSocket, remove the 1883 and 8083 mappings before starting. Publishing a port does not by itself configure certificates or make a listener secure; TLS must be configured inside EMQX.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

Confirm that the container and mounts are healthy

  1. Check that Docker reports the container as running with sudo docker ps.
  2. Inspect startup output with sudo docker logs emqx and verify there is no permission or listener-bind error.
  3. Confirm that files appear under /opt/emqx/data and /opt/emqx/log.
  4. From an intended client network, test only the ports you chose to expose. A connection failure on an intentionally unpublished port is expected.

Complete the first Dashboard login

The quick-start Dashboard is available at http://<host>:18083/. The getting-started example uses username admin and password public. These credentials are for initial access only.

  1. Open the Dashboard from the administrator network or VPN, not from the public Internet.
  2. Sign in with the quick-start credentials.
  3. Change the administrator password immediately and store it in your organization’s password manager.
  4. Restrict port 18083 at the provider firewall and host firewall after confirming access from the approved management network.
  5. Verify that the listener and authentication settings you intend to use are active before connecting real devices.

Secure EMQX before exposing MQTT publicly

Enable authentication and authorization

EMQX allows all clients to connect when authentication is not enabled. Configure an authentication source—such as the identity system appropriate to your deployment—and define authorization or ACL rules before opening a listener to the Internet. Authentication answers “who may connect”; authorization determines which topics that identity may publish or subscribe to. Test both separately with an allowed client and an intentionally unauthorized client.

Design topic permissions narrowly. A device should normally publish and subscribe only to the topics it needs, rather than receiving a wildcard grant across the entire namespace. Keep administrative identities separate from device identities and remove credentials that are no longer assigned.

Configure TLS on 8883 and 8084

Use TLS whenever traffic crosses an untrusted network. Install a certificate issued by a trusted certificate authority or by your controlled internal PKI, configure the matching private key, and present the correct server name to clients. Disable legacy protocol versions and weak ciphers according to your organization’s security baseline, and rotate certificates before they expire.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Clients must validate the certificate chain and hostname rather than silently accepting any certificate. A certificate for broker.example.com will not validate when a client connects to an unrelated IP address unless that address is also covered by the certificate.

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

Use mutual TLS when certificates identify clients

Mutual TLS (mTLS) is appropriate when each client should prove its identity with a certificate. Configure peer verification and provide EMQX with a trusted CA bundle. Certificate-to-username or certificate-to-client-ID mapping depends on that verified certificate identity; merely enabling server-side TLS does not establish client identity.

Keep plaintext and management surfaces private

Leave 1883 and 8083 on private networks or remove their published mappings. Keep 18083 restricted to administrators and avoid forwarding it through a general-purpose public reverse proxy unless the proxy and access policy are deliberately managed. The cluster-control ports 4370 and 5370, including their offsets, should remain on private node-to-node networks.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Connect a test client safely

Use a non-production client to validate the complete path: DNS, certificate trust, authentication, authorization, publish, and subscribe. For native MQTT, connect to the DNS name on 8883 with certificate verification enabled. For browser clients, use secure WebSocket on 8084 and the same trust and identity checks. Do not treat a successful TCP connection as proof that policy is correct; an authenticated client must also be able to perform only the topic operations granted by its ACL.

  1. Resolve the broker name from the client network and confirm it matches the certificate name.
  2. Connect with an identity that should be allowed and verify the broker accepts it.
  3. Publish a test message to a dedicated test topic and subscribe with a second authorized client.
  4. Attempt the same operation with a credential or topic that should be denied and verify rejection.
  5. Inspect Dashboard status and container logs for connection, TLS, or authorization errors.

Back up data and operate the node

Back up the data directory

For production safety, make periodic backups of /opt/emqx/data and exclude the trace folder. Store backups outside the VPS and protect them as sensitive operational data. Document which image version, node name, certificates, authentication source, and ACL configuration belong to each backup.

Run a restore exercise on a staging VPS before you need one in production. A backup that has never been restored is an assumption, not a recovery plan. The supplied installation guidance recommends the backup practice but does not establish a tested restore result for your environment.

Monitor logs, limits, and disk growth

Review the file logs under /opt/emqx/log and Docker’s container output for repeated authentication failures, listener errors, crashes, or resource exhaustion. Watch disk use for retained messages, rule or integration data, and log growth. Revisit file-descriptor and service limits as the connection count increases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Plan upgrades deliberately

Because the container command pins an image tag, an upgrade is an explicit change rather than an accidental pull of a newer build. Read the release documentation for the target version, back up the data directory, stage the change on a test VPS, and retain the previous image tag so you have a defined rollback option. Keep the node name and persistent mount paths unchanged during the replacement.

Troubleshoot common deployment failures

The container exits or cannot write logs

Check ownership of both mounted directories. The container’s EMQX user is UID 1000, so a root-owned or read-only /opt/emqx/log commonly causes startup or crash-dump failures. Correct ownership, restart the container, and inspect the logs again.

A port will not bind

Another process may already occupy the host port, or the provider firewall may reserve it. Check host listeners before starting EMQX and either stop the conflicting service or choose a different host mapping. Remember that changing a host port changes the address clients use; it does not change the EMQX listener inside the container.

Clients connect but are rejected

Separate transport from policy. A TLS or WebSocket handshake failure points to certificate, hostname, protocol, or listener configuration. A successful handshake followed by a rejected CONNECT, publish, or subscribe points to authentication or ACL policy. Inspect EMQX logs and verify the client is using the intended listener and credentials.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The Dashboard is unreachable

Confirm that 18083 is published, the container is running, and the provider and host firewalls allow the administrator’s source network. If the port is intentionally limited to a VPN or CIDR range, test from that network rather than from a random public connection.

A renamed node loses state

Do not change the node name as a troubleshooting shortcut. EMQX documents that changing a stable node name can cause data loss. Restore the original name and investigate DNS, certificate, or connectivity problems independently.

Pre-production checklist

  • The VPS hostname resolves consistently and matches the deliberate emqx@<host> node name.
  • The image tag is intentionally pinned, and the upgrade path is documented.
  • /opt/emqx/data and /opt/emqx/log are persistent, writable by UID 1000, and included in operations documentation.
  • Only required listeners are published; 4370 and 5370 remain private.
  • Plaintext listeners are internal or removed, while public MQTT uses 8883 or 8084 with certificate validation.
  • Authentication and ACL rules are active, and an unauthorized test operation is rejected.
  • The default Dashboard password has been replaced and port 18083 is restricted.
  • Certificates, trusted CA material, protocol settings, and renewal ownership are documented.
  • Data backups exclude trace, are stored off-host, and have a staging restore procedure.
  • Logs, disk usage, file descriptors, and service limits are monitored against the expected workload.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.