{"id":3994,"date":"2021-02-03T07:19:23","date_gmt":"2021-02-03T07:19:23","guid":{"rendered":"https:\/\/linuxways.net\/?p=3994"},"modified":"2021-02-03T07:19:26","modified_gmt":"2021-02-03T07:19:26","slug":"how-to-install-cockpit-on-ubuntu-20-04","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/ubuntu\/how-to-install-cockpit-on-ubuntu-20-04\/","title":{"rendered":"How to Install Cockpit on Ubuntu 20.04"},"content":{"rendered":"<p>Cockpit is an open-source browser-based utility that allows administering and configuring local and remote multiple servers. It allows to graphically administer several Linux systems at a time. Using its user-friendly browser-based console, you can easily monitor system resources, install softwares, manage users, perform system and security updates, reboot, or power off systems. It provides a dashboard with graphs that shows the status and statistics of several systems at a time. Cockpit is available for many Linux distributions.<\/p>\n<p>With Cockpit, you can:<\/p>\n<ul>\n<li>Monitor various performance metrics with graphs (CPU, memory, disk IO, network traffics)<\/li>\n<li>Inspect system logs<\/li>\n<li>Configure and manage storage (view statistics and logs, create RAID, LVM)<\/li>\n<li>Monitor and manage networking activity (view sent and received traffic statistics, add VLAN, bonds, bridges )<\/li>\n<li>View and manage user accounts<\/li>\n<li>View and manage system services<\/li>\n<li>View, and manage add-ons<\/li>\n<li>Check for and install available updates<\/li>\n<li>Use a fully functional in-browser terminal to have more granular control over a system.<\/li>\n<\/ul>\n<p>In this guide, we will be going to explain how to install Cockpit on the Ubuntu system. We will need to install the Cockpit package on both the monitoring server (primary server) and those servers (secondary servers) which you want to monitor using Cockpit. For demonstration purposes, we will be using two Ubuntu machines: one for the primary server and the other for the secondary server.<\/p>\n<p>Note: The installation method explained here has been tested on <strong>Ubuntu 20.04 LTS<\/strong> system. You should be a root sudo user if you need to install\/remove a package on the Ubuntu system.<\/p>\n<h2>Step 1: Install Cockpit on Ubuntu<\/h2>\n<p>Cockpit is available for installation in the default Ubuntu repositories. You can simply install it through the apt package management utility. Open the Terminal in Ubuntu using the <strong>Ctrl+Alt+T<\/strong> shortcut. Then in the Terminal, execute the below command to install Cockpit:<\/p>\n<pre>$ sudo apt-get install cockpit<\/pre>\n<p>Enter sudo password. Now it will prompt you with <strong>Y\/n<\/strong> choice. Press <strong>Y<\/strong> to proceed with the installation of Cockpit.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"880\" height=\"533\" class=\"wp-image-3995\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/install-cockpit.png\" alt=\"install cockpit\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/install-cockpit.png 880w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/install-cockpit-300x182.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/install-cockpit-768x465.png 768w\" sizes=\"auto, (max-width: 880px) 100vw, 880px\" \/><\/p>\n<p>Cockpit uses a systemd socket which automatically gets enabled and started after the installation of Cockpit, However, if it does not start automatically, you can enable and start it by executing the following command in Terminal:<\/p>\n<pre>$ sudo systemctl enable --now cockpit.socket<\/pre>\n<pre>$ sudo systemctl start cockpit.socket<\/pre>\n<h2>Step 2: Configure Firewall<\/h2>\n<p>Cockpit is a browser-based interface that can be accessed on TCP port 9090. To allow external connections to port 9090, you will need to allow port 9090 in the firewall. Execute the below command to do so:<\/p>\n<pre>$ sudo ufw allow 9090<\/pre>\n<h2>Step 3: Access Cockpit Web Interface<\/h2>\n<p>In order to access Cockpit, open the following address in your browser:<\/p>\n<pre><a href=\"http:\/\/localhost:9090\">http:\/\/localhost:9090<\/a><\/pre>\n<p>or to access it from another system, use the hostname or IP address of the system on which Cockpit is installed:<\/p>\n<pre><a href=\"http:\/\/hostname-or-ip-address:9090\">http:\/\/hostname-or-ip-address:9090<\/a><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"898\" height=\"644\" class=\"wp-image-3996\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/cockpit-web-interface.png\" alt=\"cockpit web interface\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/cockpit-web-interface.png 898w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/cockpit-web-interface-300x215.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/cockpit-web-interface-768x551.png 768w\" sizes=\"auto, (max-width: 898px) 100vw, 898px\" \/><\/p>\n<p>Enter your <strong>user name<\/strong> and <strong>password<\/strong> to login to Cockpit. You can use the same user credentials you use to directly log into the server. Also, check the box <strong>Reuse My Password for Remote Connections<\/strong>.<\/p>\n<p>Once you are logged in to the Cockpit web interface, you will see one server in the Dashboard. This server is the one on which Cockpit is installed.<\/p>\n<h3>Step 4: Add Servers for Monitoring<\/h3>\n<p>Now you can add secondary servers for monitoring in Cockpit. The servers you want to monitor should have:<\/p>\n<ul>\n<li>Cockpit installed and running. If the secondary server is Ubuntu, you can install Cockpit in the same way as described above. For other distributions, follow instructions in the Cockpit <a href=\"https:\/\/cockpit-project.org\/running.html\">official guide<\/a>.<\/li>\n<li>An <a href=\"https:\/\/linuxways.net\/de\/ubuntu\/how-to-ssh-ubuntu-server-20-04-lts\/\">SSH server<\/a> available and running on port 22 as Cockpit uses SSH to log in to secondary servers.<\/li>\n<li>Port 22 allowed in the firewall<\/li>\n<\/ul>\n<p>To add the secondary server to Cockpit, open the <strong>Dashboard<\/strong> from the left pane. Then click the <strong>plus<\/strong> <strong>(+)<\/strong> icon as shown here in the following screenshot.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"999\" height=\"526\" class=\"wp-image-3997\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/add-servers-in-cockpit.png\" alt=\"add servers in cockpit\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/add-servers-in-cockpit.png 999w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/add-servers-in-cockpit-300x158.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/add-servers-in-cockpit-768x404.png 768w\" sizes=\"auto, (max-width: 999px) 100vw, 999px\" \/><\/p>\n<p>The following dialog \u201c<strong>Add Machine to Dashboard<\/strong>&#8221; will appear. Type the <a href=\"https:\/\/linuxways.net\/de\/ubuntu\/how-to-find-your-ip-address-in-ubuntu-20-04-lts\/\">IP address<\/a> or the hostname of the secondary server and hit <strong>Add<\/strong> button.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"565\" height=\"198\" class=\"wp-image-3998\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-7.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-7.png 565w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-7-300x105.png 300w\" sizes=\"auto, (max-width: 565px) 100vw, 565px\" \/><\/p>\n<p>When the following dialog shows up, click <strong>Connect<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"564\" height=\"201\" class=\"wp-image-3999\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-8.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-8.png 564w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-8-300x107.png 300w\" sizes=\"auto, (max-width: 564px) 100vw, 564px\" \/><\/p>\n<p>Type the <strong>User name<\/strong> and <strong>password<\/strong> of the secondary server and then click <strong>Log In<\/strong>. Remember; the logged-in user will have the same permissions as the user would have if it logs in to the server through SSH.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"563\" height=\"271\" class=\"wp-image-4000\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-9.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-9.png 563w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-9-300x144.png 300w\" sizes=\"auto, (max-width: 563px) 100vw, 563px\" \/><\/p>\n<p>Once it verifies the credentials, the system will be added to the servers list in the <strong>Dashboard<\/strong>. Similarly, add all the servers in your network for monitoring.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1144\" height=\"571\" class=\"wp-image-4001\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/cockpit-dashboard.png\" alt=\"cockpit dashboard\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/cockpit-dashboard.png 1144w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/cockpit-dashboard-300x150.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/cockpit-dashboard-1024x511.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/cockpit-dashboard-768x383.png 768w\" sizes=\"auto, (max-width: 1144px) 100vw, 1144px\" \/><\/p>\n<p>Now you can configure and control all your Linux machines from one single interface.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1142\" height=\"569\" class=\"wp-image-4002\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-10.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-10.png 1142w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-10-300x149.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-10-1024x510.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/02\/word-image-10-768x383.png 768w\" sizes=\"auto, (max-width: 1142px) 100vw, 1142px\" \/><\/p>\n<h2>Uninstalling Cockpit<\/h2>\n<p>If you no longer require Cockpit on your Ubuntu system, you can easily <a href=\"https:\/\/linuxways.net\/de\/ubuntu\/how-to-uninstall-programs-from-ubuntu-20-04-lts\/\">uninstall<\/a> it using this command in Terminal:<\/p>\n<pre>$ sudo apt-get install cockpit<\/pre>\n<p>Enter sudo password. Now it will prompt you with <strong>Y\/n<\/strong> choice. Press Y if you want to remove Cockpit from your system.<\/p>\n<p>When you install Cockpit, some dependencies are automatically installed. If you want to uninstall them too, the command is as follows:<\/p>\n<pre>$ sudo apt autoremove<\/pre>\n<p>In this guide, we have covered how to install Cockpit on Ubuntu 20.04 system. Now from a single interface, you can control and manage several systems tasks across the network and save a lot of time.<\/p>","protected":false},"excerpt":{"rendered":"<p>Cockpit is an open-source browser-based utility that allows administering and configuring local and remote multiple servers. It allows to graphically administer several Linux systems at a time. Using&hellip;<\/p>","protected":false},"author":4,"featured_media":4003,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[170,100],"class_list":["post-3994","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu","tag-cockpit","tag-ubuntu-20-04"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/3994","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=3994"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/3994\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/4003"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=3994"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=3994"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=3994"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}