Install Docker on cPanel

Install Docker on cPanel

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
image 4 - Install Docker on cPanel
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

image 7 - Install Docker on cPanel

Whitelist the docker network

csf -a 172.17.0.0/24

then restart csf:

csf -ra

or from WHM > ConfigServer Firewall > Firewall Configuration

image 5 - Install Docker on cPanel

and whitelist Docker network:

image 6 - Install Docker on cPanel

That completes the installation of Docker on cPanel.

whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.