Deploy Garnet

Microsoft Garnet 2.1 Redis-compatible cache with auth and durable storage.

Deploy 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 /data for the append-only log and checkpoints
  • A Railway TCP proxy for external clients

Deployment Dependencies

Implementation Details

ServiceImageNetworkingStorage
garnetghcr.io/microsoft/garnet:2.1.8private 6379; TCP proxy to 6379volume 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
VariableDefaultPurpose
GARNET_PASSWORDgeneratedPassword for the default user
GARNET_MEMORY / GARNET_INDEX512m / 64mStore 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

More templates in this category

View Template
smoothmq
A drop-in replacement for AWS SQS

poundifdef
7
View Template
Kafka UI
Kafbat UI — Open-source web UI to monitor and manage Apache Kafka clusters

codestorm
0
View Template
NEW
NATS + JetStream
An open source messaging system that promises at-most-once delivery.

Brayan Castaneda
1