Cockpit is a helpful web panel that can be used on various Linux distributions to perform administrative tasks on your server. Cockpit gives you the ability to manage Docker containers from your web browser by installing cockpit-docker
. This guide assumes you have already installed Docker Engine, and will walk through how to start using cockpit-docker
to manage containers.
Prequisites:
- An updated system (follow the steps here if you have not updated your server).
- Docker Engine installed on your server. If not installed, you can follow our guides to install on CentOS, Debian, or Ubuntu. If you are not sure, you can verify using:
docker --version
Step 1 – Install Cockpit
Install Cockpit with the following:
-
CentOS 7 (Cockpit is Included)
sudo yum install cockpit
sudo systemctl enable --now cockpit.socket
If needed, open the firewall to the cockpit service:
sudo firewall-cmd --permanent --zone=public --add-service=cockpit
sudo firewall-cmd --reload
-
Debian 9
echo 'deb http://deb.debian.org/debian stretch-backports main' > /etc/apt/sources.list.d/backports.list
apt-get update
sudo apt-get install cockpit
sudo systemctl enable --now cockpit.socket
-
Ubuntu 17.04 and Later (Cockpit is Included)
sudo apt-get install cockpit
sudo systemctl enable --now cockpit.socket
Step 2 – Install cockpit-docker
Install cockpit-docker with the following:
-
CentOS 7
yum install -y cockpit-docker
sudo systemctl restart cockpit.socket
-
Debian/Ubuntu
sudo apt-get -y install cockpit-docker
sudo systemctl restart cockpit.socket
Step 3 – Manage Docker Containers with Cockpit
Finally, navigate to Cockpit at https://<your IP or hostname>:9090 and log in to your server. Select the Containers tab on the left:
Here you will find the running containers listed above all Docker images.
Additionally, the drop-down menu in the upper-left corner allows you to view everything, including exited containers.
-
Pulling, Running, Stopping, Starting and Restarting a New Image:
Select Get new image:
Search for your image, select it and click Download:
You should find the image listed under Images. Select the run icon next to the image:
Here you can name your container and make other configurations. Then click Run:
To stop the container, select it:
After selecting the container, you have the option to Start, Stop, Restart, Delete, or Commit. With the Ubuntu image, you will find your terminal here:
Now you can easily manage Docker containers from your web browser with an easy-to-use interface!