---
title: "Deploy NSQ"
description: "Realtime distributed messaging: nsqd with a volume, lookupd, secured admin"
category: "Queues"
url: https://railway.com/deploy/nsq
---

# Deploy NSQ

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

**[Deploy NSQ on Railway](https://railway.com/template/nsq)**

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

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

## Template content

### nsqd https://raw.githubusercontent.com/nsqio/nsq/v1.3.0/nsqadmin/static/img/nsq_blue.png

- **Source:** https://github.com/aalfath/nsq-railway-template
- **Health check:** /ping

### nsqadmin https://raw.githubusercontent.com/nsqio/nsq/v1.3.0/nsqadmin/static/img/nsq_blue.png

- **Source:** https://github.com/aalfath/nsq-railway-template
- **Health check:** /ping
- **Public domain:** Yes

### nsqlookupd https://raw.githubusercontent.com/nsqio/nsq/v1.3.0/nsqadmin/static/img/nsq_blue.png

- **Source:** https://github.com/aalfath/nsq-railway-template
- **Health check:** /ping

## Documentation

# 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

* NSQ documentation: https://nsq.io/overview/design.html
* NSQ v1.3.0 release: https://github.com/nsqio/nsq/releases/tag/v1.3.0
* Template source and changelog: https://github.com/aalfath/nsq-railway-template
* Client libraries: https://nsq.io/clients/client_libraries.html

### 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`:

```bash
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.



## 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/nsq
