Valkey Community

Reference

Valkey commands, configuration, URIs, ports, and exit codes — quick lookup.

Commands by category

String (KV)

CommandPurpose
SET key value [EX sec] [NX|XX]Set value, optional TTL and existence flag
GET keyRead
INCR / DECR keyAtomic increment / decrement
MSET k1 v1 k2 v2Bulk set
GETEX key EX secRead and refresh TTL
STRLEN keyLength

Hash

CommandPurpose
HSET key f1 v1 f2 v2Set fields
HGET / HMGET / HGETALLRead fields
HEXPIRE key sec FIELDS n f1 ...Field-level TTL (8.0+)
HINCRBY key field nIncrement field

List

CommandPurpose
LPUSH / RPUSH key vPush left / right
LPOP / RPOP key [count]Pop
BLPOP / BRPOP key timeoutBlocking pop
LRANGE key start stopRange read
LMOVE src dst LEFT RIGHTAtomic move between lists

Set

CommandPurpose
SADD / SREM key mAdd / remove
SMEMBERS keyAll members
SINTER / SUNION / SDIFFSet operations
SRANDMEMBER key [count]Random member

Sorted Set (ZSet)

CommandPurpose
ZADD key score memberAdd
ZRANGE key 0 -1 [WITHSCORES]Range
ZRANGEBYSCORE key min maxBy score
ZINCRBY key n memberIncrement score
ZPOPMIN / ZPOPMAX keyPop extremes

Stream

CommandPurpose
XADD key * field valueAppend entry
XREAD COUNT n STREAMS key idRead
XGROUP CREATE key grp $Create consumer group
XREADGROUP GROUP grp consumer ...Group read
XACK key grp idAcknowledge

Server

CommandPurpose
PINGLiveness probe
INFO [section]Runtime info
CONFIG GET / SET paramDynamic configuration
CLIENT LIST / KILLConnection management
DBSIZECurrent DB key count
FLUSHDB / FLUSHALLWipe (use with care)

Cluster

CommandPurpose
CLUSTER INFOCluster status
CLUSTER NODESNode list
CLUSTER SLOTS / SHARDSSlot distribution
CLUSTER COUNTKEYSINSLOT slotKeys in a slot
CLUSTER FAILOVERManual failover

ACL

CommandPurpose
ACL LISTAll users
ACL SETUSER name on >pwd ~prefix:* +@readCreate / modify
ACL WHOAMICurrent identity
ACL CATCommand categories

Connection URI schemes

SchemeMeaning
redis://Plain TCP (compat)
rediss://TLS TCP (compat)
valkey://Plain TCP (preferred for new projects)
valkeys://TLS TCP (preferred for new projects)
unix://Unix socket

Example:

valkeys://default:pass@node-1.example.com:6379/0?timeout=2s

Most modern client libraries accept valkey://; older versions can still use redis:// against a Valkey server.

Common valkey.conf parameters

ParameterMeaningTypical
portListen port6379
bindInterfaces127.0.0.1 / 0.0.0.0
protected-modeLoopback protectionyes
requirepassLegacy password (prefer ACL)-
maxmemoryMemory cap4gb
maxmemory-policyEviction strategyallkeys-lru
appendonlyAOF on/offyes
appendfsyncAOF fsynceverysec
saveRDB snapshot triggers3600 1 300 100
cluster-enabledEnable cluster modeno
replica-read-onlyRead-only replicasyes
io-threadsI/O thread count4
tls-portTLS port6379

maxmemory-policy options: noeviction, allkeys-lru, allkeys-lfu, volatile-lru, volatile-lfu, allkeys-random, volatile-random, volatile-ttl.

valkey-cli flags

FlagPurpose
-h host -p portTarget
-a passwordPassword
--user nameACL user
-n dbSelect DB
-cCluster mode (follow MOVED)
--tlsEnable TLS
--scan --pattern 'user:*'Iterate keys (prefer over KEYS in prod)
--bigkeysFind largest keys
--memkeysFind keys by memory
--latencyLive latency
--latency-historyPeriodic latency
--statCompact runtime stats
-xRead last argument from stdin (pipe pattern)
--rdb dump.rdbDownload RDB

INFO sections

SectionContents
serverVersion, uptime, OS
clientsConnected / blocked
memoryUsage, fragmentation
persistenceRDB / AOF status
statsTotal commands, hit rate
replicationRole, offset
cpuCPU usage
commandstatsPer-command count / latency
clusterCluster enabled
keyspacePer-DB key counts

INFO server reports both redis_version (frozen for client compatibility) and valkey_version (the real one).

Port conventions

PortPurpose
6379Client
16379Cluster bus (client port + 10000)
26379Sentinel
7443TLS client (used by some managed providers)

Cluster mode requires both ports open between every pair of nodes.

Exit codes

CodeMeaning
0Normal shutdown
1Startup failure (bad config, port in use, permissions)
130SIGINT received
143SIGTERM received

valkey-cli follows the same conventions to play nicely with shell scripts.

Full command reference at valkey.io/commands.

On this page