EasyApache 4 Containers


Last modified: December 14, 2023

Overview

EasyApache 4 provides the ability to run applications in containers. We only support containers on systems that run AlmaLinux, Rocky Linux™, or Ubuntu®.

Containers are a light-weight way to manage individual software images. They provide a way for the application to run independently and separately from the rest of the server. This is similar to a virtual machine, except it uses fewer resources and can be quickly and easily started and stopped.

We use podman for our containers. Podman allows your applications to run in the user space as the user rather than as the root user.

Important:
  • You must log in with SSH as the user. You cannot use the su - or sudo -E commands to run this script.
  • You cannot use EasyApache 4 containers on a system that also runs Virtuozzo unless you enable systemctl at the user level. Virtuozzo disables this function by default.

Setting up containers

To set up containers, you must first install the ea-podman-repo package. You must install this package first. Then, install the ea-podman package. This package sets up the system for containers and installs our /usr/local/cpanel/scripts/ea-podman script to manage them.

Note:
To use an application in the containers on your server, you must install either a cPanel-provided container-based package or an image from another source, such as Dockerhub. You can only perform this action after you set up the containers on your server.

AlmaLinux and Rocky Linux

To start using containers on AlmaLinux or Rocky Linux, run the following commands on the command line as the root user:

1
2
dnf install -y ea-podman-repo
dnf install -y ea-podman

Ubuntu

To start using containers on Ubuntu, run the following commands on the command line as the root user:

1
2
3
apt install -y ea-podman-repo
apt update
apt install -y ea-podman

Use an EA4 container-based package

Note:

Before you can use an EA4 container-based package for your containers, your system administrator must install the EasyApache 4 package on the command line.

Log into the cPanel user account via SSH. You can do this by either logging into the account via SSH from the command line, or using SSH in either WHM’s Terminal interface (WHM » Home » Server Configuration » Terminal) or cPanel’s Terminal interface (cPanel » Home » Advanced » Terminal).

To set up your application, run the following command, where package represents the name of a EA4 container-based package:

/scripts/ea-podman install package

When you set up a container, the system also creates the ~/ea-podman.d/application-name directory in the user’s home directory. These directories contain information, files, and other data for the container.

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

Ubuntu 22.04 considerations

Containers will work on systems that run Ubuntu 22.04.

However, you may encounter the following error when you have an EA4 container-based package installed:

potentially insufficient UIDs or GIDs available in user namespace 

To resolve this error, add the following lines to your /etc/containers/storage.conf file:

1
2
3
4
5
6
[storage]
driver = "overlay"
runroot = "/run/containers/storage"
graphroot = "/var/lib/containers/storage"
[storage.options]
ignore_chown_errors = "true"
Note:
  • The system creates the /etc/containers/storage.conf file if it does not already exist. However, it will not write over an existing file. You must edit the file manually to resolve this error.
  • If the kernal overlayfs driver is not installed on your system, install it with the following command:
    apt install fuse-overlayfs

Use a non-cPanel-provided image

Log into the cPanel user account via SSH. You can do this by either logging into the account via SSH from the command line, or using SSH in either WHM’s Terminal interface (WHM » Home » Server Configuration » Terminal) or cPanel’s Terminal interface (cPanel » Home » Advanced » Terminal).

To set up your application, run the following command, where application represents the name of the application and image represents an image provided by a site such as Dockerhub:

/scripts/ea-podman install application [options] image

When you set up a container, the system also creates the ~/ea-podman.d/application-name directory in the user’s home directory. These directories contain information, files, and other data for the container.

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

Working with containers

When you install a container package, it creates the ~/ea-podman.d/application-name directory in the user’s home directory. You can navigate to these directories to add and delete files and make other changes without the need to log in to the container instance. You can find the names of your containers with one of the following commands:

  • /usr/local/cpanel/scripts/ea-podman registered
  • /usr/local/cpanel/scripts/ea-podman running

You can also use the /usr/local/cpanel/scripts/ea-podman bash command to run bash commands as if you are logged in to the container’s shell interface.

For full information about how to work with containers, read our /usr/local/cpanel/scripts/ea-podman script documentation.

Available packages for containers

We provide the following packages for containers. These packages are already configured to run on a cPanel system:

  • Memcached 1.6
  • Redis® 6.2
  • Apache Tomcat® 10.0
    Note:
    Tomcat 10.0 is end-of-life but will continue to function. We strongly recommend using Tomcat 10.1 instead.
  • Apache Tomcat® 10.1

You can also run the following command to view the available EA4 container-based packages:

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

Additional Documentation