The Cockpit is an open-source web-based server management tool that allows administrators to manage and monitor their Linux server systems remotely. It provides a nice Dashboard to administer your Linux servers from a web browser.
With Cockpit, you can check the system performance, the load, start/stop services, disk space, CPU & memory usage, running process, and more. One notable feature of Cockpit is that you can access the terminal from the dashboard and install various packages over the remote server.
Some of the features of Cockpit are:
- Create and manage virtual machines
- Software updates
- Configure a firewall
- Inspect a system’s hardware
- Manage user accounts
- Manage networking
- Manage storage (including RAID and LUKS partitions)
- Browse and search system logs
- Detailed metrics: CPU load, network activity, storage performance etc
Cockpit uses an inbuilt tiny HTTP server, doesn't need Apache, Nginx, or Tomcat Webserver. In this tutorial, we learn how to install Cockpit on AlmaLinux 8 or Rocky Linux 8.
Step 1: Update AlmaLinux or Rocky Linux system
First, update the system using the following command:
sudo dnf update
Step 2: Install Cockpit on AlmaLinux or Rocky Linux
Cockpit is available in the base OS repository. You can simply install Cockpit by running the following command in the terminal:
sudo dnf install cockpit
Step 3: Start and enable Cockpit
To start and enable the cockpit service, run the following command:
sudo systemctl enable --now cockpit.socket
This single command will both start and enable the Cockpit service.
You can verify the status of the Cockpit service, type
sudo systemctl status cockpit
Step 4: Firewall Setting
You can skip this step if you don't have a firewall enabled. Cockpit listens on port 9090.
You need to allow the cockpit service in the firewall with the following commands:
sudo firewall-cmd --permanent --zone=public --add-service=cockpit sudo firewall-cmd --reload
Step 5: Access Cockpit Web Interface
You can now access the Cockpit web interface using the domain name or IP address.
If you don't know the IP address, type the following command to check.
$ ip a
If you are seeing that connections aren't private, click on the Advanced button and continue to use unsafe without an SSL.
Enter the username and password of the root or sudo user and click the 'Log in' button.
Welcome to the Cockpit Dashboard, from the right side will see the main menu, from there you can start exploring and managing Linux system from Server Health, CPU & Memory Usage, configuring the network, Inspect Logs, Storage, start containers, etc.
You can add more hosts by clicking on the Drop-Down menu in the Top Left corner. The hosts need to have SSH access and be accessible on port 22.
In this tutorial, we learned how to install Cockpit on AlmaLinux 8 or Rocky Linux 8. Now you can easily manage your Linux servers from the web browser.
Thanks for reading, please provide your suggestion and feedback in the comment section.