---
title: "Deploy EMQX"
description: "MQTT broker for IoT: dashboard, MQTT over TCP and WSS, data on a volume"
category: "Queues"
url: https://railway.com/deploy/emqx-1
---

# Deploy EMQX

MQTT broker for IoT: dashboard, MQTT over TCP and WSS, data on a volume

**[Deploy EMQX on Railway](https://railway.com/template/emqx-1)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/emqx-1/manifest.json

- **Creator:** Agaz Self-Host
- **Category:** Queues

## Template content

### EMQX https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/emqx.png

- **Source:** https://github.com/aalfath/emqx-railway-template
- **Health check:** /api/v5/status
- **Public domain:** Yes

## Documentation

# Deploy and Host EMQX on Railway

EMQX is an MQTT broker for IoT devices, sensors and apps. Devices publish messages to topics, and EMQX routes them to every client subscribed to those topics. It supports MQTT 3.1, 3.1.1 and 5.0 over TCP and WebSocket, and comes with a web dashboard for clients, users, rules and monitoring.

## About Hosting EMQX

This template runs EMQX 6.3.3 as one Railway service, built from a public GitHub repo that pins the official `emqx/emqx` image. Caddy, in the same container, puts the dashboard and MQTT over WebSocket (`wss://YOUR-DOMAIN/mqtt`) on the Railway domain, and a TCP proxy exposes plain MQTT on port 1883. MQTT clients must log in: the first user and the dashboard password are generated at deploy, and anonymous logins are refused. EMQX's built-in database (users, rules, retained messages, settings) lives on a volume, so it survives redeploys. New versions show up in Railway as an update you apply when you choose.

## Common Use Cases

* Collect telemetry from IoT devices, sensors and home automation systems
* Send commands and live updates to devices, mobile apps and web dashboards
* Route MQTT messages to other services with EMQX rules and webhooks

## Dependencies for EMQX Hosting

* One Railway service with a volume (no external database needed)
* An MQTT client or library to connect devices (for example MQTTX, mosquitto clients or Paho)

### Deployment Dependencies

* EMQX documentation: https://docs.emqx.com/en/emqx/latest/
* EMQX releases: https://github.com/emqx/emqx/releases
* Official Docker image: https://hub.docker.com/r/emqx/emqx
* Template repo: https://github.com/aalfath/emqx-railway-template

### Implementation Details

After deploy, open the Railway domain and sign in as `admin` with the `EMQX_DASHBOARD__DEFAULT_PASSWORD` variable. Connect MQTT clients with the `MQTT_USERNAME` and `MQTT_PASSWORD` variables:

* MQTT over TCP: `mqtt://RAILWAY_TCP_PROXY_DOMAIN:RAILWAY_TCP_PROXY_PORT` (shown under the service's Networking settings)
* MQTT over WebSocket: `wss://YOUR-DOMAIN/mqtt` on port 443
* Inside the Railway project: `mqtt://emqx.railway.internal:1883`

Add more MQTT users in the dashboard under Access Control, Authentication. This is a single EMQX node. EMQX 5.9 and later is released under the Business Source License 1.1, which allows free production use of a single node in your own environment; clustering or reselling EMQX as a hosted service needs a commercial license from EMQ.

## Why Deploy EMQX on Railway?


Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying EMQX on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.



## Similar templates

- [Celery | Web, Worker and Scheduler as Three Services](https://railway.com/deploy/celery-or-web-work-1) — Web, worker and scheduler wired up: Celery on Redis, outcomes in Postgres.
- [Redpanda](https://railway.com/deploy/redpanda-1) — Redpanda 26.2: Kafka-compatible streaming broker with Kafbat UI console
- [smoothmq](https://railway.com/deploy/AJv-64) — A drop-in replacement for AWS SQS

Open this page in a browser: https://railway.com/deploy/emqx-1
