Learn how to install Cockpit on CentOS 7 with our step-by-step guide. Simplify your server management by setting up Cockpit on your CentOS 7 server efficiently. #centlinux #linux #cockpit
Cockpit is a Red Hat sponsored free and open-source software project. Cockpit is a Web UI (User Interface) that facilitates management and monitoring of a Linux server through a web browser. Besides regular operating system related management tasks, it also provides support for Docker, Kubernetes and KVM. It is very easy to start containers, administer storage, configure networks, and inspect logs via Cockpit Web UI.
Cockpit is an open-source web-based server management tool designed to simplify the administration of Linux systems. It provides a user-friendly interface for managing various aspects of your server. Here are some key features and aspects of Cockpit:
Cockpit is designed to be simple to use while providing powerful management tools, making it a great option for both beginners and experienced administrators.
Recommended Online Training: Learn Bash Shell in Linux for Beginners
In this article, we will install Cockpit on CentOS 7 server and then add support in Cockpit for managing our Kubernetes cluster, Docker and Storage.
We have a CentOS 7 virtual machine with following specifications.
The above server is the master node of a Kubernetes cluster. For information about Kubernetes configuration please refer to our previous article Install Kubernetes Cluster on CentOS 7. To read more about Kubernetes you should read Kubernetes in Action (PAID LINK) by Marko Luksa.
Connect with kubemaster-01.example.com using ssh as root user.
Cockpit is available through EPEL (Extra Packages for Enterprise Linux) yum repository. Therefore, we have to install epel-release first.
# yum install -y epel-release
Rebuild cache of yum repositories.
# yum clean all Loaded plugins: fastestmirror Cleaning repos: base docker-ce-stable epel extras kubernetes updates Cleaning up list of fastest mirrors
# yum makecache fast
Loaded plugins: fastestmirror
Determining fastest mirrors
epel/x86_64/metalink | 7.9 kB 00:00
* base: ftp3.isra.edu.pk
* epel: mirrors.nipa.cloud
* extras: ftp3.isra.edu.pk
* updates: ftp3.isra.edu.pk
base | 3.6 kB 00:00
docker-ce-stable | 3.5 kB 00:00
epel | 4.7 kB 00:00
extras | 3.4 kB 00:00
kubernetes/signature | 454 B 00:00
kubernetes/signature | 1.4 kB 00:00 !!!
updates | 3.4 kB 00:00
(1/10): base/7/x86_64/group_gz | 166 kB 00:00
(2/10): epel/x86_64/group_gz | 88 kB 00:00
(3/10): docker-ce-stable/x86_64/updateinfo | 55 B 00:01
(4/10): docker-ce-stable/x86_64/primary_db | 28 kB 00:01
(5/10): extras/7/x86_64/primary_db | 201 kB 00:01
(6/10): kubernetes/primary | 49 kB 00:01
(7/10): epel/x86_64/updateinfo | 1.0 MB 00:05
(8/10): updates/7/x86_64/primary_db | 5.0 MB 00:13
(9/10): epel/x86_64/primary_db | 6.7 MB 00:25
(10/10): base/7/x86_64/primary_db | 6.0 MB 00:28
kubernetes 351/351
Metadata Cache Created
Install cockpit using yum command.
# yum install -y cockpit
Enable and start Cockpit service.
# systemctl enable cockpit.socket Created symlink from /etc/systemd/system/sockets.target.wants/cockpit.socket to /usr/lib/systemd/system/cockpit.socket. # systemctl start cockpit.socket
Allow Cockpit Service in Linux firewall.
# firewall-cmd --permanent --add-service=cockpit success # firewall-cmd --reload success
Browse URL https://kubemaster-01.example.com:9090/ in a client’s browser. You may encounter a security certificate warning; just ignore it and continue.
Login as root user.
We are now at the system panel of Cockpit. We can monitor system performance here and modify a couple of settings like hostname, system time, etc.
We also have some other panels here like Logs, Networking, Accounts, Services, etc. However, we are installing Cockpit to control our Kubernetes cluster from here. Therefore, we have to add required functionality in Cockpit Web UI.
Install following packages to add the Kubernetes and Docker control panels in Cockpit Web UI.
# yum install -y cockpit-docker cockpit-kubernetes
Restart Cockpit service.
# systemctl restart cockpit.socket
Cockpit Web UI will be disconnected due to restart of cockpit.service.
Click on Reconnect.
Login as root user.
Now you see some new controls on the right side of the console.
Click on Containers, it provides Docker related control panel.
Click on Cluster to manager Kubernetes cluster.
We can add more control panels in the same way.
You may have notice that the Cockpit lacks a storage control panel. It is because Cockpit do not install Storage panel by default.
Therefore, to add Storage related control panel in Cockpit Web UI, we have to install cockpit-storaged package using yum command.
# yum install -y cockpit-storaged
Restart Cockpit service.
# systemctl restart cockpit.socket
Reconnect again to Cockpit Web UI and you may find the Storage Panel there.
If you are installing on a KVM host then you must install cockpit-machines package to add a control panel to manage Virtual machines.
If you are new to Linux and facing difficulty in working at Linux Bash prompt. We recommend that, you should read The Linux Command Line, 2nd Edition: A Complete Introduction by William Shotts.
If you found this guide on installing Cockpit on CentOS 7 useful and need further help or a customized setup, don’t hesitate to reach out to me on Fiverr. I offer professional installation and configuration services for Cockpit and other server management tools. Visit my Fiverr profile here to learn more and get started with your project today!
Learn how to change Apache document root in Linux by following this step-by-step guide. Adjust…
Discover how to change Apache port in Linux easily. Follow our simple guide to modify…
Learn how to create a virtual host in Apache Server with this comprehensive guide. Set…
Discover 10 practical tasks for the RHCSA exam with step-by-step solutions. Boost your Linux skills…
Discover the ultimate Fail2ban configuration guide. Learn how to set up, customize, and optimize Fail2ban…
Explore the ultimate guide to VPS servers and learn everything about Virtual Private Servers, including…
This website uses cookies.
View Comments
Good tutorial. Keep it up.