Site icon CentLinux

Install Cockpit for Efficient Linux Server Management

Share on Social Media

Learn how to install Cockpit, a powerful web GUI, for streamlined and efficient Linux server management. Simplify your server administration with this step-by-step guide. #centlinux #linux #cockpit

What is Cockpit?

Cockpit is a web-based graphical user interface (GUI) that allows users to manage Linux servers easily and effectively. It provides an intuitive dashboard where administrators can perform various tasks without needing deep command-line knowledge. Key features of Cockpit include:

  1. Real-Time Monitoring: View real-time statistics and performance data for CPU, memory, disk usage, and network activity.
  2. System Logs: Access and manage system logs to diagnose issues and track system events.
  3. User Management: Create, modify, and delete user accounts, and manage user permissions.
  4. Service Management: Start, stop, and monitor system services and manage systemd units.
  5. Software Updates: Install and update software packages, ensuring your server is up to date.
  6. Storage Management: Manage disks and file systems, including creating and mounting new storage volumes.
  7. Networking: Configure network settings, manage interfaces, and troubleshoot network issues.
  8. Container Management: Administer containerized applications using Docker or Podman.

Cockpit is designed to be lightweight and efficient, making it suitable for both experienced administrators and those new to server management. It can be installed on various Linux distributions, including Fedora, Red Hat Enterprise Linux (RHEL), CentOS, Ubuntu, and Debian.

Read Also: How to install Linux Dash on Rocky Linux 8

Install Cockpit Web GUI for Efficient Linux Server Management

Cockpit Alternatives

There are several alternatives to Cockpit for managing Linux servers through a web-based GUI. Here are some of the most popular ones:

Webmin:

phpMyAdmin:

Ajenti:

ISPConfig:

cPanel/WHM:

Plesk:

Zentyal:

OpenMediaVault:

These alternatives offer different features and capabilities, catering to various server management needs and preferences. Depending on your specific requirements, one of these tools might be a better fit for your environment than Cockpit.

Recommended Training: The Linux Command Line Bootcamp: Beginner To Power User from Colt Steele

Environment Specification

We are utilizing a minimal installation of Rocky Linux 8 as the base virtual machine for this guide. This lightweight setup ensures a streamlined environment with only the essential components, providing an optimal platform for building and configuring specific use cases. Below are the specifications of our virtual machine setup, which serve as a foundation for the tasks demonstrated:

This minimal virtual machine configuration offers the perfect balance between resource efficiency and functionality, allowing us to focus solely on the task at hand while minimizing overhead. This setup is ideal for following along with tutorials, experimenting with new configurations, or running lightweight server workloads.

Update your Linux Server

To begin, connect to your Rocky Linux server (rockylinux-01.centlinux.com) as the root user using an SSH client of your choice, such as PuTTY, OpenSSH, or any terminal application. Establishing a secure SSH connection ensures that you can manage the server remotely while maintaining strong encryption for your session.

Once connected to your server, it is important to refresh the cache of your enabled yum repositories. This step ensures that the package manager has the most up-to-date metadata, which is critical for seamless installation and updates of software packages. Execute the following command at the Linux terminal to build and update the yum repository cache.

Refreshing the repository cache is a routine yet essential task that helps prevent issues related to outdated or missing package information. It prepares your system to efficiently retrieve and install software components during the setup or maintenance process.

# dnf makecache

As a best practice, update software packages in your Linux operating system before installing Cockpit web interface.

# dnf update -y
Last metadata expiration check: 0:00:49 ago on Mon 21 Feb 2022 07:39:22 PM PKT.
Dependencies resolved.
Nothing to do.
Complete!

Our Linux server is fully updated with the latest available packages and system updates, ensuring optimal performance and compatibility for the tasks outlined in this guide. However, the results of these updates may vary depending on your specific operating system and its current state. If your server is not updated, it’s highly recommended to perform a full system update before proceeding to avoid potential compatibility issues during the installation process.

To provide clarity and reference for this guide, it is essential to verify the current Linux Kernel version and the operating system details being used. This helps ensure that your setup aligns with the steps outlined here and confirms the compatibility of the software and commands. Checking these versions not only validates your system’s readiness but also assists in troubleshooting and replicating configurations across multiple systems, if necessary.

# uname -r
4.18.0-348.12.2.el8_5.x86_64

