Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I Install Docker Over cPanel?

Tags:

docker

cpanel

Can I install Docker over a server with pre-installed cPanel and CentOS 7? Since I am not aware of Docker, I am not completely sure whether it will mess with cPanel or not. I already have a server with CentOS 7 and cPanel configured. I want to know if I can install Docker over this configuration I mentioned without messing up?

like image 200
Afzaal Avatar asked Oct 01 '17 06:10

Afzaal


People also ask

Can a Docker container run on cross platform?

You can run both Linux and Windows programs and executables in Docker containers. The Docker platform runs natively on Linux (on x86-64, ARM and many other CPU architectures) and on Windows (x86-64). Docker Inc. builds products that let you build and run containers on Linux, Windows and macOS.

Can I install Docker on shared hosting?

No because you need root access to install docker. Shared hosting does not allow you to install software on the server and neither you are granted with root access to install the Docker daemon or execute the commands that Docker requires.

Does GoDaddy support Docker?

Usage. Official documentation for Docker Machine is available here. To create machines on GoDaddy Cloud Servers you will need an API key associated with your GoDaddy account. API keys can be obtained on the GoDaddy Developer Portal.

Can I install Docker inside VirtualBox?

Docker for Windows uses Microsoft Hyper-V for virtualization, and Hyper-V is not compatible with Oracle VirtualBox. Therefore, you cannot run the two solutions simultaneously. But you can still use docker-machine to create more local VMs by using the Microsoft Hyper-V driver.


3 Answers

I've been doing research and working on getting Docker working on cPanel. It's not just getting it to work on a CentOS 7 box but rather making it palatable for the cPanel crowd in the form of a plugin. So far I can confirm that it's absolutely doable. Here's what I've accomplished and how:

  1. Integrate Docker Compose with cPanel (which is somewhat a step further from WHM)
  2. Leverage the user-namespace kernel feature in Linux so Docker services can't escalate their privileges (see userns remap)
  3. Leverage Docker Compose so users can build complex services and start ready apps from the store with a click
  4. Make sure services starting via Docker run on a non-public IP on the server. Everything gets routed via ProxyPass

cPanel has been gracious to provide a Slack channel for people to discuss this upcoming plugin. I'd be more than happy to invite you if you'd like to be kept updated or to contribute. Let me know!

FYI, there's more info here on https://www.unixy.net/docker if you're interested. Please note that this plugin is in private beta but more than happy to let people use it!

like image 25
Joe H Avatar answered Sep 20 '22 15:09

Joe H


Yes you can install docker over cPanel/WHM just like installing it on any other CentOS server/virtual machine.

Just follow these simple steps (as root):

1) yum install -y yum-utils device-mapper-persistent-data lvm2 (these should be already installed...)
2) yum-config-manager --add-repo    https://download.docker.com/linux/centos/docker-ce.repo
3) yum install docker-ce
4) enable docker at boot (systemctl enable docker)
5) start docker service (systemctl start docker)

The guide above is for CentOS 7.x. Don't expect to find any references or options related to Docker in the WHM interface. You will be able to control docker via command line from a SSH shell.

I have some docker containers already running on my cPanel/WHM server and I have no issues with them. I basically use them for caching, proxying and other similar stuff.

And as long as you follow these instructions, you won't mess-up any of your cPanel/WHM services/settings or current cPanel accounts/settings/sites/emails etc.

Not sure why you haven't tried this already!

like image 93
Bogdan Stoica Avatar answered Sep 21 '22 15:09

Bogdan Stoica


Yes you could, in fact someone else has done it already: https://github.com/mirhosting/cPanel-docker

like image 37
Sergiu Avatar answered Sep 19 '22 15:09

Sergiu