How to Set Up Redis for Cross-Server Data
Install and configure Redis for cross-server player data, messaging, and proxy-level syncing. Covers RedisBungee, RedisChat, pub/sub, security and performance.
What Redis Is and When You Need It
Redis is an in-memory key-value data store. Unlike MySQL, which writes data to disk and is designed for durable, structured storage, Redis keeps everything in RAM and is optimized for speed. A Redis GET or SET operation completes in microseconds, not milliseconds. This makes Redis ideal for data that needs to be shared across servers in real time, things like online player lists, cross-server chat, session tokens, and live statistics.
You do not need Redis on a single-server setup. SQLite or MySQL handles everything just fine when there is only one Minecraft server reading and writing data. Redis becomes valuable when you run a network: a Velocity or BungeeCord proxy in front of multiple backend servers (survival, creative, minigames). In that architecture, each backend is a separate Java process with its own memory space. Redis acts as the shared memory layer that lets them communicate instantly.
Redis vs MySQL, Different Tools for Different Jobs
A common misconception is that Redis replaces MySQL. It does not. They serve different purposes:
| Aspect | MySQL | Redis |
|---|---|---|
| Data model | Relational tables (SQL) | Key-value pairs, lists, sets, pub/sub |
| Persistence | Durable (written to disk) | Primarily in-memory (optional persistence) |
| Speed | Fast (ms) | Extremely fast (sub-ms) |
| Use case | Player data, bans, permissions, logs | Real-time sync, caching, messaging |
| Survives restart | Always | Depends on config (RDB/AOF) |
In a well-architected network, MySQL stores persistent data (permissions, economy, bans) and Redis handles ephemeral, real-time data (who is online where, cross-server messages, temporary session state). Some setups also use Redis as a cache layer in front of MySQL to speed up frequent reads.
Installing Redis
On most Linux distributions, Redis is available in the default repositories:
# Debian / Ubuntu
sudo apt update && sudo apt install redis-server
# Start and enable
sudo systemctl start redis-server
sudo systemctl enable redis-server
# Verify it works
redis-cli ping
# Should respond: PONG
On managed Minecraft hosting, Redis may be available as an add-on or included in higher-tier plans. Check your hosting panel for a Redis section. If your host does not offer Redis, you can use a cheap VPS or a managed Redis service (Redis Cloud has a free tier with 30 MB, which is more than enough for most Minecraft networks).
Redis uses port 6379 by default. If your Minecraft servers and Redis run on different machines, make sure this port is open in your firewall but restricted to only the IPs of your Minecraft servers.
Security, Do Not Skip This
Redis has no authentication by default. Anyone who can reach port 6379 can read and write all your data. Securing it is critical:
# /etc/redis/redis.conf
# Bind to localhost only (if Redis is on the same machine)
bind 127.0.0.1
# Or bind to a private network IP
bind 10.0.0.5
# Set a password
requirepass your_strong_redis_password_here
# Disable dangerous commands (optional but recommended)
rename-command FLUSHALL ""
rename-command FLUSHDB ""
rename-command CONFIG ""
After editing, restart Redis: sudo systemctl restart redis-server. Test the password with: redis-cli -a your_password ping.
RedisBungee / RediVelocity, Proxy-Level Player Syncing
The most common reason Minecraft networks use Redis is for accurate cross-proxy player counting and player lookup. When you run multiple proxy instances (for load balancing or redundancy), each proxy only knows about the players connected to it. RedisBungee (for BungeeCord) and its modern fork RediVelocity (for Velocity) solve this by storing player connection data in Redis, giving every proxy a unified view of all online players.
This enables:
- Accurate /glist, Shows the true total player count across all proxies, not just the local one.
- Cross-proxy messaging, /msg works between players on different proxy instances.
- Unified IP banning, Ban data checked across all proxies instantly.
- API for plugins, Other plugins can query "is this player online on the network?" and get a correct answer regardless of which proxy they are connected to.
Installation is straightforward: drop the jar into the proxy's plugins/ folder, configure the Redis connection in the plugin's config file, and restart each proxy. All proxies must point to the same Redis instance.
RedisChat, Cross-Server Messaging
RedisChat uses Redis pub/sub to relay chat messages between backend servers. When a player sends a message on the survival server, RedisChat publishes it to a Redis channel. Every other backend server subscribed to that channel receives it and displays it to their local players. The result is seamless cross-server chat without requiring a proxy-level chat plugin.
This is especially useful for global chat, staff chat, and announcement channels. The latency is negligible, Redis pub/sub delivers messages in under a millisecond on a local network.
Basic Redis Commands for Minecraft Admins
Even if you primarily interact with Redis through plugins, knowing a few basic commands helps with debugging:
# Connect to Redis CLI
redis-cli -a your_password
# Check what keys exist
KEYS *
# Get a specific value
GET player:uuid:session
# Check how many keys exist
DBSIZE
# Monitor all commands in real time (useful for debugging)
MONITOR
# Check memory usage
INFO memory
The MONITOR command is particularly useful, it shows every Redis operation in real time, so you can see exactly what your plugins are reading and writing. Do not leave it running in production, though, as it adds overhead.
Custom Plugin Integration
If you write custom plugins in Java, the Jedis library (included in most Minecraft plugin dependency setups) provides a clean API for Redis:
JedisPool pool = new JedisPool("localhost", 6379);
try (Jedis jedis = pool.getResource()) {
jedis.auth("your_password");
jedis.set("server:lobby:tps", "19.8");
String tps = jedis.get("server:lobby:tps");
}
For pub/sub (real-time messaging), subscribe to channels and publish events. This is the backbone of cross-server communication in custom plugin architectures.
Performance Characteristics
Redis is absurdly fast. On a modern server, you can expect 100,000+ operations per second from a single Redis instance. For a Minecraft network, this means Redis will never be your bottleneck. Memory usage is typically tiny, a network with 500 concurrent players might use 10-20 MB of Redis memory for session data, player lists, and cached values.
Redis persistence (RDB snapshots and AOF logging) adds minimal overhead and provides crash recovery. Enable at least RDB snapshots in production so you do not lose all cached data if Redis restarts.
For the database foundation that handles persistent data alongside Redis, see our guide on switching to MySQL. For network architecture, check how to start a server.
Need better performance? Astroworld Hosting runs NVMe SSD, up to 96 GB RAM, and DDoS protection on every plan. See features , plans from €6.39/mo.