Delpoying Grafana, Prometheus and Uptime Kuma

- 7 mins read

Series: Homelab Series

Deploying Grafana, Prometheus and Uptime Kuma

Introduction

So this entries going to be a bit of a doozy everyone. We’re going to be deploying all of our non-security monitoring tools. By that I mean tools that monitor uptime and system resource usage, good old’ fashioned sys admin things. To do this we will be deploying three different services. First off Grafana, a very popular data visualization tool which I cannot express just how much you can do with it. Second, Prometheus, which will be used to scrape the data from our endpoints and will get ingested by Grafana. Finally, Uptime Kuma so that we can monitor the uptime of our services and receive alerts if any of our services go down. So if that sounds fun then stayed tuned for this thrilling addition of homelabs with Karmic!

Deploying our Containers

Alright, as always, let’s make some directories for our config files to live. Pasted image 20260801224139.png And now we’re going to make our Docker Compose file in this monitoring directory. Pasted image 20260801224417.png

# Once again for your copy and paste needs
services:
  prometheus:
    image: prom/prometheus:latest
    container_name: prometheus
    restart: unless-stopped
    command:
      - --config.file=/etc/prometheus/prometheus.yml
      - --storage.tsdb.path=/prometheus
      - --storage.tsdb.retention.time=15d
      - --storage.tsdb.retention.size=5GB
      - --web.enable-lifecycle
    ports:
      - "9090:9090"
    volumes:
      - ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
      - prometheus_data:/prometheus
    mem_limit: 1g
    networks:
      - monitoring

  node-exporter:
    image: quay.io/prometheus/node-exporter:latest
    container_name: node-exporter
    restart: unless-stopped
    command:
      - --path.rootfs=/host
    network_mode: host
    pid: host
    volumes:
      - /:/host:ro,rslave
    mem_limit: 128m

  grafana:
    image: grafana/grafana:latest
    container_name: grafana
    restart: unless-stopped
    depends_on:
      - prometheus
    ports:
      - "3000:3000"
    environment:
      GF_USERS_ALLOW_SIGN_UP: "false"
    volumes:
      - grafana_data:/var/lib/grafana
      - ./grafana/provisioning:/etc/grafana/provisioning:ro
    mem_limit: 512m
    networks:
      - monitoring

  uptime-kuma:
    image: louislam/uptime-kuma:2
    container_name: uptime-kuma
    restart: unless-stopped
    ports:
      - "3001:3001"
    volumes:
      - uptime_kuma_data:/app/data
    mem_limit: 512m
    networks:
      - monitoring

networks:
  monitoring:
    name: monitoring

volumes:
  prometheus_data:
  grafana_data:
  uptime_kuma_data:

Amazing. Now we’re also going to need to make a YAML file under the Prometheus subdirectory as this will tell our Prometheus container where to scrape data from. Pasted image 20260801230035.png

global:
  scrape_interval: 30s
  evaluation_interval: 30s

scrape_configs:
  - job_name: prometheus
    static_configs:
      - targets:
          - prometheus:9090

  - job_name: node
    static_configs:
      - targets:
          - 192.168.50.151:9100
        labels:
          instance: UbuntuDesktop                           

We also need to provision Grafana and Prometheus’s connection with yet another YAML file here. Pasted image 20260801230319.png

# Once again, here you are
apiVersion: 1

datasources:
  - name: Prometheus
    uid: prometheus
    type: prometheus
    access: proxy
    url: http://prometheus:9090
    isDefault: true
    editable: true

Alright, the core of these containers should be good to go, so let’s try spinning them up. Pasted image 20260801230835.pngOkay, so far so good, the container images got pulled down and started and they seem to be all up. Let’s run some tests by curling a few different endpoints. Pasted image 20260801231103.png Awesome, everything is returning 200’s and relevant information so we’re looking good. Let’s now navigate to the /targets endpoint appended to the socket that’s hosting Prometheus. In this case it’s http://192.168.50.151:9090/targets for me. Pasted image 20260801231715.png Awesome we can see some information health in there from our Ubuntu Desktop. So far so good. Let’s now try accessing the Grafana web console on port 3000. Pasted image 20260801231811.png Oh yeah, looking nice. When you first login to Grafana the default creds are admin:admin. It will prompt us to change our password here after we first login. Pasted image 20260801231912.png I changed mine here, make sure you change yours. And now after all that we should land on the Grafana home page. Pasted image 20260801231945.png Amazing, we’re looking good so far. Next we’ve gotta have a way to actually visualize our data.

Creating Dashboard and Visualizing Data

