Set up Cockpit on AlmaLinux 8 | Free Admin Tool – OrcaCore

Posted on

Set up Cockpit on AlmaLinux 8 | Free Admin Tool - OrcaCore

Set up Cockpit on AlmaLinux 8 | Free Admin Tool – OrcaCore

In this guide, we’ll walk you through How To Set up Cockpit on AlmaLinux 8. Cockpit is a valuable, free, open-source server administration tool that provides a user-friendly web interface to monitor and manage your Linux servers. It simplifies common administrative tasks, such as user management, container orchestration, storage administration, network configuration, and log inspection, making it an ideal tool for system administrators.

You can follow the steps below to install the Cockpit server administration tool on your AlmaLinux 8 system, as detailed on the Orcacore website.

Before proceeding, ensure you have a non-root user with sudo privileges on your AlmaLinux 8 server and that a basic firewall is configured. If you haven’t already, refer to the Initial Server Setup with AlmaLinux 8 guide on Orcacore for detailed instructions.

1. Install Cockpit on AlmaLinux 8

Begin by updating your local package index to ensure you have the latest package information:

sudo dnf update -y

The Cockpit packages are readily available within the default AlmaLinux repository. Install Cockpit using the following command:

sudo dnf install cockpit -y

2. Start and Enable Cockpit Server Administration

Now that Cockpit is installed, start the service:

sudo systemctl start cockpit.service

To ensure Cockpit automatically starts upon system boot, enable it:

sudo systemctl enable cockpit.socket

Verify that Cockpit is active and running correctly by checking its status:

sudo systemctl status cockpit
**Output**
● cockpit.service - Cockpit Web Service
     Loaded: loaded (/usr/lib/systemd/system/cockpit.service; static; vendor preset: disabled)
     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-cockpit --automatic
   Main PID: 88380 (cockpit-tls)
      Tasks: 1 (limit: 11409)
     Memory: 684.0K
        CPU: 14ms
     CGroup: /system.slice/cockpit.service
             └─88380 /usr/libexec/cockpit-tls

Next, you need to configure your firewall to allow access to Cockpit.

3. Firewall Rules For Cockpit on AlmaLinux 8

Note: In some cases, Cockpit firewall rules are enabled by default during the AlmaLinux 8 installation. If you encounter the following message, you can proceed to the next step:

Warning: ALREADY_ENABLED: cockpit

Cockpit listens on port 9090 by default. Open this port in your firewall to allow access to the Cockpit web interface:

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

Apply the new firewall rules by reloading the firewall:

sudo firewall-cmd --reload

4. Access Cockpit Admin Dashboard

With Cockpit installed and the firewall configured, you can access the web interface by navigating to your server’s IP address followed by port 9090 in your web browser:

http://server-ip-address:9090

You’ll be presented with the Cockpit login screen. Enter your sudo username or root username and password to log in and access the dashboard.

Cockpit login screen

Upon successful login, you’ll be greeted by the Cockpit dashboard. The main navigation options are located on the left-hand side, allowing you to add additional hosts (if they have SSH connections), view logs, configure network settings and containers, restart or shut down the server, manage services, and much more.

Cockpit dashboard on AlmaLinux 8

A key feature of Cockpit is the integrated terminal, accessible directly within the web UI. At the bottom of the page, click Terminal.

This provides you with a fully functional terminal, blending the power of the command line with the convenience of a web-based GUI.

Conclusion

You have now successfully learned how to Set up Cockpit on AlmaLinux 8. Cockpit empowers you to perform various administrative tasks, including managing users, starting containers, administering storage, configuring network settings, and inspecting logs, all through a user-friendly web interface.

Hope you find it useful! You might also be interested in the following articles:

Cockpit Installation on Debian 12

Install OpenNMS on Debian 12

Prometheus Server Setup on AlmaLinux 9

Configure OpenNMS on Centos 7

Nagios Monitoring on Ubuntu 22.04

Netdata Setup on AlmaLinux 9

Install Ntopng on AlmaLinux 9

Install Nagios Monitoring Tool on Debian 11

Alternative Solutions for Server Administration on AlmaLinux 8

While Cockpit offers a streamlined web-based interface, alternative methods exist for server administration on AlmaLinux 8. Here are two such options:

1. Webmin:

Webmin is another popular web-based system administration tool for Unix-like systems. Like Cockpit, it allows you to manage various aspects of your server through a web browser. However, Webmin offers a broader range of features and modules compared to Cockpit, making it suitable for more complex administrative tasks.

  • Explanation: Webmin provides a more extensive set of modules for managing services like Apache, MySQL, and Postfix, alongside system configuration, file management, and user administration. It offers a highly customizable interface, allowing you to tailor it to your specific needs.

  • Installation:

    First, you’ll need to add the Webmin repository:

    sudo tee /etc/yum.repos.d/webmin.repo <<EOF
    [Webmin]
    name=Webmin Distribution Neutral
    #baseurl=https://download.webmin.com/download/yum
    mirrorlist=https://download.webmin.com/download/yum/mirrorlist
    enabled=1
    EOF

    Then, install Webmin:

    sudo dnf update
    sudo dnf install webmin -y

    Finally, access Webmin through your browser at https://server-ip-address:10000. You may need to open port 10000 in your firewall, similar to how you configured it for Cockpit.

2. Command-Line Interface (CLI) with SSH and Command-Line Tools:

The traditional approach to server administration involves directly interacting with the server via the command-line interface (CLI) using SSH (Secure Shell). This method offers maximum control and flexibility but requires a deeper understanding of Linux commands and system administration principles.

  • Explanation: Using SSH, you can securely connect to your AlmaLinux 8 server from a remote machine. From there, you can use command-line tools like systemctl, firewall-cmd, dnf, useradd, usermod, and others to manage services, configure the firewall, install software, and administer user accounts.

  • Example:

    To restart the Apache web server using the CLI:

    ssh username@server-ip-address
    sudo systemctl restart httpd

    To create a new user:

    ssh username@server-ip-address
    sudo useradd newuser
    sudo passwd newuser

    While the CLI offers unparalleled control, it requires a steeper learning curve and can be more time-consuming for certain tasks compared to web-based interfaces. However, for experienced system administrators, it remains a powerful and efficient method for server management.

These alternative solutions offer different approaches to server administration, catering to varying levels of expertise and specific needs. Cockpit provides a user-friendly starting point, while Webmin offers more extensive features, and the CLI provides maximum control and flexibility. The best choice depends on your individual requirements and comfort level.

Leave a Reply

Your email address will not be published. Required fields are marked *