---
title: "Manage Your Servers with Cockpit Linux"
description: "Learn how to simplify the management of your server, from networking to containers, with the Cockpit Linux web console!"
canonical: "https://adamtheautomator.com/cockpit-linux/"
---

# Manage Your Servers with Cockpit Linux

> Learn how to simplify the management of your server, from networking to containers, with the Cockpit Linux web console!

Source: https://adamtheautomator.com/cockpit-linux/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![Manage Your Servers with Cockpit Linux](https://adamtheautomator.com/wp-content/uploads/2022/02/Manage-Your-Servers-with-Cockpit-Linux.jpg)

# Manage Your Servers with Cockpit Linux

[![](https://secure.gravatar.com/avatar/572a248f516b6d0cd566cb44fdbd9336f30ef95aa0f6d78f118c1f47b1b6d6b7?s=192&d=mm&r=g)Arvid Larson](https://adamtheautomator.com/author/arvid-larson/)28 February 20229 min. read

Categories: [IT Ops](/category/it-ops/)

Tags:[Linux](/tag/linux/)

Table of Contents

*   [Prerequisites](#prerequisites)
*   [Installing the Cockpit Linux Web Console](#installing-the-cockpit-linux-web-console)
*   [Managing Your Server with Cockpit Linux](#managing-your-server-with-cockpit-linux)
*   [Updating Hostname and System Time](#updating-hostname-and-system-time)
*   [Provisioning a Server Administrator Account](#provisioning-a-server-administrator-account)
*   [Accessing the Terminal](#accessing-the-terminal)
*   [Managing Network IP Addresses](#managing-network-ip-addresses)
*   [Adding Services Firewall Rules](#adding-services-firewall-rules)
*   [Enabling Automatic Update](#enabling-automatic-update)
*   [Managing Containers](#managing-containers)
*   [Conclusion](#conclusion)

So you’ve installed a new Linux server. Wouldn’t it be nice if you didn’t have to memorize and issue commands to do the initial configuration and ongoing maintenance? Lucky for you, there’s a tool for it, and it’s the [Cockpit](https://cockpit-project.org/) Linux web console.

Cockpit is a web-based interface for Linux servers with a friendly interface where you can manage storage, networking, firewall, and containers, to name a few. You can even open a terminal session right on your web browser for when you need to break out the command line!

In this tutorial, you’ll learn how to install Cockpit on a Linux server. You’ll also learn to manage a Linux server using the Cockpit Linux dashboard through the web browser.

## Prerequisites

You only need a Linux server with an internet connection and root access to follow this tutorial. This tutorial will be using a [Rocky Linux 8.5](https://rockylinux.org/download) server, which is [RedHat Enterprise Linux (RHEL)](https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux)\-based.

> _Cockpit supports other Linux distributions, such as Ubuntu, Debian, and Arch Linux._

## Installing the Cockpit Linux Web Console

Before you can start managing a Linux server with Cockpit, you’ll be installing Cockpit packages to your server. And like any package, you can conveniently install Cockpit using your distro’s package manager, which, in this example, is the [DNF package manager](https://docs.fedoraproject.org/en-US/quick-docs/dnf/).

Follow the below steps to install Cockpit.

1\. Open your preferred SSH client and log in to your server.

Related:[Getting Started using SSH with PowerShell](https://adamtheautomator.com/powershell-ssh/)

2\. Run the `dnf` command below to check the available `cockpit` packages.

```bash
# checking Cockpit package
sudo dnf info cockpit
```

As you can see below, the latest available cockpit package is 251.3, as of this writing.

![Checking the available cockpit package](https://adamtheautomator.com/wp-content/uploads/2022/02/image-328.png)

Checking the available cockpit package

3\. Now, run the below command to install the Cockpit Linux package.

```bash
# installing Cockpit
sudo dnf install cockpit -y
```

4\. After installing, run the below `systemctl` commands to start and confirm the `cockpit` service.

```bash
# start and enable Cockpit service
sudo systemctl enable --now cockpit.socket

# verify Cockpit service
sudo systemctl status cockpit.socket
```

You should see the output as below. The cockpit service status is active (running) and enabled — which means that the service will automatically run at system startup.

![Starting and verifying the cockpit service](https://adamtheautomator.com/wp-content/uploads/2022/02/image-329.png)

Starting and verifying the cockpit service

5\. Lastly, open your web browser, and navigate to your server IP address followed by the default listening port `9090` (i.e., [](https://172.16.1.20:9090/)[https://172.16.1.20:9090/](https://172.16.1.20:9090/)) to access the Cockpit web application.

You should see the Cockpit login page. Enter the server root user and password, then click the Log in button to log in to the Cockpit dashboard.

![Logging in to Cockpit dashboard](https://adamtheautomator.com/wp-content/uploads/2022/02/image-330.png)

Logging in to Cockpit dashboard

And below is the screenshot of the Cockpit Linux dashboard.

![The Cockpit Linux dashboard](https://adamtheautomator.com/wp-content/uploads/2022/02/image-331.png)

The Cockpit Linux dashboard

## Managing Your Server with Cockpit Linux

Now that you’ve installed Cockpit Linux, the following sections will teach you how to manage and configure your Linux server. Usually, you would establish a terminal session to configure these, but these settings are a few clicks away with Cockpit.

### Updating Hostname and System Time

The first items you would typically configure are the server hostname, FQDN, and time zone. These initial configuration items ensure that you establish the server’s identity and update the computer clock synchronization.

1\. On the Cockpit **Overview** page, locate the **Configuration** section and click the **edit** link next to the **Hostname.**

![Clicking the hostname edit link](https://adamtheautomator.com/wp-content/uploads/2022/02/image-332.png)

Clicking the hostname edit link

2\. Type in the **Pretty host name** to display on the user interface and the FQDN of the server into the **Real host name** field. Click **Change** to apply the changes.

![Changing hostname and FQDN](https://adamtheautomator.com/wp-content/uploads/2022/02/image-333.png)

Changing hostname and FQDN

3\. Also, on the **Configuration** section, click the current time on the system time field to change the time and time zone.

![Setting up system time](https://adamtheautomator.com/wp-content/uploads/2022/02/image-334.png)

Setting up system time

4\. Now change the **Time zone** to your preferred time zone and choose the option **Automatically using NTP** to set up the time.

The Automatically using NTP option allows Cockpit to use the [NTP service](http://www.ntp.org/) to synchronize the computer clock.

![Changing server time zone and setting up a time](https://adamtheautomator.com/wp-content/uploads/2022/02/image-335.png)

Changing server time zone and setting up a time

### Provisioning a Server Administrator Account

After you’ve configured the FQDN and system time, you’ll now set up a new user. In this example, you’ll create a server administrator account so that others won’t need to log in as root.

> _For security reasons, the best practice is to use non-root users to log in to Cockpit and SSH applications._

1\. Click on the **Accounts** menu on the left side, and you should get the list of users on your system. Click the **Create new account** button to create a new user.

![Creating a new user](https://adamtheautomator.com/wp-content/uploads/2022/02/image-336.png)

Creating a new user

2\. Enter the new account’s username and password on the popup window, and click **Create**. This demo is creating a new user named **johndoe**.

![Setting up username and password](https://adamtheautomator.com/wp-content/uploads/2022/02/image-337.png)

Setting up username and password

3\. On the **Accounts** page, click the new account you’ve created (**johndoe)** to open the account’s information page.

![Setting up user](https://adamtheautomator.com/wp-content/uploads/2022/02/image-338.png)

Setting up user

4\. Now, check the **Server administrator** box next to **Roles**. This step adds **johndoe** to the **wheel** group and allows the `sudo` command to get the root privileges.

5\. Click **edit** on the **Password** section to set up the password expiration.

![Enabling sudo and password expiration](https://adamtheautomator.com/wp-content/uploads/2022/02/image-339.png)

Enabling sudo and password expiration

6\. Select the option to **Require password change on the password-expiration popup** and input the max days for password expiration. Click the **Change** button to apply new changes.

![Setting up password expiration](https://adamtheautomator.com/wp-content/uploads/2022/02/image-340.png)

Setting up password expiration

7\. Next, click the **Session** menu on the top right, then select **Log out**.

![Logging out from Cockpit dashboard](https://adamtheautomator.com/wp-content/uploads/2022/02/image-341.png)

Logging out from Cockpit dashboard

8\. Log in again with the new user, **johndoe**.

![Logging in to Cockpit with new user](https://adamtheautomator.com/wp-content/uploads/2022/02/image-342.png)

Logging in to Cockpit with new user

9\. You should see the message _Web console is running in limited access mode_. Click the button **Turn on administrative access** to get full access to the Cockpit administration. Clicking this button is equivalent to issuing the `sudo su` command in the terminal to elevate access.

![Enabling administrative access for Cockpit](https://adamtheautomator.com/wp-content/uploads/2022/02/image-343.png)

Enabling administrative access for Cockpit

10\. Input the password for your user and click **Authenticate**.

![Authenticating to enable Cockpit administration](https://adamtheautomator.com/wp-content/uploads/2022/02/image-344.png)

Authenticating to enable Cockpit administration

11\. Now you will see at the top-right menu the indicator **Administrative access**, which means the administration for Cockpit is enabled.

![Cockpit administration is enabled](https://adamtheautomator.com/wp-content/uploads/2022/02/image-345.png)

Cockpit administration is enabled

### Accessing the Terminal

You’ve now created a new user using the Cockpit dashboard; the next step is accessing the server terminal from the Cockpit Linux dashboard and verifying the `sudo` root privileges.

1\. Click the menu **Terminal** on the left side to access the server terminal session.

![Accessing Terminal server Cockpit](https://adamtheautomator.com/wp-content/uploads/2022/02/image-346.png)

Accessing Terminal server Cockpit

2\. Now run the `sudo su` command to get the root privileges. Enter your password at the prompt.

3\. Lastly, run the below command to verify the root privileges.

```bash
# print detail user and group
id

# print userid
whoami
```

You should see the output like the screenshot below. You’ve now got the root privileges and become a root user.

> _Ensure to log out from the terminal issuing the exit command or pressing Ctrl+D when you no longer need the terminal access._

![Verifying sudo from the Cockpit Linux terminal](https://adamtheautomator.com/wp-content/uploads/2022/02/image-347.png)

Verifying sudo from the Cockpit Linux terminal

### Managing Network IP Addresses

Suppose you have another network adapter on the server that needs a new static IP address assignment. Or perhaps your primary network interface is getting its IP address from the DHCP server, but you need to configure it manually instead.

Whatever your situation, Cockpit has the feature to set up IP address configuration.

1\. Click on the **Networking** menu on the left side, and you should see the **Interfaces** section. Cockpit will automatically detect available network interfaces on the server.

2\. Click the interface name to set up an IP address. This demo will set up an IP address for the interface **eth2** with the detailed static IP address below.

IP Address: `172.16.5.20`

Gateway: `172.16.5.1`

![Setting up an IP address for interfaces eth2](https://adamtheautomator.com/wp-content/uploads/2022/02/image-348.png)

Setting up an IP address for interfaces eth2

3\. Click **Activate** button to activate the **eth2** interface. Check the option _Connect automatically_ to make the eth2 interface start automatically at system startup. Click **edit** on the **IPv4** section to set up an IP address.

![Enabling eth2 interface and setup static IP address](https://adamtheautomator.com/wp-content/uploads/2022/02/image-349.png)

Enabling eth2 interface and setup static IP address

4\. Select **Manual** on the **Addresses** section to set up a static IP address for the **eth2** interface. Now, input the IP address, prefix, and gateway, and click **Apply**.

![Setting up the static IP address for eth2](https://adamtheautomator.com/wp-content/uploads/2022/02/image-350.png)

Setting up the static IP address for eth2

5\. Lastly, open the Cockpit Terminal and run the below command to verify the new IP address.

```bash
# checking IP address eth2
ip a show eth2
```

You should see the output as below. The interface eth2 has the static IP address 172.16.5.20 as you configured.

![Checking IP address in the terminal](https://adamtheautomator.com/wp-content/uploads/2022/02/image-351.png)

Checking IP address in the terminal

### Adding Services Firewall Rules

Another configuration item when setting up the new server is the firewall. The firewall will make your server more secure, and Cockpit allows admins to enable and manage the firewall rules.

For example, if you plan to set up the server to serve websites, you would want to configure the firewall rules to allow ports `80` and `443`. To configure the firewall in Cockpit, proceed as follows.

1\. Click the **Networking** menu on the left side. If the **Firewall** status is not yet enabled, click the switch to turn on the firewall. Next, click **Edit rules and zones** on the **Firewall** section.

![Setting up the firewall with Cockpit](https://adamtheautomator.com/wp-content/uploads/2022/02/image-352.png)

Setting up the firewall with Cockpit

2\. On the **Firewall** page configuration, click **Add services** to add new services and ports.

![Adding services and ports to the firewall](https://adamtheautomator.com/wp-content/uploads/2022/02/image-353.png)

Adding services and ports to the firewall

3\. Select **Services** to add pre-defined services to the firewall on the Add services popup.

> The Custom Ports option lets you add custom ports instead.

In this example, add the HTTP and HTTPS services to the firewall. To do so, type http on the Filter services field. Check both the http and https boxes and click the Add services button.

![Adding new services to firewall](https://adamtheautomator.com/wp-content/uploads/2022/02/image-354.png)

Adding new services to firewall

You should now see the http and https services on the Firewall page.

![Verifying firewall rules from Cockpit dashboard](https://adamtheautomator.com/wp-content/uploads/2022/02/image-355.png)

Verifying firewall rules from Cockpit dashboard

### Enabling Automatic Update

Automatic updates will ensure you’re using the latest version of packages. Also, you’ll always get the latest security patch for your system.

1\. Click the **Software updates** menu on the left side, and you’ll see the **Software updates** page.

![24-setting-software-updates](https://adamtheautomator.com/wp-content/uploads/2022/02/image-356.png)

24-setting-software-updates

2\. Click the **Enable** button to set up a**utomatic updates on the Settings section**.

![Enabling automatic updates](https://adamtheautomator.com/wp-content/uploads/2022/02/image-357.png)

Enabling automatic updates

3\. Click **Install** to install `dnf-automatic` to your system on the Install software popup. Cockpit Linux uses the `dnf-automatic` package to set up automatic updates. Wait for the installation to finish.

![Installing dnf-automatic package](https://adamtheautomator.com/wp-content/uploads/2022/02/image-358.png)

Installing dnf-automatic package

4\. Next, select one of the following options on the Automatic updates prompt.

*   **Security updates only** – to enable automatic security updates only.
    
*   **All updates** – to enable updates for all packages.
    

This example will enable automatic updates for all packages every day at 00:00. Click Save changes to apply the new automatic updates settings.

![Setting up automatic updates with Cockpit](https://adamtheautomator.com/wp-content/uploads/2022/02/image-359.png)

Setting up automatic updates with Cockpit

Now you’ll see the message _Updates will be applied every day at 00:00_ under the Automatic updates section.

![Automatic updates enabled](https://adamtheautomator.com/wp-content/uploads/2022/02/image-360.png)

Automatic updates enabled

Apart from automatic updates, Cockpit allows you to install updates manually, too. On the **Software updates** page, you’ll see the **Available updates** section. Click **install all updates** to update all packages on your system, or click **Install security updates** to only install security updates.

![Installing updates manually](https://adamtheautomator.com/wp-content/uploads/2022/02/image-361.png)

Installing updates manually

### Managing Containers

What if you want to run containers on your Linux server? You’d think you have to do everything in the terminal – but no. Cockpit Linux provides the interface to run containers with [Podman](https://podman.io/).

> _Podman is a Linux-native tool for managing_ [Open Container Initiative (OCI)](https://iximiuz.com/en/posts/oci-containers/) _containers and container images for your application. Podman also supports Docker images._

In this example, you’ll enable Podman in Cockpit and create a new container running an instance of NGINX. Follow the below instructions to enable container management in Cockpit Linux.

Related:[Getting Started with NGINX on Docker](https://adamtheautomator.com/nginx-docker/)

1\. First, install the latest `cockpit-podman` package, which provides the Cockpit user interface for Podman containers. To install, open the Terminal on Cockpit and run the below command.

```bash
# installing Cockpit-podman add-ons
sudo dnf install cockpit-podman -y
```

![Installing add-on cockpit-podman](https://adamtheautomator.com/wp-content/uploads/2022/02/image-362.png)

Installing add-on cockpit-podman

2\. Now, reload or refresh the Cockpit web browser tab. Once the Cockpit refreshes, you should see the new menu called **Podman containers**. Click the menu **Podman containers.**

![30-enable-podman-cockpit](https://adamtheautomator.com/wp-content/uploads/2022/02/image-363.png)

30-enable-podman-cockpit

3\. Next, check the **Automatically start podman on boot** box and click **Start podman** to start the `podman` service.

![Starting and enabling podman service](https://adamtheautomator.com/wp-content/uploads/2022/02/image-364.png)

Starting and enabling `podman` service

4\. Click the **Create container** button to create and set up a new container.

![Creating new container using Cockpit](https://adamtheautomator.com/wp-content/uploads/2022/02/image-365.png)

Creating new container using Cockpit

5\. On the **Create container** popup, enter the following information.

*   Type in _nginx\_dev_ into the **Name** field.
    
*   Select **System** as the **Owner**. This option will ensure that the root account will own the container.
    
*   Input **nginx** as the base **Image** for the new container.
    
*   Input the start **Command** for the new container `nginx -g "daemon off;"`. This command issues the global directive not to start `nginx` as a daemon.
    
*   Uncheck the option **With terminal**. Disable this option when there is no need for an interactive terminal for the new container.
    
*   Select **Always** on the **Restart policy** option. This option allows the container to restart whenever the container exits.
    

![Setting up container base image and start command](https://adamtheautomator.com/wp-content/uploads/2022/02/image-366.png)

Setting up container base image and start command

6\. Next, click the **Integration** tab and add the port mapping for the **Host port** to _80_ and the **Container port** to _80_. Finally, click the **Create** button to confirm and create the new container.

![Setting up port-mapping for the container](https://adamtheautomator.com/wp-content/uploads/2022/02/image-367.png)

Setting up port-mapping for the container

7\. Click on the _nginx\_dev_ container, and you should see details of container configuration below.

![Verifying details container status on Cockpit](https://adamtheautomator.com/wp-content/uploads/2022/02/image-368.png)

Verifying details container status on Cockpit

8\. Finally, open a new tab on your web browser and type the server IP address (i.e., [](http://172.16.1.20/)[http://172.16.1.20/](http://172.16.1.20/)) on the address bar. And you should see the default NGINX welcome message from the _nginx\_dev_ container you’ve created.

![Verifying the NGINX container is running](https://adamtheautomator.com/wp-content/uploads/2022/02/image-369.png)

Verifying the NGINX container is running

## Conclusion

Throughout this tutorial, you’ve learned how to install and configure the Cockpit Linux web console. Also, you’ve learned how to perform various management and configuration tasks from the web browser.

What’s next? Perhaps you may be interested in [enabling virtualization](https://www.redhat.com/sysadmin/manage-virtual-machines-cockpit) using Cockpit and adding [storage](https://fedoramagazine.org/storage-management-with-cockpit/) to your Cockpit Linux server.

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Fcockpit-linux%2F&text=Manage%20Your%20Servers%20with%20Cockpit%20Linux)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Fcockpit-linux%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Fcockpit-linux%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2022/09/Practical-Linux-Unix-Tee-Commands-for-the-Linux-Admin.jpg)

### [Master Unix tee Commands for Real-World Linux Admin Tasks](/unix-tee/)

Simplify Linux output management and streamline your workflow with the “Unix tee” command. This tutorial guides you through its practical applications.

![](https://adamtheautomator.com/wp-content/uploads/2024/03/openldap-4.jpg)

### [How to Install and Configure an OpenLDAP Ubuntu Server](/openldap/)

Unlock the power of OpenLDAP on Ubuntu for centralized user authentication, seamless access control management, and enhanced directory services!

![](https://adamtheautomator.com/wp-content/uploads/2024/03/pipe-command-in-linux-1.jpg)

### [Unleashing the Power of the Pipe Command in Linux](/pipe-command-in-linux/)

Unlock the prowess of the pipe command in Linux to streamline tasks, boost productivity, and simplify complex operations effortlessly!

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
