Redis Setup
Leyu uses Redis v7+ for caching and background tasks.
Steps
1. Install Redis Locally
Follow the instructions for your operating system from the official Redis documentation: https://redis.io/docs/latest/operate/redisinsight/install/
2. Start Redis Server
# Start Redis server locally
redis-server
3. Configure Backend
Set the Redis URL in your .env file:
REDIS_URL="redis://localhost:6379"
Optional: Run Redis Using Docker
If you prefer to run Redis in a container:
docker run --name leyu-redis -p 6379:6379 -d redis:7
-
--name leyu-redis: name of the container -
-p 6379:6379: map local port 6379 to container port 6379 -
-d redis:7: run Redis version 7 in detached mode
After starting the container, your backend .env can remain:
REDIS_URL="redis://localhost:6379"
You can verify the container is running:
docker ps
For more Docker options, check the official Redis Docker guide: https://hub.docker.com/_/redis