UbuntuUbuntu Based

How To Install Cockpit on Ubuntu 24.04 LTS

Install Cockpit on Ubuntu 24.04

Cockpit is a powerful and user-friendly web-based server management tool that simplifies the process of administering Linux servers. It provides an intuitive interface for monitoring system performance, managing services, configuring network settings, and much more. Ubuntu 24.04 LTS, the latest long-term support release of the popular Linux distribution, is fully compatible with Cockpit, making it an ideal choice for server administrators. In this article, we will guide you through the step-by-step process of installing Cockpit on Ubuntu 24.04 LTS and explore its key features to help you efficiently manage your servers.

What is Cockpit?

Cockpit is an open-source web-based server management tool that allows administrators to easily monitor and control their Linux servers through a web browser. It provides a comprehensive set of features, including real-time system performance monitoring, service management, network configuration, storage administration, and even container management with the Podman extension. Cockpit’s intuitive web interface eliminates the need for complex command-line tools, making server management accessible to administrators of all skill levels.

Prerequisites

Before installing Cockpit on your Ubuntu 24.04 LTS server, ensure that you meet the following requirements:

  • A server running Ubuntu 24.04 LTS
  • A user account with sudo privileges
  • A stable internet connection for downloading packages

Updating the System

To ensure a smooth installation process and maintain the security of your server, it’s crucial to update the system packages to their latest versions. Open a terminal and run the following commands:

sudo apt update
sudo apt upgrade

The apt update command refreshes the package lists, while apt upgrade installs the available updates.

Installing Cockpit

With the system updated, you can now proceed with installing Cockpit. Ubuntu 24.04 LTS includes Cockpit in its default repositories, making the installation process straightforward. To install Cockpit, run the following command:

sudo apt install cockpit

The package manager will resolve dependencies and prompt you to confirm the installation. Press Y and then Enter to proceed. The installation process will download and configure the necessary packages for Cockpit.

Once the installation is complete, you can verify that Cockpit is installed by running:

cockpit --version

This command will display the installed version of Cockpit.

Enabling and Starting Cockpit Service

After installing Cockpit, you need to enable and start the Cockpit service to access its web interface. Run the following command to enable and start the Cockpit service:

sudo systemctl enable --now cockpit.socket

This command enables the Cockpit socket to start automatically at system boot and immediately starts the service.

To verify that the Cockpit service is running, use the following command:

sudo systemctl status cockpit.socket

If the service is active and running, you will see output similar to:

● cockpit.socket - Cockpit Web Service Socket
     Loaded: loaded (/lib/systemd/system/cockpit.socket; enabled; vendor preset: enabled)
     Active: active (listening) since Fri 2024-09-13 10:00:00 UTC; 5min ago
   Triggers: ● cockpit.service
     Listen: 0.0.0.0:9090 (Stream)

Accessing the Cockpit Web Interface

With Cockpit installed and the service running, you can now access its web interface. Open a web browser and enter the following URL:

https://<your-server-ip>:9090

Replace <your-server-ip> with the IP address or hostname of your Ubuntu 24.04 LTS server.

Install Cockpit on Ubuntu 24.04

Since Cockpit uses a self-signed SSL certificate by default, your browser may display a security warning. It is safe to proceed by adding an exception or accepting the risk, as the communication between your browser and the server is still encrypted.

Once you access the Cockpit web interface, you will be prompted to log in using your server’s user credentials. Enter your username and password to authenticate and access the Cockpit dashboard.

Configuring Firewall for Cockpit

To securely access Cockpit from remote systems, you need to configure your server’s firewall to allow incoming traffic on port 9090. Ubuntu 24.04 LTS uses the Uncomplicated Firewall (UFW) by default. To open port 9090 for Cockpit, run the following command:

sudo ufw allow 9090

This command adds a firewall rule to allow incoming traffic on port 9090. If you have a more complex network setup or use a different firewall solution, adjust the firewall configuration accordingly.

Exploring Cockpit Features

Cockpit offers a wide range of features for managing your Ubuntu 24.04 LTS server. Let’s explore some of the key functionalities:

System Monitoring

The Cockpit dashboard provides an overview of your server’s system performance. You can monitor CPU usage, memory consumption, disk utilization, and network activity in real-time. This information helps you identify performance bottlenecks and optimize resource allocation.

Service Management

Cockpit allows you to manage system services with ease. You can start, stop, restart, and enable/disable services directly from the web interface. Additionally, you can view service logs to troubleshoot issues and monitor service behavior.

Network Configuration

With Cockpit, you can configure network settings, such as IP addresses, DNS servers, and network interfaces. It provides an intuitive interface for managing network connections, making it simple to set up and troubleshoot network-related issues.

Storage Management

Cockpit offers a comprehensive storage management solution. You can view disk partitions, manage LVM volumes, and monitor storage performance. It also supports creating and managing RAID arrays, making it easier to ensure data redundancy and integrity.

Container Management

If you use containers on your Ubuntu 24.04 LTS server, Cockpit’s Podman extension provides a convenient way to manage them. You can view container images, start and stop containers, and monitor container resource usage directly from the Cockpit interface.

Cockpit’s functionality can be further extended with additional modules. You can install modules for specific tasks, such as managing virtual machines, monitoring system logs, or configuring SELinux. The flexibility and extensibility of Cockpit make it a powerful tool for server administration.

Security Considerations

Cockpit takes security seriously and implements several measures to protect your server. It uses HTTPS by default to encrypt communication between the web browser and the server. Additionally, Cockpit integrates with the server’s user authentication system, ensuring that only authorized users can access the web interface.

To further enhance security, consider the following best practices:

  • Use strong and unique passwords for user accounts
  • Regularly update Cockpit and its dependencies
  • Restrict access to the Cockpit web interface using firewall rules
  • Enable two-factor authentication for added security

Troubleshooting Common Issues

If you encounter any issues while installing or using Cockpit on Ubuntu 24.04 LTS, here are a few troubleshooting tips:

  • Ensure that the Cockpit service is running using sudo systemctl status cockpit.socket
  • Check the firewall configuration to ensure that port 9090 is open
  • Verify that you are using the correct URL and port to access the Cockpit web interface
  • Consult the Cockpit documentation and community forums for specific error messages or issues

Congratulations! You have successfully installed Cockpit. Thanks for using this tutorial for installing the Cockpit management servers on Ubuntu 24.04 LTS system. For additional help or useful information, we recommend you check the official Cockpit website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button