How To Set up Cockpit on AlmaLinux 8

In this guide, we want to teach you How To Set up a Cockpit on AlmaLinux 8.

Cockpit is a free, open-source, server administration tool that allows you to easily monitor and administer Linux servers via a web browser. It helps the system admins to perform simple administration tasks, such as managing users, starting containers, administrating storage, configuring the network, inspecting logs, and so on.

How To Set up Cockpit on AlmaLinux 8

To set up Cockpit, you need to log in to your server as a non-root user with sudo privileges and set up a basic firewall. To do this, you can check our guide the Initial Server Setup with AlmaLinux 8.

Install Cockpit on AlmaLinux 8

First, you need to update your local package index with the command below:

sudo dnf update -y

The Cockpit packages are available in the default AlmaLinux repository. To install it, run the following command:

sudo dnf install cockpit -y

Start your Cockpit service with the command below:

sudo systemctl start cockpit.service

To enable Cockpit to start on boot, run:

sudo systemctl enable cockpit.socket

Now verify that Cockpit is active and running on your AlmaLinux 8 by using the following command:

sudo systemctl status cockpit
Output
● cockpit.service - Cockpit Web Service
Loaded: loaded (/usr/lib/systemd/system/cockpit.service; static; vendor pres>
Active: active (running) since Thu 2022-05-19 05:07:39 EDT; 3s ago
Docs: man:cockpit-ws(8)
Process: 88378 ExecStartPre=/usr/libexec/cockpit-certificate-ensure --for-coc>
Main PID: 88380 (cockpit-tls)
Tasks: 1 (limit: 11409)
Memory: 684.0K
CGroup: /system.slice/cockpit.service
└─88380 /usr/libexec/cockpit-tls

At this point, you need to adjust the firewall for the Cockpit.

Note: Cockpit should have allowed rules if added originally with your AlmaLinux 8 Stream installation by default. If you see the following error, you are safe to move on.

Warning: ALREADY_ENABLED: cockpit

By default, Cockpit listens on port 9090. To allow Cockpit through the firewall, run the command below:

sudo firewall-cmd --permanent --zone=public --add-service=cockpit

Reload the firewall, to apply the new rules:

sudo firewall-cmd --reload

Access Cockpit Web Interface

At this point, you can access Cockpit through the web interface by typing your server’s IP address in your web browser followed by:

http://server-ip-address:9090

You will see your Cockpit login screen. Enter your sudo username or root username and password—log in to proceed to the dashboard.

Cockpit login screen

Once logged in, you will see the immediate dashboard. Cockpit’s main options are on the left side, where you can add additional hosts if they have SSH allow connections, view logs, configure network and containers, restart, kill, maintain services, and much more.

Cockpit dashboard on AlmaLinux 8

One of the main benefits of using Cockpit is having a terminal screen in a Web UI. At the bottom of the page, click Terminal.

From there, you have a terminal with the power of using a Web-based GUI to assist you in bringing the best of both worlds together.

Conclusion

At this point, you learn to Set up Cockpit on AlmaLinux 8.

I hope you enjoy it.

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Leave a Reply

Stay informed and not overwhelmed, subscribe now!