---
title: "Deploy Dragonfly"
description: "Redis-compatible in-memory store: v2.1, password, snapshots on a volume"
category: "Storage"
url: https://railway.com/deploy/dragonfly-3
---

# Deploy Dragonfly

Redis-compatible in-memory store: v2.1, password, snapshots on a volume

**[Deploy Dragonfly on Railway](https://railway.com/template/dragonfly-3)**

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

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

## Template content

### Dragonfly https://www.dragonflydb.io/favicon.svg

- **Source:** https://github.com/aalfath/dragonfly-railway-template
- **Health check:** /metrics

## Documentation

# Deploy and Host Dragonfly on Railway

Dragonfly is an in-memory data store that speaks the Redis and Memcached protocols, so existing Redis clients, libraries and tools work with it unchanged. It uses a multi-threaded, shared-nothing design to get more throughput and better memory efficiency from one machine. Use it as a cache, queue backend, session store or primary key-value database.

## About Hosting Dragonfly

Hosting Dragonfly means running one long-lived server process, keeping its data on disk so a restart doesn't empty it, and protecting it with a password. This template builds Dragonfly v2.1.0 from the official image, pinned by digest, through a small GitHub wrapper repo. It generates a 32-character password, stores snapshots on a Railway volume at `/data` (every 5 minutes and on shutdown) and loads them on start. It runs 2 I/O threads by default, because a container sees all of the host's CPUs. Other services reach it over Railway's private network. A TCP proxy allows password-protected access from outside Railway.

## Common Use Cases

* Cache and session store for web apps that already use Redis
* Backend for job queues such as BullMQ, Sidekiq or Celery
* Fast key-value, pub/sub and rate-limiting store for APIs and bots

## Dependencies for Dragonfly Hosting

* One Railway service built from the `aalfath/dragonfly-railway-template` GitHub repo
* A Railway volume mounted at `/data` for snapshots

### Deployment Dependencies

* Dragonfly documentation: https://www.dragonflydb.io/docs
* Dragonfly v2.1 release notes: https://github.com/dragonflydb/dragonfly/releases/tag/v2.1
* Template repo: https://github.com/aalfath/dragonfly-railway-template
* Dragonfly licence (DSAL): https://github.com/dragonflydb/dragonfly/blob/main/LICENSE.md

### Implementation Details

Connect another service in the same project with a reference variable:

```
REDIS_URL=${{Dragonfly.REDIS_URL}}
```

`DRAGONFLY_URL` holds the same private URL, and `DRAGONFLY_PUBLIC_URL` the URL through the TCP proxy. Any Dragonfly flag can be set as a `DFLY_` variable, for example `DFLY_maxmemory=2gb`, `DFLY_cache_mode=true` or `DFLY_proactor_threads=4` (each thread needs about 256 MB). If you don't need access from outside Railway, remove the TCP proxy in the service's networking settings. From v2.1 Dragonfly is licensed under the Dragonfly Source-Available License: production use is free up to 100 vCPUs in total. Updates to this template arrive as Railway update notices when the wrapper repo's `main` changes; read its `CHANGELOG.md` before applying one.

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

- [RustFS | (Just Updated) S3 Object Store, Public URL and Keys Set](https://railway.com/deploy/rustfs-or-just-updated-s3-object-store-p) — S3-compatible object store, keys and public URL preset, volume kept
- [TimescaleDB](https://railway.com/deploy/timescaledb-railway-template) — A PostgreSQL-based time-series database for analytics on Railway.
- [Neo4j 2026.10 Community](https://railway.com/deploy/neo4j-202610-community) — Neo4j graph database with APOC, Browser, Bolt TCP proxy and a volume

Open this page in a browser: https://railway.com/deploy/dragonfly-3
