Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install cockpit under Linux

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article is about how to install cockpit under Linux. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Cockpit is a management tool of linux system, which provides a web management page, which can easily complete a series of management work by clicking the mouse, which is very suitable for operation and maintenance.

1. Install Cockpit

First, we need to install Cockpit on our linux-based server, and cockpit installers are available in the official repositories of most distributions. In this blog post, we will install Cockpit in Fedora 22, CentOS 7, Arch Linux, and RHEL 7 through their official software repositories.

CentOS / RHEL

Cockpit is available in the official libraries of CentOS and RHEL, and we only need to use yum Manager to install it. You only need to run the following command with sudo/root privileges to install it.

# yum install cockpit how to install server management software on Linux Cockpit how to install server management software Cockpit on Linux

Fedora 22/21

Like CentOS, Fedora's official software library has Cockpit available by default, and we only need to use the dnf package manager to install Cockpit.

# dnf install cockpit how to install server management software on Linux Cockpit how to install server management software Cockpit on Linux

Arch Linux

Currently, there is no Cockpit available in the official Arch Linux software library, but the Arch user library (Arch User Repository,AUR) is available, and you can install it simply by running the following yaourt command.

# yaourt cockpit

How to install server management software Cockpit on Linux how to install server management software Cockpit2 on Linux. Start and enable Cockpit

After successfully installing Cockpit, we need to start the Cockpit service with the service / daemon manager. By 2015, although some Linux distributions were still running SysVinit management daemons, most Linux distributions used Systemd,Cockpit to use systemd to perform almost everything from running daemons to services. Therefore, we can only install Cockpit in the latest linux distribution running Systemd, and to start Cockpit and let it start automatically every time the system is rebooted, we need to run the following command on the terminal or console.

# systemctl start cockpit# systemctl enable cockpit.socketCreated symlink from / etc/systemd/system/sockets.target.wants/cockpit.socket to / usr/lib/systemd/system/cockpit.socket.3. Allow through the firewall

After starting Cockpit and enabling it to start automatically every time the system is rebooted, we are now going to configure it with a firewall. Since there is a firewall program running on our server, we need to allow it to access Cockpit from outside the server through certain ports.

Firewalld

# firewall-cmd-add-service=cockpit-permanentsuccess# firewall-cmd-reloadsuccess

How to install server management software Cockpit on Linux how to install server management software Cockpit on Linux

Iptables

# iptables-An INPUT-p tcp-m tcp-- dport 80-j ACCEPT# service iptables save4. Access the Cockpit Web interface

Next, we are finally going to access the Cockpit web interface through a Web browser. According to the configuration, we only need to open https://ip-address:9090 or https://server.domain.com:9090 with a browser. In our blog post, we open https://128.199.114.17:9090 with a browser, as shown in the following figure:

Access Cockpit Web services through SSL

A SSL authentication warning appears because we are using a self-signed authentication. We just need to ignore this warning and go to the login page. In chrome/chromium, we need to click Show Advanced and then click Proceed to 128.199.114.17 (unsafe).

Cockpit login interface

Now, to get into the dashboard, we need to enter detailed login information. Here, the user name and password are the same as the one used to log in to our linux server, and when we enter the login information and click the Log In button, we will enter the Cockpit dashboard.

Here we can see all the menus and visualization results of CPU, disk, network, and storage usage.

Service

To manage the service, we need to click the Services button in the menu on the right side of the web page. Then, we will see that services are divided into five categories, goals, system services, sockets, timers, and paths.

Docker container

We can even use Cockpit to manage docker containers. It is very easy to monitor and manage Docker containers with Cockpit. Since we do not have docker installed and running on our server, we need to click Start Docker.

Cockpit will automatically install and run Docker on our server. After startup, we will see the screenshot below, and then we can manage Docker images and containers as needed.

Journal Log Viewer

Cockpit has a log viewer that divides errors, warnings, and notes into different tabs, and we also have an All tab where you can see all the log information.

The network

In the network section, we can see two graphs that visualize the sending and receiving speed. We can see that there is a list of available network cards, as well as options for Add Bond, Bridge, and VLAN. If we need to configure a network card, we only need to click the name of the network card. Below, we can see the Journal log information of the network.

Storage

Now, you can easily check the read and write speed of the hard disk with Cockpit. We can view the stored Journal logs for troubleshooting and repair. There is also a visualization of the used space on the page. We can even uninstall, format, or delete a partition of a hard disk. It also has functions like creating RAID devices, volume groups, and so on.

User management

Through the Cockpit Web interface, we can easily create new users, and the accounts created here will be applied to the system user accounts, which we can use to change passwords, specify roles, and delete user accounts.

Real-time terminal

Cockpit also has a great feature, yes, we can execute commands and use the real-time terminal provided by the Cockpit interface to perform tasks, which allows us to switch freely between the Web interface and the terminal according to our needs.

Thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 233

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report