Installing Prometheus and Grafana in PVE Containers
I wanted an alternative display for metrics and I figured I would play around a bit with Proxmox's LXC's (as opposed to installing a whole VM to run these services). This guide is based on https://pywkt.com/post/20230302-prometheus-and-grafana-on-proxmox, with updates suited for 2026.
First, create a container in the PVE ui. In terms of resources, I provided it 2cpu, 2gb mem, 8gb storage, I used the Debian 12 template because a) I'm a Debian enthusiast and b) that's what was listed in the UI. I would've preferred 13, but that's a later project. I added a root password and my PC's SSH key on the first tab so I could log in remotely.
Create a group/user
groupadd --system prometheus \
useradd -s /sbin/nologin --system -g prometheus prometheusCreate directories
mkdir /var/lib/prometheus \
for i in rules rules.d files_sd; do mkdir -p /etc/prometheus/${i}; doneDownload/install Prometheus
mkdir -p /tmp/prometheus && cd /tmp/prometheus \
curl -s https://api.github.com/repos/prometheus/prometheus/releases/latest \
| grep browser_download_url \
| grep linux-amd64 \
| cut -d '"' -f 4 \
| wget -qi -Extract files and move to correct directory
tar xvf prometheus*.tar.gz \
cd prometheus \
mv prometheus promtool /usr/local/bin/ \
mv prometheus.yml /etc/prometheus/prometheus.yml \Create systemd config
cd /etc/systemd/system/ && touch prometheus.servicevi prometheus.servicePaste in the following and save
[Unit]
Description=Prometheus
Documentation=https://prometheus.io/docs/introduction/overview/
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
User=prometheus
Group=prometheus
ExecReload=/bin/kill -HUP $MAINPID
ExecStart=/usr/local/bin/prometheus \
--config.file=/etc/prometheus/prometheus.yml \
--storage.tsdb.path=/var/lib/prometheus \
--web.console.templates=/etc/prometheus/consoles \
--web.console.libraries=/etc/prometheus/console_libraries \
--web.listen-address=0.0.0.0:9090 \
--web.external-url=
SyslogIdentifier=prometheus
Restart=always
[Install]
WantedBy=multi-user.targetFinally, start prometheus:
systemctl enable --now prometheusI'm not using this for PVE data exports, so I am skipping the PVE exporter config. Onto Grafana setup!
apt-get install apt-transport-https software-properties-common wgetwget -q -O /usr/share/keyrings/grafana.key https://apt.grafana.com/gpg.keyecho "deb [signed-by=/usr/share/keyrings/grafana.key] https://apt.grafana.com stable main" | tee -a /etc/apt/sources.list.d/grafana.listapt-get updateapt-get install grafana-enterprisesystemctl daemon-reloadsystemctl enable --now grafana-server.serviceCheck that it's running
systemctl status grafana-serverIf everything looks good, you should be able to go to http://<grafana-container-ip>:3000 and see the login screen!