Linux Cockpit Notes
1. What is Cockpit?
Cockpit is a web-based graphical interface for servers, intended for everyone, especially those who are:
* new to Linux
* familiar with Linux
* expert adminsCockpit makes Linux discoverable. You don’t have to remember commands at a command-line.
See your server in a web browser and perform system tasks with a mouse. It’s easy to start containers, administer storage, configure networks, and inspect logs. Basically, you can think of Cockpit like a graphical “desktop interface”, but for individual servers.
2. Install Cockpit
-
Install
Ubuntusudo apt update && sudo apt install -y cockpitFedorasudo dnf -y install cockpit -
Enable
sudo systemctl enable --now cockpit.socket
3. Install Native Cockpit Applications
-
Launch
Cockpitvia https://hostname:9090 -
Enable
Administrative accessby clicking the Limited access button followed by authenticating with your password. -
Click the Applications menu item
-
Install the following appplications and click the Install button to install them.
-
Files
-
Machines
-
Podman
-
SELinux
-
4. Install 3rd Party Cockpit Applications
4.2. Podman
-
cd into your home folder
cd -
Download git repo
git clone https://github.com/cockpit-project/cockpit-podman -
cd into folder
cd cockpit-podman -
Build the plugin
make -
Install system-wide
sudo make install-
The module will be installed to
/usr/share/cockpit/
-
4.4. ZFS (old installation)
|
As of Mar 10, 2026 this repo is no longer supported but as of this writing, the replacement repo doesn’t work as well. |
-
cd into your home folder
cd -
Download git repo
git clone --recurse-submodules https://github.com/45Drives/cockpit-zfs.git -
cd into folder
cd cockpit-zfs -
Build the plugin
makeThis will take some time. -
Install system-wide
sudo make installThis will take some time too. -
Fix fonts
-
Create script
vi fixCockpitfonts.shExpand for the Script
#!/bin/bash mkdir -p /usr/share/cockpit/base1/fonts/ wget -O /usr/share/cockpit/base1/fonts/fontawesome.woff https://github.com/h5p/font-awesome/raw/master/fontawesome-webfont.woff wget -O /usr/share/cockpit/base1/fonts/glyphicons.woff https://github.com/twbs/bootstrap-sass/raw/master/assets/fonts/bootstrap/glyphicons-halflings-regular.woff wget -O /usr/share/cockpit/base1/fonts/patternfly.woff https://github.com/patternfly/patternfly-sass/raw/master/assets/fonts/patternfly/PatternFlyIcons-webfont.woff wget -P /usr/share/cockpit/static/fonts https://github.com/braintree/braintree_slim_example/raw/main/static/fonts/open-sans/OpenSans-Semibold-webfont.woff mkdir -p /usr/share/cockpit/zfs/assets/fonts/RedHatDisplay/ cp -v /usr/share/cockpit/static/fonts/*Display*.woff2 /usr/share/cockpit/zfs/assets/fonts/RedHatDisplay/ for f in /usr/share/cockpit/zfs/assets/fonts/RedHatDisplay/*; do sudo mv -v -- "$f" "${f%.woff2}.woff"; done mkdir -p /usr/share/cockpit/zfs/assets/fonts/RedHatText/ cp -v /usr/share/cockpit/static/fonts/*Text*.woff2 /usr/share/cockpit/zfs/assets/fonts/RedHatText/ for f in /usr/share/cockpit/zfs/assets/fonts/RedHatText/*; do sudo mv -v -- "$f" "${f%.woff2}.woff"; done systemctl restart cockpit -
Change the permissions
sudo chmod 744 ./fixCockpitfonts.sh -
Execute the script
sudo ./fixCockpitfonts.sh
-
-
Restart
Cockpitsudo systemctl restart cockpit.socket-
The module will be installed to
/usr/share/cockpit/zfs/
-
5. Install Cockpit MFA Support
|
Copilot with GPT-4 generated the install steps. |
-
Install Packages
Ubuntusudo apt-get install libpam-google-authenticator libqrencode-dev -yFedorasudo dnf -y install libpam-google-authenticator libqrencode-dev -
Generate the MFA Secret
Run the google-authenticator command with the appropriate flags. This will generate a QR code that you can scan with your authenticator app, as well as some backup codes. Make sure to save these in a safe place:
google-authenticator -t -d -f -r 3 -R 30 -W -Q UTF8 -
Configure PAM
Add the Google Authenticator module to the PAM configuration for Cockpit. This can be done by appending a line to the /etc/pam.d/cockpit file:
sudo bash -c 'echo "auth required pam_google_authenticator.so nullok" >> /etc/pam.d/cockpit' -
Restart
Cockpitsudo systemctl restart cockpit -
Test MFA
Log out of Cockpit and log back in. You should be prompted to enter your username and password, followed by a one-time password (OTP) generated using the ffx provider.
That’s it! You have now added MFA to
Cockpit.Remember to keep your secret key secure and do not share it with anyone
-
Configure Nginx Proxy Manager entry with:
-
Websockets Support
-
Scheme: https
-