EasyApache 4 Containers

Last modified: September 12, 2024


Overview

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

Containers are a lightweight 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 as themselves rather than as the root user.

Important:

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

Important:

To set up containers, you must log in with SSH as the cPanel user or use the machinectl command as the root user to switch to a cPanel user account.

To set up containers, perform the following steps:

  1. Install the ea-podman-repo package. You must install this package first.
  2. 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.
  3. Run the /usr/local/cpanel/scripts/ea-podman script to add the containers. You cannot use the su - or sudo -E commands to run this script.

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

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 as the root user:

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 overwrite an existing file. You must edit the file manually to resolve this error.
  • If the kernel overlayfs driver is not installed on your system, install it with the following command:
    apt install fuse-overlayfs

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 from the command line 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.

Use a non-cPanel-provided image

Log into the cPanel user account via SSH. You can do this from the command line 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 a third-party image, such as a Dockerhub image:

/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, as well as 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:

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

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

Additional Documentation