Cockpit – Monitor And Administer Linux Servers Via Web Browser

Cockpit - Monitor And Administer Linux Servers Via Web Browser

Cockpit is free, open source Server administration tool that allows you to easily monitor and administrator single or multiple Linux servers via a web browser. It helps the system admins to do simple administration tasks, such as starting containers, administrating storage, configuring network, inspecting logs and so on. Switching between Terminal and Cockpit is no big deal. You can the manage the system’s services either from the Cockpit, or from the host’s Terminal. Say for example, if you started a service in Terminal, you can stop it from the Cockpit. Similarly, if an error occurs in the terminal, it can be seen in the Cockpit journal interface and vice versa. It is capable of monitoring multiple Linux servers at the same time. All you need to do is just add the systems you wanted to monitor, and Cockpit will look after them.

In this guide, we will be seeing how to install and configure Cockpit on Linux (YUM and DEB based systems).

Cockpit – Monitor And Administer Linux Servers Via Web Browser

Install Cockpit

Cockpit is initially developed from RPM based systems such as RHEL, CentOS, and Fedora. Now, it has been ported to other Linux distributions such as Arch Linux, Debian, and Ubuntu.

On Arch Linux:

Cockpit is available in AUR, so you can install it using Yaourt or Packer.

yaourt -S cockpit

Or,

packer -S cockpit

After installing it, start cockpit service using command:

sudo systemctl enable --now cockpit.socket

On CentOS:

Cockpit is available in the default repositories of CentOS 7. So, you can install it using command:

sudo yum install cockpit

After installing it, start cockpit service using command:

sudo systemctl enable --now cockpit.socket

If you want to access the Cockpit web dashboard, you need to allow Cockpit service through firewall. To do so, run:

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

On Fedora:

Cockpit is available in the Fedora’s default repositories. So, you can install it using command:

sudo dnf install cockpit

After installing it, start cockpit service using command:

sudo systemctl enable --now cockpit.socket

If you want to access the Cockpit web dashboard, you need to allow Cockpit service through firewall. To do so, run:

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

On RHEL:

In RHEL systems, enable extras repository using command:

sudo subscription-manager repos --enable rhel-7-server-extras-rpms

Then, install Cockpit using command:

sudo yum install cockpit

After installing it, start cockpit service using command:

sudo systemctl enable --now cockpit.socket

If you want to access the Cockpit web dashboard, you need to allow Cockpit service through firewall. To do so, run:

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

On Debian:

Cockpit is available in Debian unstable, so you can install it using command:

sudo apt-get install cockpit

For Debian Jessie (8.x), edit /etc/apt/sources.list file:

sudo vi /etc/apt/sources.list

Add the following line:

deb http://repo-cockpitproject.rhcloud.com/debian/ jessie main

Import Cockpit signing key:

sudo apt-key adv --keyserver sks-keyservers.net --recv-keys 0D2A45C3F1BAA57C

Update the software repositories:

sudo apt-get update

And, install Cockpit using command:

sudo apt-get install cockpit

On Ubuntu:

Cockpit is available in Ubuntu 17.04 and devel, so you can install it using command:

sudo apt-get install cockpit

For Ubuntu 16.04 LTS version, you can install it using Cockpit’s PPA:

sudo add-apt-repository ppa:cockpit-project/cockpit
sudo apt-get update
sudo apt-get install cockpit

Access Cockpit’s Dashboard

Once installed, point your web browser to to https://localhost:9090 (or the host name/IP where you installed it). You will be pleased with Cockpit’s login screen.

Use any one of your user’s credentials to login.

This is how my Cockpit’s dashboard looks like.

As you see in the above picture, Cockpit’s System information screen shows your server details, and graphs for CPU, Memory, Disk and network traffic.

 

Logs:

Logs section displays the list of errors, warnings, and other important log details of your cockpit server.

Storage:

This section shows the hard drive details of your system.

Networking:

This is where we configure all basic network settings such as adding Vlan, network bonding, network bridge configuring etc. In this section, we can also see the networking logs, incoming and outgoing traffic of the network interface card and the sending & receiving visual graphs.

Accounts

In this section, you can create new users, delete existing users, change user’s password etc.

Services

This section displays the list of active and inactive services.

 

 

Terminal

Another notable feature of Cockpit web console is it has a built-in Terminal, which allows you to all sort command line operations. You don’t need to SSH to your server or don’t need to install any remote communication tools. We can use the Cockpit Terminal to perform all command line operations as the way we do in the normal Terminal window.

Adding new hosts

Log in to the Cockpit web dashboard.

Note: Please check the option that says “Reuse my password for privileged tasks” under the password field. This allows you to run any administrative actions via Cockpit. If you don’t check this option, you can’t add any remote systems to your cockpit’s dashboard or can’t perform any administrative operations.

Cockpit can manage multiple servers at the same time. Click on the Dashboard button on the top to view the list of servers managed by Cockpit. You will see the all servers under “Servers” tab.

To add a new server, click on the + (plus) sign in the Servers tab.

Enter the IP address of your remote server that you want to monitor and click Add.

Next, click Connect.

Enter your remote system’s username and password.

Congratulations! We have successfully added the our remote system. You will see the newly added systems under Servers tab in Dashboard.

Click on the remote system’s name to view its details.

Likewise, you can add as many systems as you want to monitor and administer via Cockpit. Once you have gained the control over a remote system, you can completely administer it from your local system via cockpit. You can add, delete and manage users, add, remove, configure applications via Cockpit Terminal, reboot or shutdown the remote systems and more.

Cockpit is opt for budding Linux administrators. Cockpit installation and usage is fairly simple and straight forward. If you have network full of remote systems, add all of them to cockpit dashboard and manage them like a pro.

And, that’s all. If you find our guides useful, please share them on your social, professional networks and support OSTechNix. I will be soon here with another useful guide, Until then, stay tuned!

Cheers!

Resource:

Thanks for stopping by!

Help us to help you:

Have a Good day!!