EasyApache 4 Containers
Last modified: March 16, 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.
- You must log in with SSH as the user. You cannot use the
su -
orsudo -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, we recommend installing the ea-podman
and ea-tomcat100
packages. These packages set up the system for containers and install our /usr/local/cpanel/scripts/ea-podman
script to manage them.
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:
|
|
Ubuntu
To start using containers on Ubuntu, run the following commands on the command line as the root
user:
|
|
Use an EA4 container-based package
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.
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
You can also run the following command to view the available EA4 container-based packages:
/usr/local/cpanel/scripts/ea-podman available