Deploy Dragonfly

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

Deploy Dragonfly

/data

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

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.


Template Content

More templates in this category

View Template
RustFS | (Just Updated) S3 Object Store, Public URL and Keys Set
S3-compatible object store, keys and public URL preset, volume kept

SuperSlowSloth
0
View Template
TimescaleDB
A PostgreSQL-based time-series database for analytics on Railway.

Rakit
1
View Template
NEW
Neo4j 2026.10 Community
Neo4j graph database with APOC, Browser, Bolt TCP proxy and a volume

My Projects
0