---
title: "Deploy Lux"
description: "A drop-in Redis replacement. 3-5x faster."
category: "Storage"
url: https://railway.com/deploy/lux
---

# Deploy Lux

A drop-in Redis replacement. 3-5x faster.

**[Deploy Lux on Railway](https://railway.com/template/lux)**

- **Creator:** Techulus
- **Category:** Storage

## Template content

### lux https://github.com/lux-db/lux/raw/main/logo.png

- **Image:** ghcr.io/lux-db/lux:latest

## Documentation

---

# Deploy and Host Lux on Railway

Lux is a drop-in Redis replacement written in Rust. It's multi-threaded with a sharded concurrent architecture that delivers 3–5x faster throughput than Redis by using all available cores. It speaks the RESP protocol, so it works with every existing Redis client — zero code changes required.

## About Hosting Lux

Deploying Lux on Railway uses the official Docker image (`ghcr.io/lux-db/lux:latest`), which weighs in at just 856KB. Lux starts instantly and auto-tunes its shard count based on available CPU cores. For persistence, Lux takes automatic snapshots at a configurable interval (default 60 seconds), so you'll want a persistent volume to retain data across redeploys. Authentication can be enabled by setting the `LUX_PASSWORD` environment variable. Connect with any Redis client by pointing it at your Railway-provided domain — no code changes needed compared to an existing Redis setup.

## Common Use Cases

- Replacing Redis or Valkey as a high-performance caching layer with significantly higher throughput on multi-core machines
- Running a lightweight, persistent key-value store for session management, rate limiting, or pub/sub messaging
- Providing a Redis-compatible backend for existing applications using ioredis, redis-py, go-redis, or any other RESP client without code changes

## Dependencies for Lux Hosting

- Docker image: `ghcr.io/lux-db/lux:latest` (856KB)
- Persistent volume for snapshot data

### Deployment Dependencies

- [Lux GitHub Repository](https://github.com/lux-db/lux)
- [Lux Website & Cloud](https://luxdb.dev)
- [Architecture Deep Dive](https://luxdb.dev/architecture)
- [Benchmarks](https://luxdb.dev/vs/redis)

### Implementation Details

Environment variables for the Railway service:

| Variable | Default | Description |
|----------|---------|-------------|
| `LUX_PORT` | `6379` | TCP port |
| `LUX_PASSWORD` | *(none)* | Enable AUTH for client connections |
| `LUX_DATA_DIR` | `/data` | Snapshot directory (mount your volume here) |
| `LUX_SAVE_INTERVAL` | `60` | Snapshot interval in seconds (0 to disable) |
| `LUX_RESTRICTED` | *(none)* | Set to `1` to disable KEYS, FLUSHALL, FLUSHDB |

Mount a persistent volume at the path set in `LUX_DATA_DIR` to preserve snapshots across redeploys. Connect from your application services using a Railway private network reference variable for low-latency internal access.

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

- [Garage S3 Storage](https://railway.com/deploy/garage-s3-storage) — Ultra-light S3 server: fast, open-source, plug-and-play.
- [Redis](https://railway.com/deploy/redis-1) — Self Host Latest Redis with Railway
- [EasyImg](https://railway.com/deploy/easyimg) — Simple self-hostable Nuxt.js personal image hosting system.

Open this page in a browser: https://railway.com/deploy/lux
