
Deploy Garnet
Microsoft Garnet 2.1 Redis-compatible cache with auth and durable storage.
garnet
Just deployed
/data
Deploy and Host Garnet on Railway
Garnet is a high-performance cache-store from Microsoft Research that speaks the Redis RESP protocol. Existing Redis clients and libraries connect unchanged, while Garnet adds multi-threaded scaling, low tail latency and durable storage. It supports strings, hashes, lists, sets, sorted sets, streams, Lua scripts, transactions and pub/sub.
About Hosting Garnet
This template deploys Garnet v2.1.8 from the official image as a single service with password authentication. Writes go to an append-only log and checkpoints on a Railway volume at /data, and Garnet recovers them on every start, so data survives redeploys. Memory is capped at 512 MB for the store and 64 MB for the index, which suits the Hobby plan; raise both variables for larger datasets. Services connect over the private network on port 6379, and external clients use the Railway TCP proxy. Garnet uses its portable storage device, because Railway does not offer native async I/O.
Common Use Cases
- A drop-in Redis replacement for caching, sessions and rate limiting
- Queues and pub/sub for background jobs with Redis-based libraries such as BullMQ or Sidekiq
- Leaderboards and counters with sorted sets and atomic increments
Dependencies for Garnet Hosting
ghcr.io/microsoft/garnet:2.1.8(official image)- A Railway volume at
/datafor the append-only log and checkpoints - A Railway TCP proxy for external clients
Deployment Dependencies
Implementation Details
| Service | Image | Networking | Storage |
|---|---|---|---|
| garnet | ghcr.io/microsoft/garnet:2.1.8 | private 6379; TCP proxy to 6379 | volume at /data |
REDIS_URL=${{garnet.REDIS_URL}} # inside Railway
REDIS_PUBLIC_URL=${{garnet.REDIS_PUBLIC_URL}} # external, via TCP proxy
redis-cli -u "$REDIS_PUBLIC_URL" SET greeting hello
| Variable | Default | Purpose |
|---|---|---|
GARNET_PASSWORD | generated | Password for the default user |
GARNET_MEMORY / GARNET_INDEX | 512m / 64m | Store memory and hash index size |
Notes:
- The start command runs Garnet with
--aof --recover --device-type RandomAccess; keep it when editing the service. - The TCP proxy carries traffic without TLS; use the private network for production apps where possible.
This is a community-maintained deployment package and does not imply affiliation with or endorsement by the Garnet project or its maintainers.
Why Deploy Garnet 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 Garnet 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