Side note: I think it’s a bad idea to run Docker on cPanel because, if a user is given root access inside the container, they are just one kernel exploit away from gaining control of the entire server.
1. Install Docker on cPanel
From the terminal run:
curl -fsSL https://get.docker.com/ | sh
systemctl start docker
And add it to systemctl so that it starts after reboot:
systemctl enable docker
2. Allow Docker in CSF
Edit /etc/csf/csf.conf and change DOCKER = “0” to DOCKER = “1“
Whitelist the docker network
csf -a 172.17.0.0/24
then restart csf:
or from WHM > ConfigServer Firewall > Firewall Configuration
and whitelist Docker network:
That completes the installation of Docker on cPanel.