Docker Image pre-built and Guide of installing cyberpanel inside docker

edited March 31 in General Discussion

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 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

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)


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 getty@tty1.service
systemctl mask getty@tty1.service
Tagged:
Tagged:

Comments

Sign In or Register to comment.
Support CyberPanel CyberPanel Discord

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!