Connect to Your Valkey Cache
- In the control panel open Valkey Cache.
- Add the IP address of every server that will connect (see Allow Your Servers to Connect). Until you do, nothing can connect.
- Click Access details on the cache to see its host, port and password.
| Setting | Value |
|---|---|
| Host | The cache's IP address |
| Port | 6379 |
| Username | default (or leave it empty) |
| Password | From Access details |
| URL form | redis://:PASSWORD@HOST:6379/0 |
Examples
# command line
valkey-cli -h HOST -p 6379 -a PASSWORD ping # or redis-cli
# Python (redis-py)
import redis, os
r = redis.Redis(host=os.environ["CACHE_HOST"], port=6379, password=os.environ["CACHE_PASSWORD"])
r.set("greeting", "hello", ex=300)
# PHP (Laravel .env)
REDIS_HOST=HOST
REDIS_PASSWORD=PASSWORD
REDIS_PORT=6379
What your user can do
All normal commands work, including CONFIG GET and FLUSHDB. Administrative commands (changing the server configuration, shutting it down) are reserved for us.
The connection is not encrypted, which is why access is limited to your allowed IP addresses. Connect from servers in the same data centre or over a private network where possible.