Redis via Containers


Last modified: July 28, 2022

Overview

This document explains how to set up RedisĀ® in an EasyApache 4 container. Redis is a distributed memory-caching system. This document only applies to the EasyApache 4-provided Redis package.

We provide Redis version 6.2 for use with containers. You can only install container-based packages on systems that use EasyApache 4’s containers and run AlmaLinux OS 8 or UbuntuĀ®.

Note:
In this documentation, container-name represents the name of your Redis container. You can find the containers’ names with either the registered or running options of the /usr/local/cpanel/scripts/ea-podman script.

Install Redis via containers

To install Redis in a container on a system that runs EasyApache 4, you must first set up EasyApache 4 containers on your system.

After you set up containers on your system, install the ea-redis62 package to add Redis to your system.

Set up Redis inside containers

To set up Redis to run inside a container, perform the following steps:

  1. Log in to the cPanel user account via SSH. You can log in to the account via SSH using one of the following methods:

    • the command line.
    • WHM’s Terminal interface (WHM >> Home >> Server Configuration >> Terminal).
    • cPanel’s Terminal interface (cPanel >> Home >> Advanced >> Terminal).
  2. Run the following command:

    /usr/local/cpanel/scripts/ea-podman install ea-redis62

  3. Run the following command to retrieve the container’s name. You will need this name to perform any further actions.

    /usr/local/cpanel/scripts/ea-podman containers

For more information, read our /usr/local/cpanel/scripts/ea-podman script documentation.

Configure Redis in a container

Note:
cPanel users must have shell access to configure Redis in a container.

When you install Redis into a container, it creates a directory in the ~/ea-podman.d/container-name directory in the user’s home directory. The system creates the redis.sock socket when it sets up Redis.

To use Redis with your applications, direct your application to use the ~/container-name/redis.sock socket.

Additional Documentation