Hostwinds Tutorials
Search results for:
Table of Contents
Tags: Linux
Cockpit-Docker is a plugin for Cockpit, a web-based graphical interface for managing Linux servers. This plugin specifically focuses on managing Docker containers, providing a user-friendly alternative to command-line Docker management. With Cockpit-Docker, you can:
Before starting, let's make sure you have the following squared away:
# For Ubuntu/Debian
sudo apt update && sudo apt install docker.io -y
# For Fedora/RHEL
sudo dnf install docker -y
After installation, start Docker:
sudo systemctl start docker
sudo systemctl enable docker
To confirm Docker is running:
sudo docker info
This will display details like the version of Docker, the number of running containers, and available resources.
Before installing Cockpit, update the package manager's database and upgrade existing software:
For Ubuntu/Debian
sudo apt update && sudo apt upgrade -y
On Fedora/RHEL:
sudo dnf update -y
Now, install Cockpit using your system's package manager:
On Ubuntu/Debian:
sudo apt install cockpit -y
On Fedora/RHEL:
sudo dnf install cockpit -y
sudo systemctl enable --now cockpit.socket
sudo systemctl status cockpit
Once Cockpit is installed, we can start installing the Docker management plugin:
For Ubuntu/Debian
sudo apt install cockpit-docker -y
For Fedora/RHEL
sudo dnf install cockpit-docker -y
After installing, restart Cockpit to confirm the plugin is loaded:
sudo systemctl restart cockpit
Open a browser and and type the following into the address bar:
https://<your-server-ip>:9090
Replace <your-server-ip> with your server's IP address. For local testing, you can use https://localhost:9090.
What happens here:
sudo ufw allow 9090/tcp # Ubuntu
sudo firewall-cmd --add-port=9090/tcp --permanent
sudo firewall-cmd --reload
Expected Output:
The browser might warn about a self-signed certificate. This is normal for internal tools. Click "Proceed" to continue.
Login:
Docker containers are self-contained packages that include everything an application needs to run, such as its code, libraries, and settings. It keeps the application separate from your system, so it can work the same way on any computer.
On the left-hand menu, click Containers. This opens the Cockpit-Docker interface.
The interface consists of:
Pulling a Docker image means downloading a pre-packaged blueprint of an application from a Docker registry. The image contains everything needed to run the application, such as code, libraries, and settings.
Running a new container involves creating a live, isolated instance of an application from a Docker image. Containers run the application in a consistent environment without affecting your system.
Monitoring a running container refers to observing a container's performance and activity, like CPU, memory usage, and logs.
Check if the service is running:
sudo systemctl status cockpit
Verify the cockpit-docker package is installed:
sudo apt install cockpit-docker -y
Install an SSL certificate to replace the self-signed one.
Cockpit-Docker simplifies Docker container management with an intuitive web interface. Whether you're deploying simple containers or monitoring resource usage, it's an excellent tool for server administrators. By following this guide, you should now have Cockpit-Docker installed and ready to use.
Written by Benjamin Bream / April 2, 2020