![]() |
Cockpit is a free, open-source, and easy-to-use yet powerful remote manager for Linux servers that allows system administrators to quickly monitor or manage system resources, logs, storage, network, background services, and much more from one central dashboard. You can also access the Linux shell of different Linux servers from the Cockpit web interface, and manage other users and services on those servers. Any errors that appear will be directly shown in the Cockpit logs. Ansible, Docker, Kubernetes, and other DevOps tools are compatible with Cockpit. The best part about Cockpit is that it doesn’t consume resources unnecessarily, as it only runs on demand, thanks to system socket activation. In this guide, you will learn more about its features, how to install Cockpit on major Linux distributions, and how to use it to manage your different Linux servers. Features of the CockpitThe following is a list of features or tasks you can perform with Cockpit.
How to Install Cockpit in LinuxMost Linux distributions now include the Cockpit package, and you can quickly install and start Cockpit services using built-in commands. However, when following the installation steps, consider using a POSIX-compatible shell like Bash. If you are currently using different shells, then switch to Bash using the “bash -i” command. Install Cockpit on Debian and UbuntuThe Cockpit is included in Debian, Ubuntu, or Linux Mint official repositories, and you can install it using the following commands: $ sudo apt update
$ sudo apt install cockpit
$ sudo ufw allow 9090
$ sudo ufw allow 80
Install Cockpit on FedoraThe Cockpit comes pre-installed with Fedora Server, and desktop users or those using different variants of Fedora can run the following commands to install it: $ sudo dnf install cockpit
$ sudo systemctl enable --now cockpit.socket
$ sudo firewall-cmd --add-service=cockpit
$ sudo firewall-cmd --add-service=cockpit --permanent
Install Cockpit on Red HatThe Cockpit is now available in Red Hat Enterprise Linux starting with version 7, and users can install it using these commands. $ sudo yum install cockpit
$ sudo systemctl enable --now cockpit.socket
$ sudo firewall-cmd --add-service=cockpit
$ sudo firewall-cmd --add-service=cockpit --permanent
Install Cockpit on Arch LinuxArch Linux users can install Cockpit from the Arch User Repository with the following commands: $ sudo pacman -S cockpit
$ sudo systemctl enable --now cockpit.socket
Install Cockpit on Clear LinuxClear Linux OS users can install Cockpit using the “swupd” command-line program: $ sudo swupd bundle-add sysadmin-remote
$ sudo systemctl enable --now cockpit.socket
Install Cockpit on OpenSUSE Tumbleweed and LeapThe Cockpit is available in both OpenSUSE Tumbleweed and Leap starting with version 15.6, and users can install it using the following commands: $ sudo zypper in cockpit
$ sudo systemctl enable --now cockpit.socket
$ sudo firewall-cmd --permanent --zone=public --add-service=cockpit
$ sudo firewall-cmd --reload
How to Use Cockpit in LinuxStep 1: Once the installation is complete and the Cockpit service starts, the IP address or hostname of the Linux server hosting it will expose port 9090 to the internet, enabling access to the Cockpit dashboard. https://ip-address:9090
OR
https://yourdomain.com:9090
Step 2: When you access it for the first time, it will ask you to enter a system username and password to login. ![]() Step 3: Once you successfully log in, you will be redirected to the Overview dashboard, where you can monitor CPU, memory, storage, and network status, as well as check other system and hardware information. If you’ve logged in as the root user, you can proceed; otherwise, if you’ve logged in with a normal user account or a user with sudo access, ensure you click on the “Turn on administrative access” button as indicated below to get admin access. ![]() Cockpit dashboard Step 4: Next, from the left panel, you can switch to the Logs tab, where you can review logs from the last seven days, including emergency, alert, critical, warning, error, and other types. Clicking on a specific log entry allows for further inspection. ![]() Checking logs in Cockpit Step 5: You can navigate to the Services tab to view the pages for Services, Targets, Sockets, Timers, and Paths. ![]() Checking services in Cockpit Step 6: You can further manage the services by starting, stopping, restarting, or checking their path, memory usage, and logs. To perform these actions, simply click on the individual service from the list to redirect to the service page. ![]() Managing services in Cockpit Step 7: To manage users, verify their full name, user ID, the list of groups they belong to, available groups, or check users with sudo privileges, move to the Accounts tab. ![]() Managing users in Cockpit Step 8: To add a new user, click on the “Create new account” button and enter the necessary user information, such as full name, username, home directory, default login shell, and password.
![]() Step 9: Finally, you can navigate to the Terminal tab to access the Linux terminal of the server. ![]() Accessing the Linux shell from Cockpit How to Add More Linux Servers to CockpitTo manage your other Linux servers from a single Cockpit dashboard, you can simply install Cockpit and SSH on all your remote Linux servers using the same method described in this article. Afterward, access the Cockpit dashboard from where you want to manage your other Linux server, click on the dropdown in the left panel next to your username, and select “Add new host“. ![]() Adding new host in Cockpit A prompt will appear asking you to enter the IP address or hostname of the other Linux server (ensure Cockpit and SSH are already installed and running on them), provide the system username, and then click on “Add“. ![]() Adding Linux server to Cockpit Afterward, the new host entry will be added to the left panel, allowing you to switch to your other Linux server’s Cockpit dashboard. ![]() Managing multiple Linux server in Cockpit ConclusionCockpit is a highly useful and user-friendly remote manager that you can install on a single Linux instance and later add additional Linux servers from the Cockpit dashboard for centralized management. This way, you can conveniently and efficiently manage your homelabs or servers running different services like Ansible, Kubernetes, Jellyfin, or Nextcloud through a graphical web interface. How I use Cockpit for my home’s Linux server management-FAQWhat is Cockpit?
How do I manage multiple Linux servers with Cockpit?
Can I manage users with Cockpit?
Is Cockpit resource-intensive?
|
Reffered: https://www.geeksforgeeks.org
Linux Unix |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 17 |