Installing CyberPanel INSIDE docker

Hi, hence cyberpanel can only be installed on centos7 , as for now. and many people asking for other Linux distro, so I spent couple hours googling Docker as it can be deployed on many different system.

NOTE: this is TESTING only , do NOT use it on production server.
I have tested image on centos7.4 and debian9.4 , and tested as much functions as possible , but this is NOT guaranteed bug-free, so please feel free to report any problem you’ve encountered.

If you encountered a issue or bug , please try first if it can be reproduced on standard installation to ruled out if it’s due to Docker or bug in cyberpanel itself.


Install Docker

Install and start docker by following the docker documents

for CentOS

for Debian

for Ubuntu

Check if port 25 is already in use by postfix (Centos) and exim4 (Debian)

netstat -lnp | grep 25

if so , stop it first , otherwise it will conflict with cyberpanel’s mail function.

for Centos

systemctl stop postfix
systemctl disable postfix

for Debian

systemctl stop exim4
systemctl disable exim4

Install CyberPanel

Option 1: Pre-Built Image

wget https://mirror.cyberpanel.net/docker/cyberpanel.img

Download the pre-built docker image

docker import cyberpanel.img

Import the image

docker images

Check the images , and note the image ID

docker run --restart always -p 8090:8090 -p 80:80 -p 443:443 -p 21:21 -p 25:25 -p 587:587 -p 465:465 -p 110:110 -p 143:143 -p 993:993 -p 53:53 -p 53:53/udp -p 7080:7080 -p 40110-40210:40110-40210 -d -i -t -e "container=docker" --privileged=true -v /sys/fs/cgroup:/sys/fs/cgroup --name cyberpanel IMAGE_ID /usr/sbin/init

Replace the IMAGE_ID ( 2rd to last ) with the image ID you see in previous command.

This will start docker with 21/25/53/80/110/143/465/587/993/7080/8090 port.

docker exec -it cyberpanel /bin/bash

Now enter the container.

there are 2 things I have noticed ,

first: modify the IP in /etc/cyberpanel/machineIP

you can do this by sed command

sed -i 's/127.0.0.1/YOUR_SERVER_IP/g' /etc/cyberpanel/machineIP

second: if you have multiple CPU machine , you need to get into OpenLiteSpeed WebAdmin Console to manually bind more CPU into listener(s)

Option 2: New install inside container

docker pull centos

Get Centos image as base

docker run --restart always -p 8090:8090 -p 80:80 -p 443:443 -p 21:21 -p 25:25 -p 587:587 -p 465:465 -p 110:110 -p 143:143 -p 993:993 -p 53:53 -p 53:53/udp -p 7080:7080 -p 40110-40210:40110-40210 -d -i -t -e "container=docker" --privileged=true -v /sys/fs/cgroup:/sys/fs/cgroup --name cyberpanel centos /usr/sbin/init

Start docker container

docker exec -it cyberpanel /bin/bash

Enter container

Now you can install it as usual way

sh <(curl https://mirror.cyberpanel.net/install-cn.sh || wget -O - https://mirror.cyberpanel.net/install-cn.sh)

mirror server is located in German , it should be OK to serve worldwide , so please report the download speed

or

sh <(curl https://cyberpanel.net/install.sh || wget -O - https://cyberpanel.net/install.sh)


if you facing a CPU @ 100% by tty1 service

run this in both container and host

systemctl stop [email protected]
systemctl mask [email protected]
1 Like

docker image updated to 1.6.2

awesome <3

Great resource, Thanks

But anybody tell whats extra benefit do we get installing cyberpanel on docker?

updated to 1.6.3 image

@pkjindal said:
Great resource, Thanks

But anybody tell whats extra benefit do we get installing cyberpanel on docker?

well , I guess 2 things.

  1. able to work on other Linux dist as cyberpanel is only on centos7

  2. easier to migrate to other server

docker image updated to 1.6.4

I am wrong with the CyberPanel module,
at the time I connect to WHMCS it just keeps loading and it does not go away, probably they have to develop another module because of this update 1.6.4

This is a great post currently is this still working?

@qtwrk great job. is it still working?

Amazing, thanks a lot!

thank you very much. great post … very helpful…

link docker image is ERROR 404: Not Found, https://mirror.cyberpanel.net/docker/cyberpanel.img

Yeah @michal is correct

Please update, cyberpanel.img this url dont work
Thank you!

why not make an official docker hub image availible or team up with the maintainer of OLS wordpress ?

https://hub.docker.com/r/litespeedtech/openlitespeed

an how to install cyberpanel if you allready got openlitespeed docker running ? will there be or is there an appinstall.sh version ?

1 Like

I couldn’t find the Docker image for CyberPanel. Can anyone help me to install CyberPanel on Docker?

Thank you!