Skip to main content
The following guide will help you deploy the Minimus Redis image with self-signed, locally issued certificates to help you get started. Run the code to try it for yourself.
For production purposes, we recommend using publicly trusted certificates issued by a Certificate Authority (CA).

Components

  • Redis image built by Minimus: Redis container configured to require secure connections via TLS.
  • Dynamic certificate generation via OpenSSL:
    • certgen.sh script: Shell script that generates a custom CA, server, and client certificates using OpenSSL.
    • minidebug image: A Minimus dev toolkit that provides a shell, OpenSSL, and other utilities used to generate the certificates.

What this guide demonstrates

  • TLS handshake validation
  • Server/client certificate trust
  • Basic auth and Redis operations
  • Image compatibility

Directory structure

Deploy Redis with TLS certificates

Step 1: Generate TLS certificates

1

Save script that generates TLS certificates

Save the following script to a file named certgen.sh. The script is used to generate the TLS certificates and store them in a certs folder on the host.
certgen.sh
2

Save Docker Compose configuration

Save the following YAML file to run with Docker Compose. It uses the Minimus minidebug image to generate the certificates with the certgen.sh shell script. Minidebug is a Minimus dev toolkit that provides a shell, OpenSSL, and other utilities. The certificates will be persisted in the certs volume on the host.
create-certs.yml
3

Generate certificates

Run the following to generate the certificates:
Congrats! You have just generated the following self-signed certificates:
  • Self-signed CA certificate (ca.pem)
  • Server certificates (server-cert.pem, server-key.pem) with SANs: Redis, localhost, and 192.168.20.3
  • Client certificates for testuser(client.csr, client-key.pem)
Certificate permissions are adjusted to support non-root containers. In the next steps, you will mount these certificates into the Redis container.

Step 2: Deploy Redis server

1

Save Docker Compose script

Save the following Docker Compose script to a file named docker-compose.yml. This script sets up the Redis service with a healthcheck, mounts a volume with the certificates, and maps port 6379. The container is configured with "--tls-auth-clients", "yes" to require client certificates.
docker-compose.yml
2

Run Redis

Start the Redis container:

Step 3: Test your Redis server

We will use redis-cli to connect over TLS and run tests. For example, here are a few commands you can try out:
  1. Check server info and health:
  2. Add test key to a database:
    Redis has numbered logical databases (default 0–15) rather than named databases.
    Verify the key:
  3. Test data persistence:
    Save data
    Stop the container, then restart it:
    Check the key you added in the previous step:
    Get key
  4. Delete the key:
Last modified on July 12, 2026