Self-host NSQ with Levelrail
A realtime distributed message queue with a lookup daemon, a queue daemon and the nsqadmin web page, run together. Producers and consumers in this project connect to nsqd:4150 and nsqd:4151.
- Authornsqio
- LicenceMIT
- Memory256 MiB
- Services3
How to self-host NSQ
-
Pull the images
3 images are pulled on your server.
Show images
nsqio/nsq:v1.3.0nsqio/nsq:v1.3.0nsqio/nsq:v1.3.0
-
Create the app
3 services start in a single Compose app, with 1 named volume mount for your data, on ports 4171, 4150, 4151, 4161.
-
Fill in the secrets
You do not have to fill in anything.
-
Open it
Without a domain the app gets an sslip.io address; add --domain SERVICE=HOST to use your own.
After the first start
- Open nsqadmin to watch topics and channels, then publish to nsqd:4151 from a service in this project.
NSQ requirements
- Memory
- About 256 MiB
- Architectures
- amd64 unknown, arm64 unknown
- Ports
- 4171, 4150, 4151, 4161
- Domain
- Optional, an sslip.io address is used without one
- Settings
- none to fill in
- License
- MIT, permissive license
- Listed. It is in the catalog but not verified. Back up the data volume before changing an image tag.
Install Levelrail first
On a server with Levelrail running, run the command above, or open the dashboard: Apps, New app, Browse templates, then NSQ. New to Levelrail? Install it on a fresh VPS first.
docker pull ghcr.io/glincker/levelrail:latest Then levelrail-cli login --device. See Getting started and the NSQ docs page.
Deploy NSQ your way
Every format below deploys the same pinned images. Pick the one that fits how you work.
Deploy NSQ from the CLI
levelrail-cli templates deploy nsq --name my-nsq Deploy NSQ with the API
curl -X POST -H "Authorization: Bearer $TOKEN" \
https://levelrail.example.com/api/v1/service-templates/nsq/deploy NSQ configuration
NSQ services
| Service | Image | Ports | Volumes |
|---|---|---|---|
| nsqadmin | nsqio/nsq:v1.3.0 | 4171 | none |
| nsqd | nsqio/nsq:v1.3.0 | 4150, 4151 | nsqd_data -> /data |
| nsqlookupd | nsqio/nsq:v1.3.0 | 4161 | none |
NSQ environment variables
The catalog lists no environment variables for this template.
Ports and volumes
- Ports
- 4171, 4150, 4151, 4161
- Volumes
- 1 named mount: nsqd_data -> /data
NSQ FAQ
How much memory does NSQ need?
The catalog lists about 256 MiB of memory for NSQ across its 3 services.
Does NSQ run on arm64?
For NSQ, arm64 support is not confirmed; amd64 is unknown.
What licence is NSQ under?
NSQ is licensed under MIT, which is permissive, with few conditions on reuse.
Does NSQ need configuration before it starts?
No. The template fills in its own defaults.
Which ports does NSQ use?
NSQ listens on ports 4171, 4150, 4151 and 4161 inside the stack.
Where does NSQ keep its data?
In a named volume: nsqd_data mounted at /data.
Can I deploy NSQ on Dokploy or Dokku?
The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for NSQ, so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image nsqio/nsq:v1.3.0, nsqio/nsq:v1.3.0, nsqio/nsq:v1.3.0 is what you deploy there.