Now it is time make our dashboard and make sure that our Ubuntu Desktop data is being properly ingested. On the lefthand menu click on Dashboards Pasted image 20260801232110.png Alright, here on the Dashboards page we can see all of our Dashboards. Except that we haven’t made one yet. So we are going to click on New, but then we’re going to select Import dashboard as we will be using one of Grafana’s default Dashboards. Grafana is a lot like Kibana, where the sky is the limit with what you can do with Dashboards, so we will just be using a simple one to get us rolling. Pasted image 20260801232221.png After you click Import, we’re going to put 1860 in the Import dashboards field there. Go ahead and enter that and hit load. Pasted image 20260801232421.png Awesome, it recognizes the dashboard ID, just go ahead and hit Import. Pasted image 20260801232553.png And there we go look at that we have our first dashboard with resource data being shown from our Ubuntu Desktop client! Pasted image 20260801232738.png And look at that we have a simple Grafana dashboard going! Let’s add some of our other machines on our network!

Adding Other Hosts to Our Dashboard

Adding our Ubuntu Server

Alright so I think today we’ll add out Ubuntu Server machine and our Proxmox server. I don’t think we’ll be running a Prometheus collector on my Windows workstation, I’m not necessarily interested in having that kind of telemetry in Grafana. We will be setting up other monitoring tools for it later, this is more for our server workloads and whatnot. Okey dokey, so on our Ubuntu Server machine let’s go ahead and make a directory for our Prometheus exporter container to live. Pasted image 20260803105102.png And a little compose file. Pasted image 20260803105202.png

# Copy and Paste Away
services:
  node-exporter:
    image: quay.io/prometheus/node-exporter:latest
    container_name: node-exporter
    restart: unless-stopped
    command:
      - --path.rootfs=/host
    network_mode: host
    pid: host
    volumes:
      - /:/host:ro,rslave
    mem_limit: 128m

That should be that, so let’s get this container running. Pasted image 20260803105442.png Okay, looking good, let’s see if the Prometheus container is responsive. Pasted image 20260803105542.png Okay, localhost works fine, but what about if we query that metrics endpoint from a remote system? Pasted image 20260803111326.png Now, for me this did take a second to work, it was unresponsive for about a minute, but now we’re good. You may need to run docker compose up -d --force-recreate prometheus if it’s giving you a hard time. Alright, time to add our Ubuntu Server to the config on monitoring server. Pasted image 20260803111509.png We’re going to add another section here under job_name. The target being the IP and port of where our Prometheus instance is running and we give it an appropriate label. Pasted image 20260803111635.png So we add our server’s IP and port as a target and give it the UbuntuServer label. Alright let’s reload Prometheus to update the config. Pasted image 20260803111817.png Amazing. Let’s check the /targets endpoint to see if it’s up Pasted image 20260803113217.png And look at that. Okay full disclosure, it wasn’t there at first, I had to force recreate the Prometheus container and then verify the YAML file for the container and the YAML file inside the container where the same because they weren’t so I couldn’t see it. Pasted image 20260803113254.png So with that now fixed we should be able to see our Ubuntu Server in Grafana now. Pasted image 20260803113557.png Awesome, let’s add the Proxmox server.

Adding Proxmox Server

We’re not gonna run Docker on our Proxmox box, so we’ll be just installing the package normally and going from there. Pasted image 20260803120558.png Okay, so we haven’t actually gotten to Proxmox yet in the series so feel free to comeback here later, I never promised this would all be exactly in order. But so let’s install our packages. Run these commands.

sudo apt update
sudo apt install prometheus-node-exporter
sudo systemctl enable --now prometheus-node-exporter
sudo systemctl status prometheus-node-exporter
curl -fsS http://localhost:9100/metrics | head

Pasted image 20260803120835.png So after all those run and you curl localhost’s metrics endpoint that should be that. Back to the monitoring server to add our Proxmox server to the config. Pasted image 20260803121025.png Okay time to recreate the container and verify the hash again. Pasted image 20260803121129.png Okay very good, let’s check the targets endpoint. Pasted image 20260803121234.png Ayo, and check Grafana.Pasted image 20260803121408.png Very good. Now, time for Uptime Kuma

Uptime Kuma

Now to finish uptime Kuma Pasted image 20260801233320.png We’re choosing SQLite Pasted image 20260801233358.png Make account Pasted image 20260801233510.png Alright, time to add a new Monitor, click Add New Monitor. Pasted image 20260803122511.png For our first monitor, let’s fittingly do a health check for the Grafana web GUI. Pasted image 20260803122747.png So here is the Monitor with the General information filled out. Let’s actually set up the Notification. Click on the Set Up Notification button. Pasted image 20260803123048.png So I setup a webhook to just get pinged on Discord via a private channel whenever there’s an issue. Let’s test it! Pasted image 20260803123145.png And look at that. Now I am personally going to do this for several service, but that concludes you needing to watch me do that. Pasted image 20260803124926.png So here are all the monitors we have for right now. There will be many more to come, but that is all for now!

Conclusion