Deploy NSQ

Realtime distributed messaging: nsqd with a volume, lookupd, secured admin

Deploy NSQ

/data

Just deployed

Just deployed

Deploy and Host NSQ on Railway

NSQ is an open-source, MIT-licensed realtime distributed messaging platform written in Go. Producers publish messages to topics on nsqd, consumers read them from channels, and nsqlookupd tells consumers where each topic lives. nsqadmin is its web UI for cluster stats, topics, channels and admin actions such as pausing or emptying a queue.

About Hosting NSQ

This template deploys NSQ v1.3.0 from the official nsqio/nsq image, pinned by version and digest, as three services built from a public GitHub repo. nsqd keeps topic metadata and queued messages on a Railway volume at /data, and gets 30 seconds on each redeploy to flush in-memory messages there, so queues survive restarts and updates. nsqd and nsqlookupd have no authentication of their own, so they stay on Railway's private network. Only nsqadmin gets a public domain, behind HTTP basic auth with a generated password. Health checks are set on all three services. Nothing has to be filled in at deploy.

Common Use Cases

  • Background job and task queues between services in the same Railway project
  • Event streaming and fan-out: one topic, several channels, each consumer group gets every message
  • Decoupling producers from slow consumers, with messages kept on disk when memory fills up

Dependencies for NSQ Hosting

  • nsqio/nsq v1.3.0 (nsqd, nsqlookupd, nsqadmin)
  • Caddy 2.11.9 as the basic-auth proxy in front of nsqadmin
  • A Railway volume for nsqd data

Deployment Dependencies

Implementation Details

After deploy, open the nsqadmin public URL and sign in as admin with the ADMIN_PASSWORD shown in that service's Variables tab.

From any other service in the same project, publish over HTTP and consume through nsqlookupd:

curl -d 'hello' "http://nsqd.railway.internal:4151/pub?topic=test"
# consumers: lookupd address nsqlookupd.railway.internal:4161, nsqd TCP nsqd.railway.internal:4150

To reach nsqd from outside Railway, add a TCP proxy on port 4150 only after you have protected it (for example with --auth-http-address), because NSQ accepts any client by default.

Updates: every service builds from the template's GitHub repo. When we bump NSQ there, Railway shows an "update available" notice in your project and you choose when to apply it. Read the repo's CHANGELOG.md first.

Why Deploy NSQ 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 NSQ 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.


Template Content

More templates in this category

View Template
Celery | Web, Worker and Scheduler as Three Services
Web, worker and scheduler wired up: Celery on Redis, outcomes in Postgres.

Templates Guru
0
View Template
Redpanda
Redpanda 26.2: Kafka-compatible streaming broker with Kafbat UI console

Agaz Self-Host
2
View Template
smoothmq
A drop-in replacement for AWS SQS

poundifdef
7