Skip to content
Live $300 credit for new accounts Valid for 60 days from account creation Get started →

Valkey 9.0

Valkey is an open-source, high-performance in-memory data store and Redis-compatible alternative. It is commonly used for caching, session storage, real-time leaderboards, pub/sub messaging, and job queues.

ComponentVersion
Valkey9.0.x
Ubuntu24.04 LTS
ssh ubuntu@<your-vm-ip>

On the first boot, a setup script runs automatically. It generates a random password and configures Valkey to require authentication on every connection. This takes under 30 seconds.

Track progress:

journalctl -u valkey-first-boot.service -f
sudo cat /etc/valkey/credentials.txt

This file contains the password and connection instructions. It is only readable by root.

VALKEY_PASS=$(sudo awk '/^Valkey password:/{print $NF}' /etc/valkey/credentials.txt)
valkey-cli -a "$VALKEY_PASS"

Confirm the connection:

127.0.0.1:6379> PING
PONG
# Check service status
systemctl status valkey
# Restart
sudo systemctl restart valkey
# View logs
sudo journalctl -u valkey -f

Configuration files:

FilePurpose
/etc/valkey/valkey.confMain configuration
/etc/valkey/99-memory.confMemory limit and eviction policy

To set a memory limit, edit /etc/valkey/99-memory.conf:

maxmemory 512mb
maxmemory-policy noeviction

Then restart Valkey. The default policy is noeviction, which returns an error when memory is full rather than silently evicting data.

Port 6379 is not open externally by default. UFW is enabled and allows SSH (port 22) only.

To allow access from a specific IP:

sudo ufw allow from <trusted-ip> to any port 6379

To connect without opening the firewall (recommended), use an SSH tunnel:

# Run this on your local machine
ssh -L 6379:localhost:6379 ubuntu@<your-vm-ip>
# Then connect locally
valkey-cli -a "<password>"