Imagine how great it would be if, in order to configure a new Linux server, you don't have to memorize and issue commands. There is a dedicated tool for this – Cockpit. Today we will show you how to install it and tell you about its features.
Cockpit is a lightweight and simple web-based tool for managing Linux servers from a friendly graphical interface. It makes it easy to perform tasks such as running containers, administering storage, configuring networks or checking logs. Through the use of APIs, it allows an entire team of administrators to manage systems in their preferred way.
Here's a list of examples of the features Cockpit offers:
- inspecting and changing network settings
- firewall configuration
- storage management (including RAID and LUKS partitions)
- managing virtual machines
- downloading and running containers
- reviewing system logs
- inspecting the hardware on which the system runs
- upgrading software
- performance monitoring
- managing user accounts
- managing systemd-based services
- using the browser-based terminal.
The installation of the tool is simple and comes down to calling the following commands:
sudo dnf install -y cockpit'*' sudo systemctl enable --now cockpit
As part of the blog post, we assume that the tool has been installed on the same computer from which we will be connecting to it via the browser. Accordingly, in the browser we enter as address:
https://127.0.0.1:9090, we confirm the security exception and log in with the same credentials as for the operating system.
We will be greeted by the following screen:
This is a dashboard that presents information about the server. With it, we can quickly and easily assess the status of the system.
Creating a new administrator
Let's create a sample administrative account so that you don't have to log into Cockpit as root. Naturally, for security reasons, the best practice is to use non-root users to log into Cockpit and SSH.
Go to the
Accounts tab and click on the
Create new account button.
Fill out the form. We enter the details of the new administrator and the password for this account.
Server administrator option:
A new administrative account has just been created.
Cockpit provides a standard terminal shell. This shell and the processes running in it have the same privileges as if the user had logged in via SSH.
Another configuration item when setting up a new server is a firewall. It makes our server more secure. Cockpit allows administrators to enable and manage firewall rules. It also allows you to manage firewalld zones, which we wrote about in this article.
The interface allows adding services to the firewall configuration - with all the ports they use. To illustrate, let's look at the
RH-Satellite-6 rule. It opens ports for the EuroMan platform.
Let's configure system updates. To do this, we go to the
Software updates tab, which looks as follows:
This dashboard presents some interesting options:
- immediate installation of security patches only or all patches
- configuration of automatic updates
- kernel live patching configuration.
Let's configure the last two options.
We set up automatic updates and reboot the server every day at 6:00 a.m., installing all updates – not just the security ones.
We also set the kernel patching option for both the current kernel and those installed in the future.
In this tutorial, we showed you how to install and configure the Cockpit web console. We also showed how to perform various management and configuration tasks from a web browser.