---
title: "Deploy LavinMQ"
description: "LavinMQ 2.9: fast AMQP 0-9-1 message broker, RabbitMQ compatible."
category: "Queues"
url: https://railway.com/deploy/lavinmq
---

# Deploy LavinMQ

LavinMQ 2.9: fast AMQP 0-9-1 message broker, RabbitMQ compatible.

**[Deploy LavinMQ on Railway](https://railway.com/template/lavinmq)**

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

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

## Template content

### lavinmq https://raw.githubusercontent.com/cloudamqp/lavinmq/v2.9.3/static/img/favicon.png

- **Image:** cloudamqp/lavinmq:2.9.3
- **Start command:** `sh -c 'H=$(lavinmqctl hash_password "$LAVINMQ_PASSWORD") && exec /usr/bin/lavinmq -b :: -D /var/lib/lavinmq --http-port "$PORT" --default-user-only-loopback=false --default-user "$LAVINMQ_USER" --default-password-hash "$H"'`
- **Health check:** /login
- **Public domain:** Yes

## Documentation

# Deploy and Host LavinMQ on Railway

LavinMQ is a fast message broker written in Crystal by CloudAMQP. It implements AMQP 0-9-1 and MQTT, so RabbitMQ clients and libraries work unchanged, while using far less memory per queue. It includes a management UI and HTTP API, streams, shovels, federation and a Prometheus metrics endpoint.

## About Hosting LavinMQ

This template runs the official `cloudamqp/lavinmq:2.9.3` image. The management UI is on the Railway domain, and AMQP on port 5672 is published through a Railway TCP proxy for clients outside Railway. The image's default `guest/guest` user is replaced: the start command creates `LAVINMQ_USER` with a hashed, generated password, and remote logins by `guest` fail. Messages and definitions live on a Railway volume at `/var/lib/lavinmq`, so durable queues survive redeploys. `AMQP_URL` gives services in the same project a private connection string, and `AMQP_PUBLIC_URL` is for external clients. It fits the Hobby plan for moderate traffic.

## Common Use Cases

- A drop-in RabbitMQ replacement for Celery, Sidekiq-style or custom workers
- Background job and event queues between services in one project
- Receiving AMQP messages from apps running outside Railway

## Dependencies for LavinMQ Hosting

- `cloudamqp/lavinmq:2.9.3` (official image)
- A Railway volume at `/var/lib/lavinmq`
- A Railway TCP proxy for AMQP (5672)

### Deployment Dependencies

- [LavinMQ documentation](https://lavinmq.com/documentation)
- [LavinMQ v2.9.3 release](https://github.com/cloudamqp/lavinmq/releases/tag/v2.9.3)
- [Railway TCP proxy](https://docs.railway.com/reference/tcp-proxy)

### Implementation Details

| Service | Source | Networking | Storage |
| --- | --- | --- | --- |
| lavinmq | `cloudamqp/lavinmq:2.9.3` | UI on the public domain (15672); AMQP via TCP proxy and privately on 5672 | volume at `/var/lib/lavinmq` |

Connect from another service in the project:

```bash
AMQP_URL=${{lavinmq.AMQP_URL}}
```

| Variable | Default | Purpose |
| --- | --- | --- |
| `LAVINMQ_USER` | `admin` | Administrator created at start |
| `LAVINMQ_PASSWORD` | generated | Its password (stored hashed) |
| `AMQP_URL` | private URL | For services in the same project |
| `AMQP_PUBLIC_URL` | TCP proxy URL | For clients outside Railway |

Notes:

- The TCP proxy carries plain AMQP; use it for trusted clients or add TLS termination in front.
- Manage further users and vhosts in the management UI.
- Only AMQP is published; add another TCP proxy for MQTT (1883) if you need it.

This is a community-maintained deployment package and does not imply affiliation with or endorsement by CloudAMQP or the LavinMQ project.

## Why Deploy LavinMQ 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 LavinMQ 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

- [smoothmq](https://railway.com/deploy/AJv-64) — A drop-in replacement for AWS SQS
- [Kafka UI](https://railway.com/deploy/kafka-ui) — Kafbat UI — Open-source web UI to monitor and manage Apache Kafka clusters
- [NATS + JetStream](https://railway.com/deploy/nats-jetstream) — An open source messaging system that promises at-most-once delivery.

Open this page in a browser: https://railway.com/deploy/lavinmq
