Install Cockpit management on Ubuntu

If you want to install cockpit on your server, follow these steps:

To install cockpit on Ubuntu, run the following command:

sudo apt install cockpit

Additionally, install the following package for more detailed metrics:

sudo apt install cockpit-pcp

Now there is a bug in Ubuntu, prohibiting cockpit to update the system through the webinterface (packagekit cannot refresh cache whilst offline). This seems to have to do with differences in netplan and network manager. To overcome this, you have to create a a placeholder file and a network interface:

nano /etc/NetworkManager/conf.d/10-globally-managed-devices.conf

Add the following two lines to that file. Save the file ant quit the nano editor.

 [keyfile]
 unmanaged-devices=none

Optionally: If you run Ubuntu on an ARM system, you may need to install the following packages:

sudo apt install linux-modules-extra-raspi

Now set up a dummy network interface:

nmcli con add type dummy con-name fake ifname fake0 ip4 1.2.3.4/24 gw4 1.2.3.1

Reboot your machine. Now you should be able to update the packages in the web interface.

Cockpit should be starting automatically. If this does not happen, configure it to do so:

systemctl start cockpit
systemctl enable cockpit

Access your cockpit installion under https://my.server.IP.address:9090

Source: https://cockpit-project.org/faq.html

Auto start issues?

If you happen to see the following error when enabling cockpit:

The unit files have no installation config (WantedBy=, RequiredBy=, Also=, Alias= settings in the [Install] section, and DefaultInstance= for template units). This means they are not meant to be enabled using systemctl.

Than you have to edit the configuration file:

sudo nano /usr/lib/systemd/system/cockpit.service

And add the following lines at the end, save and start the service:

[Install]
WantedBy=multi-user.target
systemctl enable cockpit.service
systemctl start cockpit.service

source: https://mj57.github.io/2021/03/Installer-Cockpit/

Leave a Reply