ballsniffer246/redis-hf
0
Redis on HuggingFace Spaces
Runs the official Redis Docker image on HuggingFace Spaces, listening on port 7860 (the port HF Spaces exposes externally).
Environment Variables
All settings are configured through environment variables. Set them in your Space's Settings → Repository secrets / Variables panel.
Connecting
# From outside HuggingFace (replace with your Space URL)
redis-cli -h <your-space>.hf.space -p 7860
# With a password
# With username + password (ACL mode)
redis-cli -h <your-space>.hf.space -p 7860 --user $REDIS_USERNAME -a $REDIS_REQUIREPASS
# With password only
redis-cli -h <your-space>.hf.space -p 7860 -a $REDIS_REQUIREPASSLocal Development
# Build & run locally (uses docker-compose)
docker compose up --build
# Or with Docker directly
docker build -t my-redis .
docker run -p 7860:7860 \
-e REDIS_REQUIREPASS=mysecret \
-e REDIS_MAXMEMORY=512mb \
my-redisDeploying to HuggingFace Spaces
- Create a new Space → Docker SDK.
- Push this repo's contents to the Space repository.
- Set any desired environment variables in Settings → Variables and secrets.
- The Space will build and start Redis automatically.
Note: HuggingFace Spaces free tier is ephemeral — data is lost on restart. For persistence, mount an external volume or use AOF/RDB with HF persistent storage.
