Redis 8
Overview
Redis is an in-memory data store used as a database, cache and message broker. Redis 8 reached general availability in 2025 as the first major release with native Vector Sets, JSON, Time Series and Bloom data types built into the core engine, so no separate RedisStack modules are required. It also keeps the long-standing strings, lists, sets, hashes, sorted sets and streams data types.
This SecureAnyCloud image runs Redis 8 on Ubuntu 24.04 on Azure, installed from the official packages.redis.io/deb APT repo (Ubuntu noble suite). On first boot, redis-firstboot.service generates a per-VM 32-char hex requirepass and writes a drop-in at /etc/redis/conf.d/sac-auth.conf (mode 0640, redis:redis). The credential is mirrored to /stage/scripts/redis-credentials.log (mode 0600, root only). Anonymous access is rejected, so every command must be authenticated with redis-cli -a '<password>'.
By default, Redis listens on 127.0.0.1:6379 only. To allow non-loopback access, reconfigure bind and protected-mode in /etc/redis/redis.conf or in a drop-in under /etc/redis/conf.d/. RDB snapshots are enabled by default. AOF is off by default, and you can enable it with appendonly yes for write-heavy durability requirements.
What you get:
- Redis 8 (latest 8.x at build time, 8.6.2) from the official packages.redis.io APT repo
redis-server.servicesystemd unit that starts automatically on bootredis-firstboot.servicesystemd oneshot that generates the per-VMrequirepassand writes/etc/redis/conf.d/sac-auth.confand/stage/scripts/redis-credentials.logredis-toolspackage forredis-cli,redis-benchmark,redis-check-rdbandredis-check-aof- Default listener on TCP 6379 bound to
127.0.0.1(loopback only) - RDB snapshots enabled (
save 3600 1,300 100,60 10000) - AOF disabled by default; opt in with
appendonly yesfor write-heavy workloads - Per-VM
requirepassenforced, with anonymous connections rejected withNOAUTH - Native Vector Sets (8 GA), JSON, Time Series and Bloom data types built into the engine
- Data directory
/var/lib/redis(not/mnt, because the Azure ephemeral resource disk does not survive SIG capture) - Ubuntu 24.04 LTS base with the latest security patches applied at build time
- Azure Linux Agent for cloud integration and SSH key injection
- 24/7 SecureAnyCloud support with guaranteed 24 hour response SLA
Prerequisites
You need the following:
- An active Azure subscription
- A subscription to the Redis 8 on Ubuntu 24.04 listing on Azure Marketplace
- An SSH public key for VM authentication
- A virtual network and subnet in the target region
Recommended virtual machine size: Standard_B2s (2 vCPU, 4 GB RAM) for development and small caches. Production deployments should use Standard_E4s_v5 (4 vCPU, 32 GB RAM) or larger. Redis is memory-bound, so RAM is the most useful sizing dimension, not cores.
Set maxmemory in redis.conf to about 75% of the VM's RAM. Pick an eviction policy: allkeys-lru for a cache, or noeviction for a source of truth.
Deploy from the Azure Portal
Open the Marketplace in the Azure Portal, search for Redis 8, select the SecureAnyCloud publisher entry, and select Create.
On the Networking tab, attach a network security group that allows inbound TCP 22 from your management IP range and TCP 6379 from your application VMs. Do not expose port 6379 to the public internet. Even with requirepass enabled, brute-force attacks against weak passwords are a real risk, and Redis without TLS sends the password in cleartext on the wire.
Select Review + create, wait for validation, then select Create. Deployment takes around two minutes.
Deploy from the Azure CLI
RG="redis-prod" LOCATION="eastus" VM_NAME="redis-01" ADMIN_USER="azureuser" IMAGE_URN="sac1647283583153:redis-8-ubuntu-24-04:default:latest" SSH_KEY="$(cat ~/.ssh/id_rsa.pub)" az group create --name "$RG" --location "$LOCATION" az network vnet create --resource-group "$RG" --name redis-vnet \
--address-prefix 10.98.0.0/16 --subnet-name redis-subnet --subnet-prefix 10.98.1.0/24 az network nsg create --resource-group "$RG" --name redis-nsg az network nsg rule create --resource-group "$RG" --nsg-name redis-nsg \
--name allow-ssh --priority 100 \
--source-address-prefixes "<your-mgmt-cidr>" \
--destination-port-ranges 22 --access Allow --protocol Tcp az network nsg rule create --resource-group "$RG" --nsg-name redis-nsg \
--name allow-redis --priority 110 \
--source-address-prefixes 10.98.0.0/16 \
--destination-port-ranges 6379 --access Allow --protocol Tcp
# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn sac1647283583153:redis-8-ubuntu-24-04:default:latest
az vm create \
--resource-group "$RG" --name "$VM_NAME" \
--image "$IMAGE_URN" \
--size Standard_B2s --storage-sku StandardSSD_LRS \
--admin-username "$ADMIN_USER" --ssh-key-values "$SSH_KEY" \
--vnet-name redis-vnet --subnet redis-subnet --nsg redis-nsg \
--public-ip-sku StandardConnect via SSH
ssh azureuser@<vm-ip>By the time you connect, redis-server.service is already running and redis-firstboot.service has already generated the requirepass.
Verify the Redis Service
sudo systemctl status redis-server.service --no-pagerThe expected status is active (running). Confirm the first-boot sentinel:
sudo test -f /var/lib/sac/data/redis-firstboot.done && echo FIRSTBOOT_DONEConfirm that the listener is bound on port 6379:
sudo ss -tln | grep 6379By default, Redis binds to 127.0.0.1 only, shown as LISTEN 0 511 127.0.0.1:6379. To allow remote connections, edit /etc/redis/redis.conf and change bind 127.0.0.1 to bind 0.0.0.0 (or your VM's private IP). Then run sudo systemctl restart redis-server.
Retrieve the Redis Password
The Redis requirepass is generated for this specific VM and written to a root-only file. Read it with:
sudo cat /stage/scripts/redis-credentials.logThe output looks similar to this:
REDIS_USER=default REDIS_PASSWORD=<REDIS_PASSWORD> LISTEN_PORT=6379 LISTEN_ADDRESS=127.0.0.1Store the password in your secret store. To rotate it, edit /etc/redis/conf.d/sac-auth.conf and run sudo systemctl restart redis-server.
For a hot rotation, use redis-cli -a '<old>' CONFIG SET requirepass '<new>'. Then update sac-auth.conf so that the new password survives a restart.
Connect with redis-cli
PASS=$(sudo grep '^REDIS_PASSWORD=' /stage/scripts/redis-credentials.log | cut -d= -f2-)
redis-cli -a "${PASS}" --no-auth-warning PINGThe expected reply is PONG. The --no-auth-warning flag suppresses the harmless "Using a password with '-a' or '-u' option on the command line interface may not be safe" warning. This is fine in scripts. For interactive sessions, start redis-cli and enter AUTH <password> at the prompt instead.
Confirm the version:
redis-cli -a "${PASS}" --no-auth-warning INFO server | grep redis_versionConfirm that anonymous access is rejected:
redis-cli PINGThe expected reply is (error) NOAUTH Authentication required.
Round-trip Test
The default Redis user (with requirepass) has full access. Set, get and delete a sample key:
PASS=$(sudo grep '^REDIS_PASSWORD=' /stage/scripts/redis-credentials.log | cut -d= -f2-)
redis-cli -a "${PASS}" --no-auth-warning SET sac:probe 'sac-ok'
redis-cli -a "${PASS}" --no-auth-warning GET sac:probe
redis-cli -a "${PASS}" --no-auth-warning DEL sac:probeThe expected replies are OK, then "sac-ok", then (integer) 1.
Try the Redis 8 native data types
Redis 8 ships with Vector Sets, JSON, Time Series and Bloom filters built into the core engine, with no separate RedisStack modules. The following examples show each type.
Vector Sets (similarity search):
redis-cli -a "${PASS}" --no-auth-warning VADD myindex VALUES 4 0.1 0.2 0.3 0.4 alice
redis-cli -a "${PASS}" --no-auth-warning VADD myindex VALUES 4 0.5 0.5 0.5 0.5 bob
redis-cli -a "${PASS}" --no-auth-warning VSIM myindex VALUES 4 0.1 0.2 0.3 0.4 COUNT 2JSON:
redis-cli -a "${PASS}" --no-auth-warning JSON.SET user:1 '$' '{"name":"alice","age":30}'
redis-cli -a "${PASS}" --no-auth-warning JSON.GET user:1 '$.name'Time Series:
redis-cli -a "${PASS}" --no-auth-warning TS.CREATE temperature
redis-cli -a "${PASS}" --no-auth-warning TS.ADD temperature '*' 21.5
redis-cli -a "${PASS}" --no-auth-warning TS.RANGE temperature - +Connect from a Remote Application
From any host inside the same virtual network, install a Redis client library and connect on port 6379 with the per-VM password.
Python (pip install redis):
import redis r = redis.Redis(host='<vm-private-ip>', port=6379, password='<REDIS_PASSWORD>') r.set('hello', 'world') print(r.get('hello'))Node.js (npm install redis):
import { createClient } from 'redis'; const client = createClient({ url: 'redis://default:<REDIS_PASSWORD>@<vm-private-ip>:6379' }); await client.connect(); await client.set('hello', 'world'); console.log(await client.get('hello'));Do not open port 6379 to the public internet without TLS termination. The Redis cleartext protocol sends the AUTH password over the wire unencrypted. For production, configure tls-port 6380 and certificate files in redis.conf, and bind the cleartext port to loopback only.
Server components
Component Path
Redis binary /usr/bin/redis-server
redis-cli /usr/bin/redis-cli
redis-benchmark /usr/bin/redis-benchmark
Main config /etc/redis/redis.conf
Drop-in conf.d /etc/redis/conf.d/*.conf (sac-auth.conf written at first boot)
Data directory /var/lib/redis
RDB file /var/lib/redis/dump.rdb
AOF directory /var/lib/redis/appendonlydir/ (when enabled)
Log file /var/log/redis/redis-server.log
Systemd unit /lib/systemd/system/redis-server.service
First-boot script /usr/local/sbin/redis-firstboot.sh
First-boot service /etc/systemd/system/redis-firstboot.service
Credentials file /stage/scripts/redis-credentials.log (mode 0600)
First-boot sentinel /var/lib/sac/data/redis-firstboot.done
Inspect the running version:
/usr/bin/redis-server --versionManage the Redis service
Check the status:
sudo systemctl status redis-server.service --no-pagerStop, start or restart the service:
sudo systemctl stop redis-server.service
sudo systemctl start redis-server.service
sudo systemctl restart redis-server.serviceView the log:
sudo tail -f /var/log/redis/redis-server.logReload configuration without a restart (supported keys only):
PASS=$(sudo grep '^REDIS_PASSWORD=' /stage/scripts/redis-credentials.log | cut -d= -f2-)
redis-cli -a "${PASS}" --no-auth-warning CONFIG GET maxmemory
redis-cli -a "${PASS}" --no-auth-warning CONFIG SET maxmemory 1gbSome settings, such as bind, do not support hot reload. For those, edit /etc/redis/redis.conf and run systemctl restart redis-server.
Trigger an RDB snapshot:
redis-cli -a "${PASS}" --no-auth-warning BGSAVEEnable AOF for write durability:
echo 'appendonly yes' | sudo tee /etc/redis/conf.d/sac-aof.conf
sudo systemctl restart redis-serverTroubleshooting
(error) NOAUTH Authentication required.
Always pass -a '<password>' or run AUTH <password> first.
Confirm that the password is current with sudo cat /stage/scripts/redis-credentials.log.
Could not connect to Redis at 127.0.0.1:6379: Connection refused
Service down: check it with sudo systemctl status redis-server.
Listener on a different port or address: check it with sudo ss -tln | grep 6379.
Disk full, preventing AOF or RDB writes: check it with df -h /var/lib/redis.
OOM command not allowed when used memory > 'maxmemory'
The instance reached its memory cap, and the eviction policy is not evicting keys.
Either raise maxmemory, or change maxmemory-policy from noeviction to allkeys-lru.
MISCONF Redis is configured to save RDB snapshots but currently is not able to persist on disk
The RDB snapshot failed, usually because the disk is full or a permission error occurred.
Check /var/log/redis/redis-server.log for the underlying error.
To free disk space, run sudo journalctl --vacuum-time=7d and sudo apt-get clean.
Security Recommendations
- Rotate the
requirepassimmediately after deployment, as described in Step 5. - Restrict the NSG so that port 6379 is reachable only from your application VMs and admin networks. Never expose it to the public internet.
- Enable TLS (
tls-port 6380and certificate files inredis.conf) for any cross-VM connection, because the Redis cleartext protocol sends AUTH passwords unencrypted. - Disable or rename dangerous commands in production with
rename-command FLUSHALL '',rename-command CONFIG ''and similar directives. - Use ACLs (
ACL SETUSER) for fine-grained per-application permissions instead of relying solely onrequirepass. - Set
maxmemoryand a sensiblemaxmemory-policy:allkeys-lrufor caches,noevictionfor a source of truth. - Enable persistence. RDB snapshots are on by default, and you can enable AOF for write-heavy durability.
- Back up
/var/lib/redis/dump.rdbandappendonlydir/to Azure Blob Storage on a schedule. - Patch the OS monthly with
sudo apt-get update && sudo apt-get upgrade && sudo reboot.
Support and Licensing
Redis 8 ships under the AGPL-3.0 license (Redis Inc. switched from BSD-3 in 2024 and from RSALv2/SSPL in 2025). The AGPL adds copyleft requirements for modifications you distribute and network-accessible derivative services. For almost all customers who run stock Redis as a backing store for an application, this changes nothing in practice.
If you fork the source and distribute it, you must publish your changes. If you offer Redis as a service to third parties as a managed product, you must also publish your source changes.
SecureAnyCloud provides commercial support for this image, separately from the upstream project.
Email: sales@secureanycloud.com
Website: secureanycloud.com
Support hours: 24/7 with guaranteed 24 hour response SLA
Deploy on Azure
Launch Redis 8 on Ubuntu 24.04 with 24/7 support from SecureAnyCloud.
View on Marketplace
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com
Deploy on Azure
Launch Redis 8 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
This guide covers launching a Redis instance from the SecureAnyCloud AWS Marketplace AMI, retrieving your per-instance credentials, connecting with redis-cli, and completing common configuration tasks.
What Is Included
- Redis 8 installed from the official packages.redis.io APT repository
- redis-server running on port 6379 with requirepass authentication enforced
- Per-instance password generated on first boot and written to
/root/redis-credentials.txt - Dedicated 20 GiB gp3 data volume at
/var/lib/redisfor RDB snapshots and the AOF journal - nginx identity page on port 80 that confirms the instance type
Connecting to Your Instance
OS Variant SSH Login User
Ubuntu 24.04 ubuntu
Connect using your EC2 key pair:
ssh -i /path/to/key.pem ubuntu@<instance-public-ip>Retrieving Your Redis Credentials
On first boot, a one-shot service generates a cryptographically strong 64-character hex password that is unique to your instance. The password is stored in a root-only file:
sudo cat /root/redis-credentials.txtExample output:
# Redis 8 - Per-Instance Credentials
# Generated: 2026-05-27T22:15:18Z
# Instance public IP: 44.204.241.110
#
# Connect:
# redis-cli -a '<requirepass>' --no-auth-warning
# redis-cli -a '<requirepass>' --no-auth-warning PING -> PONG
# requirepass=4924b08334899934bd96ad6d10d59e5e8a815e09a73a16236bac515b99b98021Set the password as a shell variable for convenience:
REDIS_PASS=$(sudo awk -F= '/^requirepass/{print $2}' /root/redis-credentials.txt)Verifying the Service
Check the installed version and confirm that redis-server is active:
redis-server --version systemctl status redis-server --no-pagerExample output:
Redis server v=8.8.0 sha=00000000:1 malloc=jemalloc-5.3.0 bits=64 build=b3ac31808ca8181e redis-server.service - Advanced key-value store Loaded: loaded (/usr/lib/systemd/system/redis-server.service; enabled; preset: enabled) Active: active (running) since Wed 2026-05-27 22:15:28 UTC; 8s ago Docs: http://redis.io/documentation, man:redis-server(1) Main PID: 35251 (redis-server) Status: "Ready to accept connections" CGroup: /system.slice/redis-server.service 35251 "/usr/bin/redis-server 0.0.0.0:6379"Connecting with redis-cli
Test connectivity with the PING command:
redis-cli -a "${REDIS_PASS}" --no-auth-warning PINGExpected output:
PONGView server information including the Redis version:
redis-cli -a "${REDIS_PASS}" --no-auth-warning INFO serverExample output:
# Server redis_version:8.8.0 redis_git_sha1:00000000 redis_git_dirty:1 redis_build_id:b3ac31808ca8181e redis_mode:standalone os:Linux 6.8.0-1009-aws x86_64 arch_bits:64 tcp_port:6379 executable:/usr/bin/redis-serverBasic Operations
Store and retrieve a key-value pair:
redis-cli -a "${REDIS_PASS}" --no-auth-warning SET mykey "Hello Redis"
redis-cli -a "${REDIS_PASS}" --no-auth-warning GET mykey
redis-cli -a "${REDIS_PASS}" --no-auth-warning DEL mykeyExpected output:
OK Hello Redis 1Unauthenticated Connection Rejection
Connections that do not supply the requirepass password are rejected:
redis-cli PINGExpected output:
(error) NOAUTH Authentication required.Data Volume
Redis persistence files are stored on a dedicated 20 GiB gp3 volume at /var/lib/redis. This volume is separate from the OS disk and can be resized independently. Check it with:
df -h /var/lib/redisExample output:
Filesystem Size Used Avail Use% Mounted on /dev/nvme1n1 20G 28K 19G 1% /var/lib/redisConfiguration
The main Redis configuration file is /etc/redis/redis.conf. SecureAnyCloud writes per-instance settings as drop-in files in /etc/redis/conf.d/. The authentication password is in /etc/redis/conf.d/sac-auth.conf, which is owned by the redis user with mode 640.
After you edit redis.conf, reload the configuration without restarting:
redis-cli -a "${REDIS_PASS}" --no-auth-warning CONFIG REWRITETo apply changes that require a restart, restart the service:
sudo systemctl restart redis-serverEnabling AOF Persistence
Redis ships with RDB snapshot persistence enabled by default. For stronger durability on write-heavy workloads, enable the Append Only File (AOF):
appendonly yes appendfilename "appendonly.aof" appenddirname "/var/lib/redis/appendonlydir"Add these lines to /etc/redis/redis.conf and restart redis-server.
Memory Limits
Redis enforces no memory cap by default. To use Redis as a cache, set a memory limit and an eviction policy:
maxmemory 2gb maxmemory-policy allkeys-lruAdd these lines to /etc/redis/redis.conf and restart redis-server.
Changing the Password
Generate a new password and update the configuration:
NEW_PASS=$(openssl rand -hex 32)
echo "requirepass ${NEW_PASS}" | sudo tee /etc/redis/conf.d/sac-auth.conf
sudo chown redis:redis /etc/redis/conf.d/sac-auth.conf
sudo chmod 640 /etc/redis/conf.d/sac-auth.conf
sudo systemctl restart redis-serverUpdate /root/redis-credentials.txt with the new password so that the file stays accurate.
Firewall and Network Access
The security group for this AMI opens port 6379 from all sources. For production, restrict the Redis security group inbound rule to trusted IP ranges or VPC CIDRs only.
Identity Page
An nginx server on port 80 serves a plain-text identity page that confirms the instance is a SecureAnyCloud Redis AMI. You can use it for health checks in automation:
curl http://<instance-public-ip>/Support
SecureAnyCloud provides 24/7 technical support at secureanycloud.com. Support covers Redis deployment, authentication and ACL configuration, persistence tuning, cluster setup and version upgrades.
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com