Man installing, configuring system settings at laptop. Computer repair, technical support concept. Sysadmin or IT administrator profession. High quality photo
Image: valiantsin/Adobe Stock

Cockpit is a very powerful tool that allows you to manage several aspects, such as Podman containers, users, storage, networking, services, SELinux, software updates and with the help of additional plugins, much more.

Cockpit is found on most RHEL-based Linux operating systems and can be installed on Ubuntu-based systems from the standard repositories with a command like sudo apt-get install cockpit -y.

Cockpit is traditionally managed by a web-based interface, but for those who prefer a desktop client, there is an application. Cockpit Client provides a very simple-to-use GUI to make it even easier to manage your servers. All connections are made via SSH using the SHH configuration for the local user and all servers must have Cockpit installed. The bonus is that the Cockpit web server doesn’t need to be enabled, and no extra ports are exposed.

I want to show you how to install Cockpit Client and then connect it to your Cockpit-enabled server.

SEE: 40+ open source and Linux terms you need to know (TechRepublic Premium)

What you’ll need

To make this work, you’ll need a Linux distribution that supports Flatpak and 1 or more servers with Cockpit installed. That’s it.

How to install Cockpit Client

If you’re using an RHEL-based Linux distribution, chances are good Flatpak is already installed. If you’re using a Ubuntu-based distribution, Flatpak is probably not installed. The good news is it’s quite simple to add. Here’s how.

  1. Log into your Ubuntu-based desktop and open a terminal window.
  2. Install Flatpak with the command sudo apt-get install flatpak.
  3. Add the Flathub repository with flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

At this point, Flatpak is installed and ready to go. Let’s now install Cockpit Client with the command:

flatpak install cockpitclient

You’ll be asked if you want to install to the system (1) or just for the user (2), so type to select your choice. Next, type y to select the default stable option. Finally, type y to verify the installation.

How to connect Cockpit Client to a server

Once the Cockpit Client is installed, open it from your desktop menu and you’ll be prompted for the IP address of your first Cockpit-enabled server (Figure A).

Figure A

The Cockpit first-run wizard makes it simple to connect to a server.

One thing to keep in mind is that with this initial connection, you don’t get the opportunity to add a username. This means you must have a user account with admin privileges on the remote Cockpit machine that matches the one you’re using on your desktop. After you add the initial connection, all other Cockpit hosts can be configured with different usernames. Why this is the case, I have no idea.

Do not add the 9090 port to the address, as the app isn’t actually connecting to the web server but instead via SSH. You’ll then be prompted for your user password for the remote server.

Upon successful authentication, you’ll be presented with the Cockpit Client default window, showing exactly what you’d expect from Cockpit (Figure B).

Figure B

Our Cockpit Client installation has successfully connected with an AlmaLinux server.

How to add more hosts

Adding another host to manage in the Cockpit Client is equally as simple. Click the drop-down at the top of the left sidebar and select Add New Host from the pop-up (Figure C).

Figure C

You can add as many hosts as needed in Cockpit Client.

In the resulting pop-up (Figure D), type the IP address or hostname of the remote server and then type a username — one with admin privileges found on the remote machine.

Figure D

Adding a new host in Cockpit Client.

Click Add, and when prompted, click Accept Key and Connect (Figure E).

Figure E

Accepting the key from the remote machine only happens on the first connection.

If SSH Key Authentication isn’t enabled, you’ll then be prompted for your user password to Authorize the SSH key for automatic logins (Figure F).

Figure F

Allowing automatic logins via SSH key is a smart option to take.

Click Login and your new host is added. Keep adding hosts until all of your Cockpit-enabled Linux servers are accessible from Cockpit Client.

This is a very handy tool to have for anyone who manages numerous Linux servers. Although you can’t do everything with Cockpit, it certainly makes it easy to do many of your typical admin tasks. Give this tool a whirl and see if it doesn’t become your go-to connection to Cockpit.

If you are interested in mastering your Linux knowledge, check these courses in the TechRepublic Academy. You can go from Beginner to working with Linux like an IT Pro!

Subscribe to TechRepublic’s How To Make Tech Work on YouTube for all the latest tech advice for business pros from Jack Wallen.