When I manage my Linux servers, I mostly prefer the command line. But there are some situations where you might want to manage your Linux server with a GUI. For example, if you want to quickly see server metrics like CPU and memory utilization or if you want to create and install virtual machines. And let’s be honest, it’s also sometimes quicker and easier if you’re not familiar with all the commands in the terminal. In this tutorial, I will show you how to easily manage your Linux server with a web GUI called cockpit.
How to install a web GUI on your Linux server
When you search for a good web GUI to manage your Linux server, you often will find tools like Webmin or Cpanel. But I recently found an open-source project that is called the cockpit-project. It was originally developed for RHEL and CentOS, but it also runs on a bunch of common Linux distros like Ubuntu or Debian. It is very lightweight, looks very modern and clean, and is easy to use.
It’s also highly customizable and extendable, as it supports custom plugins. You can find very useful and interesting projects on GitHub that will extend the functions in cockpit. If you want to install this on your Linux server you should first check the installation documentation if your Linux distro is supported. Note, this software might look a bit different on some distros as they don’t always share the same features. In this example, I will install this on my home lab server with Ubuntu 20.04 LTS.
On Ubuntu, you simply install cockpit with the following command.
sudo apt install cockpit
It will install a bunch of different tools, and once the installation is completed, you can simply access the web GUI on port 9090. You can use any administrative Linux user that is existing on the system to log in.
Basic functions of cockpit
This is how cockpit looks when you open it on Ubuntu 20.04 LTS. This offers the main features to manage your entire Linux server.
With the basic features, you troubleshoot by taking a look at the log files or start and stop services. You can also configure storage settings, network, and manage Linux user accounts. Also, maintenance tasks can be done easily, like performing package updates or open a web-based terminal, if you like to execute some commands.
Unfortunately, I was not able to manage containers through the cockpit installation on Ubuntu 20.04. Because, cockpit recently switched from docker to podman, as this is heavily pushed by Red Hat. The problem is, that the cockpit-podman module is not in the official repository of Ubuntu, yet. This is a small drawback when running cockpit on Ubuntu, but I like other solutions to manage my containers, anyway.
Fix broken Software Update of cockpit on Ubuntu 20.04
Sometimes if you want to manage Software Updates with cockpit you get an error on Ubuntu 20.04. Because Ubuntu recently changed its network management service from network-manager to netplan. But fortunately, this can be easily fixed with a simple change in your interface configuration file. Open your main configuration file for your network interfaces that are located in /etc/netplan/. Then you simply need to add “renderer: NetworkManager” in the “network” section.
After this change, execute the following command.
sudo try netplan
Manage virtual machines through a web GUI with cockpit
One absolute killer-feature for me is the ability to manage your virtual machines running on KVM with cockpit. To enable this feature, you need to install the cockpit-machines package first. On Ubuntu, you can easily do this with the following command.
sudo apt install cockpit-machines</
Now, if you simply reload the window, you will see a new section that is called “Virtual Machines”. It’s very easy to create and manage virtual machines because you can easily do this with the web UI. This is much easier and more straightforward than install and manages virtual machines via the terminal.
You can also manage the networking and storage pools of your virtual machines. If you want to create new virtual machines you simply run the integrated wizard and attach a web VNC client directly without installing additional clients or software.
Install custom plugins on cockpit
You can also extend cockpit with custom plugins from the community. I recently found an interesting project on GitHub that can be used to manage ZFS storage pools.
Note, this project is not released, yet. Use it at your own risk.
To install plugins simply clone the GitHub repository and copy the code in the cockpit directory with the following commands.
git clone https://github.com/optimans/cockpit-zfs-manager.git sudo cp -r cockpit-zfs-manager/zfs /usr/share/cockpit
If you reload your cockpit web interface, you should see a new section that is called “ZFS”.