Redis 7 Setup
Deploy a Redis 7 instance on Witchly.host. Configure authentication, connect from your apps, and understand persistence.
applications (9 articles)
On This Page
Redis 7 Setup
Redis is an in-memory data store used as a cache, session store, message broker, queue, rate limiter, and lightweight database. Witchly runs Redis 7 with password authentication and optional persistence to disk.
Typical uses
- Cache layer — speed up slow DB queries
- Session store — share sessions across multiple app servers
- Queues — background jobs via BullMQ, Sidekiq, RQ, etc.
- Pub/Sub — simple real-time messaging between services
- Rate limiting — token-bucket or sliding-window counters
Deploying
- dash.witchly.host → Deploy → Applications → Redis-7.
- Pick a tier based on your working set (the amount of data you expect to keep hot in memory).
- Click Deploy.
Configuration
On the Startup tab, set:
| Variable | What it does |
|---|---|
SERVER_PASSWORD | Password required to connect (AUTH command) |
Change the default password. The egg ships with a placeholder; anyone who can reach your server’s port could connect otherwise.
The egg launches Redis with:
redis-server /home/container/redis.conf \
--save 60 1 \
--dir /home/container/ \
--bind 0.0.0.0 \
--port {{SERVER_PORT}} \
--requirepass {{SERVER_PASSWORD}} \
--maxmemory {{SERVER_MEMORY}}mb \
--maxmemory-policy allkeys-lru
--save 60 1— snapshot to disk every 60s if at least 1 key changed--maxmemory— caps memory at your plan’s RAM; evicts with LRU when full
Want to tweak further? Edit redis.conf via the File Manager and Reinstall to apply.
Connecting
From your application:
// Node.js (ioredis)
import Redis from "ioredis"
const redis = new Redis({
host: "your-server-ip.witchly.host",
port: 12345, // your Redis port from Overview tab
password: "your-password",
})
# Python (redis-py)
import redis
r = redis.Redis(host="your-server-ip.witchly.host", port=12345, password="your-password")
# redis-cli (test from any Linux box)
redis-cli -h your-server-ip.witchly.host -p 12345 -a your-password ping
# → PONG
Persistence
Redis’s default persistence is RDB snapshots (dump.rdb in /home/container/). For stricter durability, enable AOF (append-only file) by editing redis.conf:
appendonly yes
appendfsync everysec
AOF has a small performance cost but survives crashes with at most 1 second of data loss.
Monitoring memory
Redis is single-threaded, and once memory is full, new writes are rejected (or evict old keys under LRU). Watch via redis-cli:
redis-cli INFO memory
# used_memory_human:...
Or expose this in Uptime Kuma as a Push monitor for alerting.
Security notes
- Never expose Redis to the public internet without a password.
- Even with a password, consider pairing Redis with a firewall or VPN if your app and Redis aren’t on the same network.
- Watch for
FLUSHALLandCONFIGabuse — setrename-commandinredis.confto disable dangerous commands in production.
Troubleshooting
NOAUTH Authentication required— your client didn’t send the password; check thepasswordfield in your client config.- Connection refused — verify you’re using the right port from the Overview tab and that the server is running (Console tab).
OOM command not allowed— working set exceeded your plan’s RAM; upgrade or tunemaxmemory-policy.
Next steps
- Use Redis + MariaDB together for fast-read / durable-write patterns
- Enable backups so
dump.rdbis preserved