Redis transport security has two independent parts: TLS authenticates and encrypts the connection, while Redis ACLs decide what an authenticated user may do. Enabling a TLS port without reviewing either client verification or ACL permissions leaves important gaps. This guide builds a server-authenticated TLS listener, keeps the broker private, and plans certificate replacement around the realities of persistent Redis connections.
The example targets Redis Open Source 7.x with TLS support compiled into the binary. It uses a standalone server on Linux, not Redis Cloud or a managed service that controls certificates for you. Redis Cluster, Sentinel, and replicas require additional transport settings discussed below. Treat every hostname, path, subnet, username, and port as a value to verify against your deployment.
Step 1: Classify Redis traffic before choosing a listener
Redis is often reached indirectly. A web application may use one endpoint for cache reads, background workers another for queues, and a management script a third for administrative commands. Identify all those consumers and whether they support TLS. Include connection health checks: an old plaintext PING probe can mark a perfectly healthy TLS-only instance unavailable and trigger an unnecessary failover.
Confirm the installed binary supports TLS and that your service actually reads the configuration file you plan to edit. Inspect the service definition or container command rather than assuming /etc/redis/redis.conf is universal. Keep Redis's data directory and persistence configuration unchanged while introducing TLS; transport migration does not require changing snapshot or append-only-file settings.
Use a private service name such as cache.example.com that appears in the server certificate. Certificate validation does not make Redis safe to expose broadly, so preserve network restrictions to application and administration networks. If a container listens on all interfaces internally, the host's published ports and firewall still determine who can reach it. A private Docker network and a public host port are not equivalent boundaries.
Decide whether you need mutual TLS before writing configuration. Redis's TLS listener normally expects client certificates unless configured otherwise. The example deliberately uses server authentication plus Redis ACL credentials, with tls-auth-clients no. This is an explicit policy choice, not an instruction to disable certificate checking on clients. Clients must still verify the server's chain and expected hostname.
Step 2: Obtain a certificate without introducing a web listener
Use your existing SimpleACME domain registration and assigned challenge CNAME to validate cache.example.com through DNS. The Certbot integration instructions cover the authenticated update hook; active subscriber guides provide the corresponding setup examples. Paid SimpleACME access allows the TXT update, while Certbot handles the certificate order and keeps the private key on the issuing host.
That split suits a cache service that has no reason to answer HTTP. You do not need to place a disposable web server in front of Redis or expose an unrelated application endpoint for validation. The permanent challenge delegation also avoids installing a broad DNS-provider API credential on every application node. It does not, however, configure Redis automatically or transfer ownership of its private keys.
After issuance, inspect the actual Certbot lineage and the certificate's alternative names. A certificate for cache.example.com will not validate a connection made to redis.internal unless that name is separately covered. In environments with split DNS, clients can resolve the public domain name to a private address while still checking the same certificate identity. Resolution and certificate validation remain separate operations.
Step 3: Install files and enable the TLS port deliberately
Stage the certificate and private key into a Redis-specific directory. The example uses the common redis service group; your container may use a numerical user ID instead. Give the service the minimum read access it needs and keep the ACME account configuration and DNS-update credentials outside that readable directory.
sudo install -d -o root -g redis -m 0750 /etc/redis/tls
sudo install -o root -g redis -m 0644 \
/etc/letsencrypt/live/cache.example.com/fullchain.pem /etc/redis/tls/server.pem
sudo install -o root -g redis -m 0640 \
/etc/letsencrypt/live/cache.example.com/privkey.pem /etc/redis/tls/server.keyBack up the existing configuration and any prior key pair before activation. The configuration below disables the plaintext listener instead of quietly leaving it open beside TLS. Keep your existing bind, protected-mode, ACL, persistence, and memory-policy settings unless a reviewed change is necessary. Choose the interface and firewall rules separately; this snippet is not a complete production Redis configuration.
port 0
tls-port 6379
tls-cert-file /etc/redis/tls/server.pem
tls-key-file /etc/redis/tls/server.key
tls-ca-cert-file /etc/ssl/certs/ca-certificates.crt
tls-auth-clients no
tls-protocols "TLSv1.2 TLSv1.3"Check that the CA bundle path exists in the Redis environment. In a slim container, the host's bundle is not automatically present. A bundle of public roots is suitable for verifying public server certificates when Redis itself becomes a TLS client; it is not a thoughtful client-certificate admission policy. If you choose mutual TLS later, use the intended client CA and test unauthorized client rejection explicitly.
Step 4: Keep ACL authentication separate from TLS negotiation
A successful TLS handshake proves neither a Redis username nor its command permissions. Preserve or introduce named ACL users with scoped commands and key patterns appropriate to each workload. Do not copy a blanket +@all ~* permission set into a cache application's account just to make its first connection succeed. Queue libraries may require different commands from simple key-value cache clients, so inspect actual library requirements.
Use your established secret-distribution mechanism for ACL passwords and avoid placing them in committed examples. If using an external ACL file, manage it as a protected application secret and keep its lifecycle separate from certificate deployment. Turning TLS on should not reset existing users, change password hashes unexpectedly, or replace an established ACL file with a tutorial's sample.
Test with the same client library version your application runs. For a command-line transport check, redis-cli provides TLS and CA options. A public name in the connection command is important: testing only a local numeric address does not prove that a remote application's expected hostname can be authenticated.
redis-cli --tls -h cache.example.com -p 6379 \
--cacert /etc/ssl/certs/ca-certificates.crt \
--sni cache.example.com --user cache_app --askpass PINGThe SNI option selects a name for the handshake; do not assume it is a universal substitute for hostname-verification settings in every Redis client. Confirm your installed redis-cli and language library's verification behavior. For an independent certificate identity check, use OpenSSL with both SNI and explicit hostname verification, and require a verification error to fail the command.
openssl s_client -connect cache.example.com:6379 \
-servername cache.example.com -verify_hostname cache.example.com \
-verify_return_error -CAfile /etc/ssl/certs/ca-certificates.crt </dev/nullStep 5: Validate replication and failover as their own connections
If the instance replicates another Redis server over TLS, configure tls-replication yes and review the certificate presented when this server acts as a client. The tls-client-cert-file and tls-client-key-file settings can separate that client identity from the public-facing server identity. Do not enable mutual TLS by accident and then wonder why replica links fail despite successful application connections.
Redis Cluster also needs tls-cluster yes when encrypting its cluster transport. Review advertised addresses, ports, peer trust, and the cluster bus rather than testing only the normal client endpoint. Sentinel likewise requires its own TLS-aware configuration and compatible client discovery behavior. A standalone certificate test cannot validate a distributed system's entire failover path.
For a high-availability deployment, test a replica or a staging instance first. Verify replication health, perform a planned failover, and ensure applications reconnect through their normal discovery mechanism with verification still enabled. Certificate names must cover the names clients actually receive after failover; a primary alias that works today can hide a naming problem on tomorrow's promoted replica.
Keep capacity in mind when recycling connections. Reconnecting every cache client simultaneously can briefly overload the service or the application database behind a cold cache. Roll applications gradually, monitor latency and error rates, and distinguish authentication failures from ordinary cache misses. Encrypted transport is an infrastructure improvement, not a reason to change cache eviction policy during the same maintenance event.
Step 6: Deploy renewals with a tested activation strategy
Do not invent a generic Redis reload command for certificate files. Runtime TLS configuration support and the behavior of context replacement depend on the installed Redis version and settings. Establish a tested procedure for that exact release. A conservative standalone deployment can install validated files and perform a controlled service restart during an approved window; a high-availability deployment can roll nodes with verified replication and failover procedures.
Before activation, validate the candidate certificate's dates, alternative names, and public-key match, and preserve the previous matched certificate and key. Avoid overwriting active files with a partially copied private key. If deployment fails, restore the prior pair and the prior known-good configuration, then bring the service back using the same controlled service procedure. Never restore plaintext port exposure as an undocumented fallback.
Monitor the certificate served by a fresh connection as well as the ACME client's local expiry. Persistent Redis sessions can survive long enough to conceal a failed activation. A DNS TXT update in SimpleACME proves only that a challenge value changed; it does not prove the ACME order completed or Redis loaded the result. Combine endpoint expiry monitoring, renewal-job alerts, and an application-level PING using the normal protected client configuration.
Frequently asked questions
Why does Redis demand a client certificate after I enable TLS?
Client-certificate authentication is enabled by default for the Redis TLS listener. Decide whether your deployment uses mutual TLS or ACL credentials with server-authenticated TLS, then configure and test that policy explicitly.
Can I keep the old plaintext port temporarily?
A tightly restricted transition listener can be part of a reviewed migration, but it remains an unencrypted route. Give it a removal date and test that applications have moved before disabling it. Do not leave it open indefinitely because TLS also exists.
Does a wildcard certificate solve Redis Cluster naming?
Only if the names clients and peers use fall within that wildcard's coverage. It does not cover arbitrary IP addresses, the domain apex, or deeper labels. Inventory advertised cluster names before selecting a certificate.
Is SimpleACME a Redis plugin?
No. It provides delegated DNS challenge updates used by an ACME client. Redis receives ordinary certificate files through your deployment process and continues handling its own protocol, ACLs, and connection lifecycle.
Sources
Redis TLS documentation describes listeners, mutual TLS, replication, and cluster settings. Redis ACL documentation explains the independent user and command-permission model.