If you’re an admin that spends most of your time managing Windows servers, you’re most likely much sharper on Windows than on Linux. That’s normal. However, within an enterprise environment, you will encounter Linux servers within heterogeneous environments. One of the easier ways to manage Linux servers without using commands via Command Line Interface (CLI) is through web-based management.
Back in the day, there was Webmin, (and still is) which is a very complete web-based management for Linux, but perhaps with too many options and quite complex to master in the end.
Cockpit on the other hand is allowing you to do base configs of your Linux server without knowing text-based commands and it’s very lightweight. You can manage storage, networking, services, users and more.
By default, Cockpit uses your system’s normal user logins and privileges. Network-wide logins are also supported through single-sign-on and other authentication techniques.
Cockpit is a web-based graphical interface for Linux servers and is intended primarily for those who do not work with Linux on a daily basis to remember manual commands. Cockpit enables basic Linux administration, such as:
- Network settings
- Firewall settings
- Enable / disable system services
- Disk space management
- Scan system logs
- System hardware control
- Software update
- System resource utilization overview
- Use the server terminal in the web window
Using Cockpit is particularly interesting on servers without SSH access enabled. All you need to access the Linux server is a web browser with port 9090.
You can easily view logs, turn services on and off, or use a terminal without having to have SSH enabled. This is just awesome. All this is within your browser window.
Let’s jump in and show you the installation and configuration with some tips.
Installation of Cockpit
Installation is very easy. In my demo, I’m using an Ubuntu server VM so I will write the procedure for the Ubuntu distribution but for other distributions the procedure is on the official website.
First, we will update the packages in our OS.
1 |
<em>sudo apt-get update</em> |
And now (in case we have internet access) we just need to write
1 |
<em>sudo apt-get install cockpit</em> |
After a successful installation, a login window will appear at https:// hostname-server:9090 or https: //server-IP-address:9090 , in which we can log in with a local account.
Connect to Cockpit via port 9090
After logging in, you will get to the home page where there is basic info about our system. You can click the Turn on Administrative access. You will be prompted for a password (it’s the equivalent of sudo command).
You can then easily navigate through the UI and, for example, configure system time.
Configure time via the web interface
This is particularly useful when you first install your Linux server and don’t have an internet connection to launch sync with a time server.
You may need to change the time zone if needed and configure an automatic NTP config. This is where you can do that.
Change your time settings if needed
There is also a “Bug Fix Update Available” in the Health section on the home page as you can see. When you click this, you will see a list of corrections that you should install. Just click the Install All Updates button.
Install Updates on your Linux host
Note: If you experiencing problems with the updates and receiving error message “Cannot refresh cache whilst offline”, you’ll need to go into the Terminal and open one config file within the nano (for example) editor.
Like this :
1 |
<em>sudo nano /etc/netplan/00-installer-config.yaml</em> |
Then add this line at as the last one:
1 |
<em>Renderer: NetworkManager</em> |
Add this to eliminate the error
There are recent updates to the software so while reading those lines, the error might be gone.
The user management section can be found within the Accounts section. You can add/remove users from your Linux system there.
Create New Account
Storage
You can manage storage, format, and create new RAID volumes. I’m just using a VM for this demo so I added 5 virtual disks with 20 Gb of size each, to my VM.
I can create RAID 5 volume out of this. Simply go to the storage section and on the right-hand side click the Devices Menu > Create new RAID device.
Click the menu on the right and select Create RAID device
I opted for a RAID 5 volume, but you can do RAID0, 1, 4, 5, 6 or 10. Raid 0 is (no redundancy) is also possible.
Create RAID device screen
Then you can follow the progress on the storage menu screen. You see the details in the screenshot below. As a result, I have a new volume with 79Gb in size approximatively. The Jobs section shows running jobs (in my example it is the RAID device creation that takes a couple of min).
Create a new RAID 5 volume
Once the RAID is created, the volume needs to be formatted. In my case, it’s the default XFS. Put some meaningful name and enter a mountpoint.
Format the volume as needed
Cockpit is extendable
This is good news as many admins might find the options insufficient. You can have a look here https://cockpit-project.org/applications.html where you’ll find many applications that can be installed on the top and integrated with your Cockpit software.
One of those interesting add-ons is for example Samba which allows you to manage shares exposed on your network.
Samba share management as an add-on in Cockpit
Final Words
I like the Cockpit software because it is a lightweight set of packages and you can install it on your Linux server. It allows you to manage Linux without having to have SSH enabled. This might be sometimes a key feature when you have a lot of company security restrictions.
Cockpit has a lot to offer for people handling Linux servers, not on daily basis, and admins that do not master a lot of commands via CLI. It offers a basic configuration of Linux servers and has some interesting add-ons that extend the possibilities.