How to use CyberPanel to easily manage Docker images and containers


If you’re a hosting provider looking to add containers into your offering, Jack Wallen shows you how easy it can be with the help of CyberPanel.

Image: gorodenkoff Getty Images/iStockphoto

CyberPanel is an alternative for cPanel, one that allows you to deploy and host websites for clients with speed and ease. But CyberPanel does have a few extra tricks up its sleeve; one such trick will be most welcome to those developers looking to add containers into their offerings.

I’m talking about Docker. CyberPanel allows admins to pull images and create/deploy containers from those images, all from the convenience of a well-designed web interface. I’ve already walked you through the steps of getting CyberPanel up and running (read: CyberPanel makes one-click installing of web-hosted apps and services simple). In this how-to, I’m going to show you how to add Docker support into the mix and then deploy a simple container.

SEE: Kubernetes: A cheat sheet (free PDF)  (TechRepublic)

What you’ll need

There are only two things you’ll need to make this happen:

  • A running instance of CyberPanel
  • A user with sudo privileges

Let’s make some container magic.

How to install Docker

For CyberPanel to work with Docker containers, Docker must first be installed. Since we installed CyperPanel on Ubuntu Server 20.04, this is quite simple. Log into your hosting server and issue the following command to install Docker:

sudo apt-get install docker.io -y 

Once that completes, you should add your user to the docker group. Even though CyberPanel does not use your user for this, you should do so (in case you need to work with Docker from the command line). This is handled with the command:

sudo usermod -aG docker $USER

Log out and log in for the changes to take effect.

How to deploy a container with CyberPanel

We can now work with containers in CyberPanel. Log into your instance and click Docker Manager in the left navigation (Figure A).

Figure A

cyberpanelcontainersa.jpgcyberpanelcontainersa.jpg

The Docker Manager entry in the CyberPanel sidebar.

After the menu expands (Figure B), select Manage Images.

Figure B

cyberpanelcontainersb.jpgcyberpanelcontainersb.jpg

The expanded Docker Manager menu entry allows you to Manage Images, Manage Containers or Create New Containers.

Since we’ve yet to pull down any images, let’s do so. We’ll pull down the latest version of the NGINX container. In the search field, type nginx, and then, when the results appear, click the Tag drop-down and locate the NGINX tag you’re looking for and then click Pull.

Figure C

cyberpanelcontainersc.jpgcyberpanelcontainersc.jpg

Pulling down the latest NGINX container image.

With the NGINX container pulled, go back to the Docker Manager menu and click Create New Container. In the resulting window (Figure D), you should see our NGINX image. Select the tag for the image (in this instance, there’ll only be one, and click Create.

Figure D

cyberpanelcontainersd.jpgcyberpanelcontainersd.jpg

Creating a container from the NGINX image we just pulled.

We can now fill out the details for our container. Make sure to configure everything necessary for the container and then click Create Container. If you need to map a volume for the container, click Add filed under Map Volumes and then enter the local directory under source and the container directory under destination (Figure E).

Figure E

cyberpanelcontainerse.jpgcyberpanelcontainerse.jpg

Filing out the details for our container.

Once the container has been created, you can then run it by clicking the Start button in the container management window (Figure F).

Figure F

cyberpanelcontainersf.jpgcyberpanelcontainersf.jpg

Starting your new container is just a click of a button away.

You should then see the container listed as Running. Congratulations, you’ve just deployed your first container with CyberPanel. You can now add containers to the list of features you offer as a hosting provider.

Also see



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *