How to Install Cadvisor on Elementary OS Latest

In this tutorial, we will be installing Cadvisor from https://github.com/google/cadvisor on Elementary OS.

Prerequisites

Before we begin, make sure you have the following:

  • A working installation of Elementary OS Latest.
  • Superuser (sudo) privileges.

Step 1: Install Docker

Cadvisor is distributed as a Docker container, so we need to install Docker first. Open the terminal and run the following commands:

sudo apt update
sudo apt install docker.io

After the installation, start the Docker service and enable it to start on boot:

sudo systemctl start docker
sudo systemctl enable docker

Verify that Docker is installed and running by running the command:

sudo docker info

Step 2: Install Cadvisor

Now that we have Docker installed, we can proceed with installing Cadvisor. Run the following command to pull the latest container image:

sudo docker pull google/cadvisor

Once the image is downloaded, start the Cadvisor container with the following command:

sudo docker run \
    --volume=/:/rootfs:ro \
    --volume=/var/run:/var/run:ro \
    --volume=/sys:/sys:ro \
    --volume=/var/lib/docker/:/var/lib/docker:ro \
    --publish=8080:8080 \
    --detach=true \
    --name=cadvisor \
    google/cadvisor:latest

This will start the Cadvisor container in detached mode and expose port 8080.

Step 3: Access Cadvisor Web UI

You can now access the Cadvisor Web UI by opening your web browser and navigating to http://localhost:8080.

If you want to access Cadvisor remotely, replace localhost with the IP address or hostname of your Elementary OS machine.

Congratulations! You have successfully installed Cadvisor on Elementary OS Latest.