# Install Cockpit

You may want to treat this more like Docker to where, instead of installing this in a docker, install this on the locale machine next to docker as It needs some parts local OS to function with.

Install into your local machine:

```c++
sudo apt-get install cockpit -y
```

##### If you are going to use this as a Virtual Machine, install the following packages as well:

<kbd>cockpit-machines = The VM package (adds the VM tab)  
</kbd><kbd>pcp = Performance piolet - give data usage info  
cockpit-pcp = Part of above  
packagekit = an updater  
virt-viewer = To view on your local machine</kbd>

```c++
sudo apt install cockpit-machines pcp cockpit-pcp packagekit virt-viewer
```


Once the installation completes, start and enable Cockpit with as well as the following other 2 things: (all 3)

```c++
sudo systemctl enable --now cockpit.socket
```

```c++
sudo systemctl enable --now pmcd
```

```
sudo systemctl enable --now pmlogger
```

Now that Cockpit is installed and running, you can log in.

However, depending on how your system is set up, you’ll want to make sure the user you log into Cockpit with has sudo privileges. <span style="text-decoration: underline;">**Only do this if:**</span> your machine does not already have a user with sudo privileges.

To change to sudo privileges, enter the command:

```c++
sudo usermod -aG sudo USER-NAME-HERE
```

#### If you want Container support;

 you need to install podman.

```c++
sudo apt-get install podman cockpit-podman -y
```

Start and enable Podman with:

```c++
sudo systemctl enable --now podman
```

Accessing Cockpit:  
In your web browser, type in the ip of the machine your new cockpit instance is on. Cockpits port should default at 9090. Will look something like this `192.168.10.150:9090`

Source:  
https://www.techrepublic.com/article/install-cockpit-ubuntu-better-server/