{"id":4376,"date":"2019-10-06T22:24:18","date_gmt":"2019-10-06T19:24:18","guid":{"rendered":"https:\/\/kifarunix.com\/?p=4376"},"modified":"2024-03-12T22:26:10","modified_gmt":"2024-03-12T19:26:10","slug":"how-to-enable-cockpit-on-centos-8","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/how-to-enable-cockpit-on-centos-8\/","title":{"rendered":"How to Enable Cockpit on CentOS 8"},"content":{"rendered":"\n<p><a rel=\"noreferrer noopener\" aria-label=\"Cockpit (opens in a new tab)\" href=\"https:\/\/cockpit-project.org\/\" target=\"_blank\">Cockpit<\/a> is a web accessible interactive admin interface for Linux machines. In this guide, we are going to learn how to enable cockpit on CentOS 8 to enable you administer your CentOS 8 system administration tasks from the browser.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Enabling Cockpit on CentOS 8<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Install Cockpit on CentOS 8<\/h3>\n\n\n\n<p>CentOS 8 comes with Cockpit pre-installed. However, you would simply execute the command below to install it.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dnf install cockpit<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Running Cockpit on CentOS 8<\/h3>\n\n\n\n<p>Cockpit web service is managed by systemd. Hence, it can be started as follows;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl start cockpit.socket<\/code><\/pre>\n\n\n\n<p>To enable it to run on system boot;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl enable cockpit.socket<\/code><\/pre>\n\n\n\n<p>The start and enable commands above can be executed as one command by running;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code><code>systemctl enable --now cockpit.socket<\/code><\/pre>\n\n\n\n<p>To check the status of the Cockpit web service;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl status cockpit.socket<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>\u25cf cockpit.socket - Cockpit Web Service Socket\n   Loaded: loaded (\/usr\/lib\/systemd\/system\/cockpit.socket; enabled; vendor preset: disabled)\n   Active: active (listening) since Sun 2019-10-06 13:57:36 EDT; 1min 39s ago\n     Docs: man:cockpit-ws(8)\n   Listen: [::]:9090 (Stream)\n    Tasks: 0 (limit: 11512)\n   Memory: 392.0K\n   CGroup: \/system.slice\/cockpit.socket\n\nOct 06 13:57:36 localhost.localdomain systemd[1]: Starting Cockpit Web Service Socket.\nOct 06 13:57:36 localhost.localdomain systemd[1]: Listening on Cockpit Web Service Socket.<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Allow Cockpit on Firewall<\/h3>\n\n\n\n<p>Cockpit web service usually listens on TCP port 9090.<\/p>\n\n\n\n<p>To allow remote access to Cockpit, open this port on firewalld.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>firewall-cmd --get-active-zones<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>firewall-cmd --add-port=9090\/tcp --zone=MY_ACTIVE_ZONE --permanent<\/code><\/pre>\n\n\n\n<p>Replace <strong>MY_ACTIVE_ZONE<\/strong> accordingly.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>firewall-cmd --reload<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Accessing CentOS 8 Cockpit from Browser<\/h3>\n\n\n\n<p>By default, Cockpit includes a self-signed SSL\/TLS certificate and can be access via the browser using the address, <strong><code>https:\/\/CentOS-Server-IP:9090<\/code><\/strong>.<\/p>\n\n\n\n<p>By default Cockpit is configured to allow logins using username and password of any local account on the system. If you are logging as non-root user with sudo rights, ensure that you check, <strong><code>Reuse my password for privileged tasks<\/code><\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/10\/cockpit-centos-8-login.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1259\" height=\"542\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/10\/cockpit-centos-8-login.png\" alt=\"How to Enable Cockpit on CentOS 8\" class=\"wp-image-4377\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/10\/cockpit-centos-8-login.png?v=1570387573 1259w, https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/10\/cockpit-centos-8-login-768x331.png?v=1570387573 768w\" sizes=\"(max-width: 1259px) 100vw, 1259px\" \/><\/a><\/figure>\n\n\n\n<p>When logged in, the default dashboard looks like;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1346\" height=\"595\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/10\/cockpit-centos-8-dashboard.png\" alt=\"\" class=\"wp-image-4378\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/10\/cockpit-centos-8-dashboard.png?v=1570387721 1346w, https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/10\/cockpit-centos-8-dashboard-768x339.png?v=1570387721 768w\" sizes=\"(max-width: 1346px) 100vw, 1346px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Running System Administrative Tasks from Cockpit<\/h3>\n\n\n\n<p>To run system administrative tasks from Cockpit, ensure you login as a user with privileged rights.<\/p>\n\n\n\n<p>Take for example, you need to create user account, you can either launch the terminal and execute the user account creation commands or simply click on the <strong>Accounts<\/strong> menu on the left panel and Create New Account. (Be sure to check, <strong>Reuse my password for privileged tasks<\/strong> when logging in).<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/10\/new-account-cockpit.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1362\" height=\"405\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/10\/new-account-cockpit.png\" alt=\"Cockpit on CentOS 8 user creation\" class=\"wp-image-4379\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/10\/new-account-cockpit.png?v=1570389203 1362w, https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/10\/new-account-cockpit-768x228.png?v=1570389203 768w\" sizes=\"(max-width: 1362px) 100vw, 1362px\" \/><\/a><\/figure>\n\n\n\n<p>Enter the new user details and click create to create it.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/10\/new-account-cockpit-2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1358\" height=\"473\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/10\/new-account-cockpit-2.png\" alt=\"creating user on Cockpit CentOS 8 \" class=\"wp-image-4380\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/10\/new-account-cockpit-2.png?v=1570389246 1358w, https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/10\/new-account-cockpit-2-768x267.png?v=1570389246 768w\" sizes=\"(max-width: 1358px) 100vw, 1358px\" \/><\/a><\/figure>\n\n\n\n<p>You can later view user details on the same accounts menu.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1356\" height=\"586\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/10\/user-details.png\" alt=\"\" class=\"wp-image-4381\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/10\/user-details.png?v=1570389354 1356w, https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/10\/user-details-768x332.png?v=1570389354 768w\" sizes=\"(max-width: 1356px) 100vw, 1356px\" \/><\/figure>\n\n\n\n<p>If you need to use the terminal for this task, simply launch terminal by clicking <strong>Terminal<\/strong> on the left panel.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/10\/cockpit-terminal.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1356\" height=\"589\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/10\/cockpit-terminal.png\" alt=\"Cockpit terminal CentOS 8\" class=\"wp-image-4382\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/10\/cockpit-terminal.png?v=1570389399 1356w, https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/10\/cockpit-terminal-768x334.png?v=1570389399 768w\" sizes=\"(max-width: 1356px) 100vw, 1356px\" \/><\/a><\/figure>\n\n\n\n<p>Well, as you can see, it is very easy to use Cockpit to administer your CentOS tasks. Explore the full capability of Cockpit.<\/p>\n\n\n\n<p>Read more on <a rel=\"noreferrer noopener\" aria-label=\"Cockpit User Guide (opens in a new tab)\" href=\"https:\/\/cockpit-project.org\/guide\/latest\/guide\" target=\"_blank\">Cockpit User Guide<\/a>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Related Tutorials<\/h4>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/install-webmin-on-centos-8\/\" target=\"_blank\">Install Webmin on CentOS 8<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/install-and-setup-chrome-remote-desktop-on-ubuntu-18-04\/\" target=\"_blank\">Install and Setup Chrome Remote Desktop on Ubuntu 18.04<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/how-to-setup-guacamole-web-based-remote-desktop-access-tool-on-ubuntu-18-04\/\" target=\"_blank\">How to Setup Guacamole Web-based Remote Desktop Access Tool on Ubuntu 18.04<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-and-configure-vnc-server-on-centos-8\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">Install and Configure VNC Server on CentOS 8<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Cockpit is a web accessible interactive admin interface for Linux machines. In this guide, we are going to learn how to enable cockpit on CentOS<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[121,926,376],"tags":[1142,927],"class_list":["post-4376","post","type-post","status-publish","format-standard","hentry","category-howtos","category-cockpit","category-system-manager","tag-centos-8","tag-cockpit","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/4376"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=4376"}],"version-history":[{"count":2,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/4376\/revisions"}],"predecessor-version":[{"id":21233,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/4376\/revisions\/21233"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=4376"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=4376"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=4376"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}