# cat /etc/os-release
NAME="Rocky Linux"
VERSION="8.5 (Green Obsidian)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.5"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Rocky Linux 8.5 (Green Obsidian)"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:rocky:rocky:8:GA"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
ROCKY_SUPPORT_PRODUCT="Rocky Linux"
ROCKY_SUPPORT_PRODUCT_VERSION="8"

Install Cockpit on Rocky Linux 8

In Rocky Linux 8, Cockpit software is available in standard yum repositories. Therefore, you can easily install it by executing a dnf command.

# dnf install -y cockpit

After successful installation of web GUI management software, enable and start Cockpit service.

# systemctl enable --now cockpit.socket
Created symlink /etc/systemd/system/sockets.target.wants/cockpit.socket → /usr/lib/systemd/system/cockpit.socket.

Check the status of Cockpit service.

# systemctl status cockpit.socket
● cockpit.socket - Cockpit Web Service Socket
   Loaded: loaded (/usr/lib/systemd/system/cockpit.socket; enabled; vendor pres>
   Active: active (listening) since Mon 2022-02-21 19:48:06 PKT; 34s ago
     Docs: man:cockpit-ws(8)
   Listen: [::]:9090 (Stream)
  Process: 2150 ExecStartPost=/bin/ln -snf active.motd /run/cockpit/motd (code=>
  Process: 2143 ExecStartPost=/usr/share/cockpit/motd/update-motd  localhost (c>
    Tasks: 0 (limit: 5808)
   Memory: 4.0K
   CGroup: /system.slice/cockpit.socket

Feb 21 19:48:06 rockylinux-01.centlinux.com systemd[1]: Starting Cockpit Web Se>
Feb 21 19:48:06 rockylinux-01.centlinux.com systemd[1]: Listening on Cockpit We>

Configure Linux Firewall

Cockpit operates on the default service port 9090/tcp, which facilitates web-based server management. To ensure uninterrupted access to Cockpit’s web interface, you may need to configure your Linux firewall settings appropriately. This involves either enabling the specific port 9090/tcp or allowing the predefined Cockpit service in the firewall rules.

Properly configuring the firewall is crucial, especially if your server is running in a secure or production environment where strict firewall rules are in place. By enabling this port or service, you ensure that the Cockpit interface can be accessed over the network, allowing administrators to monitor, manage, and troubleshoot the server efficiently through a browser-based interface. This step is vital to maintain seamless connectivity to the Cockpit dashboard while adhering to your server’s security policies.

# firewall-cmd --permanent --add-service=cockpit
Warning: ALREADY_ENABLED: cockpit
success

You can see that, the cockpit service is already enabled by the installer.

Accessing Cockpit Web GUI

To access the Cockpit web interface, open the URL https://rockylinux-01.centlinux.com:9090 in your preferred web browser. When you attempt to load the page, you may encounter a privacy warning or a security alert. This occurs because the Cockpit software uses self-signed SSL/TLS certificates by default, which are not verified by a trusted Certificate Authority (CA).

While this warning might appear alarming, it is safe to proceed if you trust the server and know it is under your control. To continue, simply ignore the warning and add a security exception within your browser. This will allow you to bypass the SSL warning and securely access the Cockpit interface.

Once added, you can log in to the Cockpit dashboard to manage and monitor your Linux server with ease. For enhanced security, you may consider replacing the self-signed certificate with a trusted SSL/TLS certificate issued by a reliable CA in production environments.

Cockpit Login

Login as root user.

Cockpit Dashboard

You have successfully login to Cockpit Web GUI Management Software.

Video: Install Cockpit on Rocky Linux 9

Read also: Complete Spacewalk installation on CentOS 7

Final Thoughts

In conclusion, installing Cockpit provides an efficient and user-friendly interface for managing Linux servers. Its intuitive dashboard simplifies complex administrative tasks, from monitoring system performance to managing users, services, and storage.

Cockpit’s lightweight design and web-based accessibility make it an ideal solution for both seasoned administrators and newcomers seeking to streamline server management. By integrating Cockpit into your Linux environment, you can enhance productivity, improve oversight, and maintain a secure and well-optimized server infrastructure with ease.

Whether you need cloud optimization, server management, or automation, I provide comprehensive AWS and Linux services. Hire me on Fiverr to elevate your systems.

Exit mobile version