Deployment guide

KeyDB

Overview

KeyDB is a high-performance fork of Redis that is fully protocol- and command-compatible but uses multiple threads to drive higher throughput from a single node. It is a drop-in replacement for Redis for caching, session stores, queues, rate limiting, leaderboards and pub/sub.

This SecureAnyCloud image installs KeyDB 6.3.4 and runs it as a dedicated keydb system user. Data is stored on a dedicated Azure data disk, and a unique password is set on first boot.

What you get:

  • KeyDB 6.3.4 (keydb-server + keydb-cli) from the official KeyDB package repository
  • Multithreaded engine (server-threads 2) to use both vCPUs of a Standard_B2s
  • A unique per-VM password generated on first boot, with no shared default credential
  • RDB snapshots and the AOF append-only log on a dedicated 16 GiB Azure data disk at /var/lib/keydb
  • Loopback-only listener on 6379 with requirepass authentication, not exposed publicly
  • 24/7 SecureAnyCloud support

This is a datastore product: KeyDB listens on 127.0.0.1:6379 only. The port is not opened to the internet. Connect locally on the VM or over an SSH tunnel.

Prerequisites

You need an active Azure subscription, an SSH key pair, and a VNet with a subnet in the target region.

Standard_B2s (2 vCPU / 4 GiB RAM) is a good starting size.

In the network security group (NSG), allow inbound 22/tcp from your management network. No inbound application ports are needed, because you reach KeyDB over the SSH tunnel.

Step 1 - Deploy from the Azure Marketplace

Sign in to the Azure Portal, choose Create a resource, search the Marketplace for KeyDB by SecureAnyCloud, and select Create.

On the Basics tab, pick your subscription, resource group, region and size. Under Administrator account, choose SSH public key and paste your key. Under Inbound port rules, allow SSH (22) only.

Then select Review + create and Create.

Step 2 - Deploy from the Azure CLI

# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn sac1647283583153:keydb-ubuntu-24-04:default:latest
az vm create \
  --resource-group <your-rg> \
  --name keydb \
  --image sac1647283583153:keydb-ubuntu-24-04:default:latest \
  --size Standard_B2s \
  --admin-username azureuser \
  --ssh-key-values ~/.ssh/id_ed25519.pub \
  --vnet-name <your-vnet> --subnet <your-subnet> \
  --public-ip-sku Standard

Step 3 - Connect to your VM

ssh azureuser@<vm-public-ip>

Step 4 - Confirm KeyDB is installed and running

keydb-server --version systemctl is-active keydb-server

You should see KeyDB v=6.3.4 and active:

KeyDB server v=6.3.4 sha=00000000:0 malloc=jemalloc-5.2.1 bits=64 build=b532cd0401cb0da4 active

Step 5 - Retrieve your per-VM password

Each VM generates its own unique KeyDB password on first boot and writes it to a root-only credentials file. Read the file with sudo:

sudo cat /root/keydb-credentials.txt

The file contains KEYDB_PASSWORD, the connection string and the SSH-tunnel instructions. Store the password in your secrets manager.

In the commands below, <KEYDB_PASSWORD> stands for the value of KEYDB_PASSWORD.

Step 6 - Authenticate with keydb-cli

KeyDB requires the password (requirepass). Authenticate, then run a PING:

keydb-cli -a <KEYDB_PASSWORD> --no-auth-warning ping
PONG

A wrong password is rejected with WRONGPASS, so the datastore is never open without the credential.

Step 7 - Store and retrieve data

KeyDB speaks the Redis protocol, so every Redis command works unchanged. Set a string, read it back, increment a counter and push to a list.

keydb-cli -a <KEYDB_PASSWORD> --no-auth-warning set greeting "hello from KeyDB" keydb-cli -a <KEYDB_PASSWORD> --no-auth-warning get greeting keydb-cli -a <KEYDB_PASSWORD> --no-auth-warning set counter 100 keydb-cli -a <KEYDB_PASSWORD> --no-auth-warning incr counter keydb-cli -a <KEYDB_PASSWORD> --no-auth-warning rpush mylist a b c keydb-cli -a <KEYDB_PASSWORD> --no-auth-warning lrange mylist 0 -1
OK hello from KeyDB OK 101 3 a b c

Step 8 - Confirm persistence and multithreading

KeyDB persists data with AOF (append-only file) plus periodic RDB snapshots, both on the dedicated data disk at /var/lib/keydb. Check the keyspace, confirm that AOF is enabled, and review the server details:

keydb-cli -a <KEYDB_PASSWORD> --no-auth-warning info keyspace keydb-cli -a <KEYDB_PASSWORD> --no-auth-warning info persistence | grep aof_enabled keydb-cli -a <KEYDB_PASSWORD> --no-auth-warning info server | grep -E 'redis_version|executable|config_file'
# Keyspace db0:keys=3,expires=0,avg_ttl=0,cached_keys=3 aof_enabled:1 redis_version:6.3.4 executable:/usr/bin/keydb-server config_file:/etc/keydb/keydb.conf

aof_enabled:1 confirms durable persistence. KeyDB runs multiple server threads, configured with server-threads 2. List them with:

ps -L -p "$(pgrep -x keydb-server | head -1)" -o comm= | sort | uniq -c

Step 9 - Connect remotely over an SSH tunnel

KeyDB listens on 127.0.0.1:6379 only and is not exposed publicly. This is the secure default. To reach it from your workstation, open an SSH tunnel and point a local client at localhost:6379:

# On your workstation:
ssh -L 6379:127.0.0.1:6379 azureuser@<vm-public-ip>
# In another terminal, with a local keydb-cli or redis-cli: keydb-cli -h 127.0.0.1 -p 6379 -a <KEYDB_PASSWORD> --no-auth-warning ping

The authentication round trip below shows the access control working: the wrong password is rejected and the correct one is accepted.

For production remote access without a tunnel, bind KeyDB to a private NIC and put TLS in front of it, for example with stunnel or a service mesh. Never expose 6379 to the internet without transport encryption.

Maintenance

  • Persistence: RDB snapshots and the AOF log live on the dedicated data disk at /var/lib/keydb, so the keyspace survives reboots and the volume can be resized independently.
  • Password: change it by editing requirepass in /etc/keydb/keydb-firstboot.conf and running sudo systemctl restart keydb-server.
  • Tuning: edit /etc/keydb/keydb.conf (for example maxmemory, maxmemory-policy or server-threads) and restart the service.
  • Security patches: unattended-upgrades stays enabled, so the OS keeps receiving security updates automatically.
  • Compatibility: KeyDB is a drop-in replacement for Redis. Existing Redis clients, libraries and tooling work unchanged against 6379.

Support

SecureAnyCloud provides 24/7 expert support for this image. Contact sales@secureanycloud.com.

KeyDB is a trademark of Snap Inc. Redis is a trademark of Redis Ltd. This image is provided by SecureAnyCloud and is not affiliated with or endorsed by Snap Inc. or Redis Ltd.

Deploy on Azure

Launch KeyDB on Ubuntu 24.04 LTS on Azure with 24/7 support from SecureAnyCloud.

View this image

Need Help?

Our support team is available 24/7.

sales@secureanycloud.com

Deploy on Azure