TOWERBY CETMIX
← Hangar / jet_template_redis_secure

Redis 7 in Docker with Mutual TLS and ACLs

Deploy a persistent Redis instance with client-certificate authentication, password-protected ACL users and local snapshot restore.

↓ Download↓ 0 downloads

Summary

Category
Jet Templates
Tags
Database
Authors
Cetmix OÜ
License
AGPL-3
Version
1.0.0
Call sign
jet_template_redis_secure

This snippet imports a Redis (Secure) Jet Template using redis:7-alpine. It runs a standalone container with Redis-native TLS, a Jet-specific CA and client certificates. Redis also enforces ACL credentials through a mounted users.acl file. Defaults include TCP 6379, append-only persistence, a container health check, CPU and memory limits, a Redis memory limit with allkeys-lru eviction and a graceful stop timeout. The build can add a UFW rate-limit rule for the published port.

Configure and launch

  1. Import the YAML and install the template. Ensure Docker and the shared Tower network are running and OpenSSL is installed on the host. Docker, Fail2ban and Tower Core dependency templates are included.
  2. Set redis_secure_default_password and redis_secure_app_password in Tower Keys and Secrets. Set web_domain or a Jet URL for the certificate hostname. For automatic Cloudflare DNS registration, set cloudflare_token and cloudflare_zone_id. With another provider, point DNS at the host.
  3. Create the Jet targeting Running. Prepare generates the CA and certificates and writes Redis configuration and ACLs. Build creates the container and configures UFW when enabled. Start waits for Redis to become healthy.
  4. Use Verify Endpoint to inspect the listening socket, firewall rule and local TLS handshakes with and without a client certificate. Test external reachability from the client network. Give clients the CA certificate, their client certificate and key, and the Redis application username and password.

Operate

Use Rotate Credentials after changing the password secrets and Issue Client Certificate for a new client certificate. Use Rebuild for image and container resource changes. Certificates have a configured lifetime and require manual reissuance. Check the Redis Logs, Redis Status and Snapshot Disk Usage views when troubleshooting.

A Snapshot waypoint copies the data directory to local storage. Arriving at it stops Redis, replaces the live data with the snapshot and restarts the service. Writes made after that snapshot are discarded. Remove removes the container and closes its managed UFW rule. Destroy also cleans up the Jet's files, data and snapshots and removes its Cloudflare DNS entry where applicable.