Cockpit is a web-based graphical interface build specially for server administrations. It should be easy to use for all Linux beginner or even Windows admins, and also for all of those who are familiar with Linux-based operating system. Cockpit is also specially developed for Expert Linux SysAdmin (highly-experienced Linux system administrator) to manage their individual or corporate systems using available tools (packages/softwares) inside their Linux machine.
Cockpit Web Console is build with system APIs and commands. So, all system administrators (sysadmins) can manage their system with their prefer way, including using Linux command-line and all available utilities right alongside their Cockpit. Cockpit has a sophisticated and modern design, so sysadmin should feel comfortable using Cockpit. Cockpit is simple to use and makes Linux more discoverable than ever, where system administrator don’t have to remember commands at a command-line interface.
Today we will guide you on how to install Cockpit Web Console on Rocky Linux 8.5 code name “Green Obsidian”. Cockpit supports almost all Linux-based distributions, including Debian, Ubuntu, Arch Linux, Clear Linux, Opensuse Tumbleweed, Fedora, Fedora CoreOS, Red Hat Enterprise Linux (RHEL) and its derivatives like CentOS, Rocky Linux, AlmaLinux and Oracle Linux. Make sure to meet the following requirenment before installing cockpit on your machine.
PRE-REQUISITES:
* VPS, Cloud, or Bare-Metal Server * Deploy with Rocky Linux 8.5 (Green Obsidian) * Server IPv4 Address * Superuser Privileges (Sudo Access) * Gnome Terminal for Linux Desktop * PuTTy SSH Client for Windows or Mac * Powershell for Windows 10/11
1.) Login to your VM as Root
$ ssh [email protected] [email protected]'s password:
2.) Install Cockpit
Simply run the following command to install Cockpit Web Console on Rocky Linux 8.5.
$ dnf install cockpit DigitalOcean Agent 47 kB/s | 3.3 kB 00:00 DigitalOcean Droplet Agent 61 kB/s | 3.3 kB 00:00 Dependencies resolved. ===================================================================================================================================================== Package Architecture Version Repository Size ===================================================================================================================================================== Installing: cockpit x86_64 251.3-1.el8_5 baseos 77 k Installing dependencies: python3-lxml x86_64 4.2.3-3.el8 appstream 1.5 M python3-psutil x86_64 5.4.3-11.el8 appstream 372 k python3-setuptools noarch 39.2.0-6.el8 baseos 162 k python3-webencodings noarch 0.5.1-6.el8 appstream 26 k tracer-common noarch 0.7.5-2.el8 appstream 33 k Installing weak dependencies: cockpit-packagekit noarch 251.1-1.el8 appstream 702 k python3-beautifulsoup4 noarch 4.6.3-2.el8.1 epel 185 k python3-cssselect noarch 0.9.2-10.el8 epel 40 k python3-html5lib noarch 1:0.999999999-6.el8 appstream 213 k python3-tracer noarch 0.7.5-2.el8 appstream 121 k Transaction Summary ===================================================================================================================================================== Install 11 Packages Total download size: 3.4 M Installed size: 10 M Is this ok [y/N]: Y
3.) Enable Cockpit
Don’t forget to enable Cockpit to mae it start automatically from boot.
$ systemctl enable --now cockpit.socket Created symlink /etc/systemd/system/sockets.target.wants/cockpit.socket → /usr/lib/systemd/system/cockpit.socket.
4.) Manage Cockpit via CLI
You can manage your Cockpit Web Console using the following systemctl commands.
$ systemctl status cockpit.socket ● cockpit.socket - Cockpit Web Service Socket Loaded: loaded (/usr/lib/systemd/system/cockpit.socket; enabled; vendor preset: disabled) Active: active (listening) since Sat 2022-04-30 19:59:13 UTC; 15s ago Docs: man:cockpit-ws(8) Listen: [::]:9090 (Stream) Process: 73813 ExecStartPost=/bin/ln -snf active.motd /run/cockpit/motd (code=exited, status=0/SUCCESS) Process: 73805 ExecStartPost=/usr/share/cockpit/motd/update-motd localhost (code=exited, status=0/SUCCESS) Tasks: 0 (limit: 4730) Memory: 920.0K CGroup: /system.slice/cockpit.socket Apr 30 19:59:13 open-source.project systemd[1]: Starting Cockpit Web Service Socket. Apr 30 19:59:13 open-source.project systemd[1]: Listening on Cockpit Web Service Socket.
To Start Cockpit
$ systemctl start cockpit.socket
To Stop Cockpit
$ systemctl stop cockpit.socket
To Restart Cockpit
$ systemctl restart cockpit.socket
5.) Allow Cockpit on Firewalld Rules
If you have firewalld running and active inside your machine, you should allow Cockpit (Cockpit port 9090). So, Cockpit can be accessed over public internet using port 9090. Simply run the following command to allow Cockpit port 9090 in Firewalld rules.
$ firewall-cmd --add-service=cockpit $ firewall-cmd --add-service=cockpit --permanent
6.) Install Cockpit Tuned to Optimize Linux System Performance
Next, you can install Cockpit Tuned in order to optimize system performance on your Rocky machine. Simply run the following commands to install tuned and its utility.
$ dnf install tuned tuned-utils tuned-utils-systemtap DigitalOcean Agent 108 kB/s | 3.3 kB 00:00 DigitalOcean Droplet Agent 67 kB/s | 3.3 kB 00:00 Package tuned-2.16.0-1.el8.noarch is already installed. Dependencies resolved. ===================================================================================================================================================== Package Architecture Version Repository Size ===================================================================================================================================================== Installing: tuned-utils noarch 2.16.0-1.el8 appstream 46 k tuned-utils-systemtap noarch 2.16.0-1.el8 appstream 51 k Installing dependencies: avahi-libs x86_64 0.7-20.el8 baseos 61 k binutils x86_64 2.30-108.el8_5.1 baseos 5.8 M boost-atomic x86_64 1.66.0-10.el8 appstream 13 k boost-chrono x86_64 1.66.0-10.el8 appstream 22 k boost-date-time x86_64 1.66.0-10.el8 appstream 28 k boost-filesystem x86_64 1.66.0-10.el8 appstream 48 k boost-system x86_64 1.66.0-10.el8 appstream 17 k boost-thread x86_64 1.66.0-10.el8 appstream 57 k boost-timer x86_64 1.66.0-10.el8 appstream 20 k cpp x86_64 8.5.0-4.el8_5 appstream 10 M dyninst x86_64 11.0.0-3.el8 appstream 3.9 M efivar-libs x86_64 37-4.el8 baseos 107 k elfutils-devel x86_64 0.185-1.el8 baseos 85 k elfutils-libelf-devel x86_64 0.185-1.el8 baseos 58 k gcc x86_64 8.5.0-4.el8_5 appstream 23 M glibc-devel x86_64 2.28-164.el8_5.3 baseos 1.0 M glibc-headers x86_64 2.28-164.el8_5.3 baseos 479 k isl x86_64 0.16.1-6.el8 appstream 834 k kernel-headers x86_64 4.18.0-348.23.1.el8_5 baseos 8.3 M libmpc x86_64 1.1.0-9.1.el8 appstream 60 k libpkgconf x86_64 1.4.2-1.el8 baseos 34 k libxcrypt-devel x86_64 4.1.1-6.el8 baseos 24 k libzstd-devel x86_64 1.4.4-1.el8 baseos 43 k make x86_64 1:4.2.1-10.el8 baseos 497 k mokutil x86_64 1:0.3.0-11.el8 baseos 44 k nspr x86_64 4.32.0-1.el8_4 appstream 141 k nss x86_64 3.67.0-7.el8_5 appstream 740 k nss-softokn x86_64 3.67.0-7.el8_5 appstream 486 k nss-softokn-freebl x86_64 3.67.0-7.el8_5 appstream 394 k nss-sysinit x86_64 3.67.0-7.el8_5 appstream 72 k nss-util x86_64 3.67.0-7.el8_5 appstream 136 k pkgconf x86_64 1.4.2-1.el8 baseos 37 k pkgconf-m4 noarch 1.4.2-1.el8 baseos 16 k pkgconf-pkg-config x86_64 1.4.2-1.el8 baseos 14 k powertop x86_64 2.14-1.el8 appstream 263 k systemtap x86_64 4.5-3.el8 appstream 19 k systemtap-client x86_64 4.5-3.el8 appstream 3.7 M systemtap-devel x86_64 4.5-3.el8 appstream 2.3 M systemtap-runtime x86_64 4.5-3.el8 appstream 508 k tbb x86_64 2018.2-9.el8 appstream 158 k unzip x86_64 6.0-45.el8_4 baseos 194 k xz-devel x86_64 5.2.4-3.el8.1 baseos 61 k zip x86_64 3.0-23.el8 baseos 269 k zlib-devel x86_64 1.2.11-18.el8_5 baseos 57 k Installing weak dependencies: elfutils-debuginfod-client-devel x86_64 0.185-1.el8 baseos 55 k kernel-devel x86_64 4.18.0-348.23.1.el8_5 baseos 20 M Transaction Summary ===================================================================================================================================================== Install 48 Packages Total download size: 85 M Installed size: 220 M Is this ok [y/N]:
Enable Tuned to Start from Boot
$ systemctl enable --now tuned
Check Cockpit Tuned Status
$ systemctl status tuned
After that, you can optimize your system performance using Tuned in Cockpit Web Console, exactly at the bottom line in Configuration >> Performance profile sections.
7.) Login to Cockpit in Web Browser
You can use web browsers like Google Chrome or Mozilla Firefox to get access into your Cockpit Web Console. Cockpit is listen on port 9090 in the following URL.
> https://server_IPv4_address:9090/
For example:
> https://45.55.41.24:9090/
Then you can login to your Cockpit Web Console using your root account credentials or general users (not-root access). You can create it later if you want access into your Cockpit with non-root user.
CONCLUSIONS:
You have successfully in setting up and configuring Cockpit Web Console on Rocky Linux 8.5 (Green Obsidian). Then, feel free to manage your system inside Linux machine using Cockpit Web Console.