Deploy & Host Garnet | Railway

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

Dependencies for Garnet Hosting

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:

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.