Ubuntu Server 22.04にCockpitをインストールする!

Ubuntu Server 22.04にCockpitをインストールします。

動作確認した環境を確認する!

動作確認した環境を確認します。

$ hostnamectl
 Static hostname: vmswps01
       Icon name: computer-vm
         Chassis: vm
      Machine ID: 71bb07e8b0b241a7b80c0ffc45302ee2
         Boot ID: 167c5dce1650486e8816b850c414d4f1
  Virtualization: oracle
Operating System: Ubuntu 22.04.2 LTS              
          Kernel: Linux 5.15.0-78-generic
    Architecture: x86-64
 Hardware Vendor: innotek GmbH
  Hardware Model: VirtualBox

Cockpitをインストールする!

Cockpitを標準のリポジトリからインストールします。

$ sudo apt install cockpit -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  cockpit-bridge cockpit-networkmanager cockpit-packagekit cockpit-storaged cockpit-system cockpit-ws cracklib-runtime
  dconf-gsettings-backend dconf-service dns-root-data dnsmasq-base glib-networking glib-networking-common
  glib-networking-services gsettings-desktop-schemas libblockdev-mdraid2 libbluetooth3 libbytesize-common libbytesize1
  libcrack2 libdconf1 libndp0 libnl-route-3-200 libnm0 libpcsclite1 libproxy1v5 libpwquality-common libpwquality-tools
  libpwquality1 libteamdctl0 network-manager network-manager-pptp ppp pptp-linux session-migration wamerican
  wpasupplicant
Suggested packages:
  cockpit-doc cockpit-pcp cockpit-sosreport xdg-utils udisks2-lvm2 sssd-dbus pcscd avahi-autoipd libteam-utils wpagui
  libengine-pkcs11-openssl
The following NEW packages will be installed:
  cockpit cockpit-bridge cockpit-networkmanager cockpit-packagekit cockpit-storaged cockpit-system cockpit-ws
  cracklib-runtime dconf-gsettings-backend dconf-service dns-root-data dnsmasq-base glib-networking
  glib-networking-common glib-networking-services gsettings-desktop-schemas libblockdev-mdraid2 libbluetooth3
  libbytesize-common libbytesize1 libcrack2 libdconf1 libndp0 libnl-route-3-200 libnm0 libpcsclite1 libproxy1v5
  libpwquality-common libpwquality-tools libpwquality1 libteamdctl0 network-manager network-manager-pptp ppp
  pptp-linux session-migration wamerican wpasupplicant
0 upgraded, 38 newly installed, 0 to remove and 75 not upgraded.
...

Cockpitが起動していることを確認する!

Cockpitのソケットがアクティブであることを確認します。

$ systemctl status cockpit.socket
● cockpit.socket - Cockpit Web Service Socket
     Loaded: loaded (/lib/systemd/system/cockpit.socket; enabled; vendor preset: enabled)
     Active: active (listening) since Sun 2023-08-27 09:04:17 UTC; 6min ago
   Triggers: ● cockpit.service
       Docs: man:cockpit-ws(8)
     Listen: [::]:9090 (Stream)
    Process: 2108 ExecStartPost=/usr/share/cockpit/motd/update-motd  localhost (code=exited, status=0/SUCCESS)
    Process: 2115 ExecStartPost=/bin/ln -snf active.motd /run/cockpit/motd (code=exited, status=0/SUCCESS)
      Tasks: 0 (limit: 1012)
     Memory: 8.0K
        CPU: 9ms
     CGroup: /system.slice/cockpit.socket

ブラウザからアクセスする!

9090ポートを指定してブラウザからアクセスします。

https://vmswps01.loc.lab4ict.com:9090

おわりに

Cockpitにアクセスするための設定方法をまとめました。

関連記事