Last Updated on December 28, 2025 by Thiago Crepaldi
If you are running a homelab like mine, you probably rely heavily on Proxmox to manage your infrastructure. I recently deployed a monitoring stack using Prometheus and Grafana within a lightweight LXC container, which I will post more about later. Everything was working perfectly until I decided to add metrics for my Plex Media Server.
I found the excellent blog post Plex Pro Week ‘25: Big Data, Big Dashboard that presented the prometheus-plex-exporter project (by Timothy Stewart). This project is based on jsclayton/prometheus-plex-exporter). Everything was looking great, but I hit a snag: the documentation and deployment methods rely almost exclusively on Docker and Docker Compose. Since I am running this inside an LXC container, I didn’t want the added complexity and overhead of installing the Docker daemon just to run a single binary. I may or may not move to a Kubernetes in the future, so I preferred to not get into running Dockr=er within Proxmox for now.
Here is how I reverse-engineered the container setup to run the exporter natively using systemd, with a persistent configuration that survives updates.
The Approach
At its core, prometheus-plex-exporter is written in Go. One of the biggest advantages of Go is that it compiles into a static binary that contains all its dependencies. This means we don’t actually need the Docker image; we just need to compile the binary ourselves and set up a way to feed it the configuration variables it expects.
The Solution
Here is the step-by-step guide to deploying the exporter manually.
1. Prerequisites: Install Go
Since we are building from source, we need the Go compiler and Git installed in our LXC container.
sudo apt update
sudo apt install -y golang git2. Build the Binary
Clone the repository and build the application. We will place the binary in /opt/prometheus-plex-exporter, which can be easily overwritten if we want to update the code later.
# Clone the repo
git clone https://github.com/timothystewart6/prometheus-plex-exporter.git
cd prometheus-plex-exporter
# Build the binary using the vendored dependencies
go build -mod vendor -o prometheus-plex-exporter ./cmd/prometheus-plex-exporter
# Move it to a permanent location
sudo mkdir -p /opt/prometheus-plex-exporter
sudo mv prometheus-plex-exporter /opt/prometheus-plex-exporter/
3. Create Persistent Configuration
We want our configuration (credentials and startup scripts) to live separately from the binary so we can update the application without losing our settings.
Create a directory for persistent configs and add your Plex credentials:
File: /opt/persistent_configs/prometheus-plex-exporter/plex.env
dotenvPLEX_SERVER="http://<your-plex-ip-here>:32400"
PLEX_TOKEN="your-plex-token-here"
4. The Wrapper Script
We need a script to load these variables before starting the exporter. We will store this script in the persistent directory so it doesn’t get deleted if we wipe the /opt/prometheus-plex-exporter folder during an update.
Create the file: /opt/persistent_configs/prometheus-plex-exporter/run_exporter.sh
#!/bin/bash
# Source the environment variables from the persistent config
if [ -f /opt/persistent_configs/prometheus-plex-exporter/plex.env ]; then
set -a
source /opt/persistent_configs/prometheus-plex-exporter/plex.env
set +a
else
echo "Config file not found: /opt/persistent_configs/prometheus-plex-exporter/plex.env"
exit 1
fi
# Execute the binary, replacing the shell process
exec /opt/prometheus-plex-exporter/prometheus-plex-exporter
Make the script executable:
sudo chmod +x /opt/persistent_configs/prometheus-plex-exporter/run_exporter.sh
5. Create the Systemd Service
To ensure the exporter starts on boot and restarts if it crashes, create a Systemd unit file pointing to our persistent wrapper script.
File: /etc/systemd/system/prometheus-plex-exporter.service
[Unit]
Description=Prometheus Plex Exporter
After=network.target
[Service]
Type=simple
User=root
ExecStart=/opt/persistent_configs/prometheus-plex-exporter/run_exporter.sh
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
6. Enable and Start
Reload the daemon and start your new service:
sudo systemctl daemon-reload
sudo systemctl enable prometheus-plex-exporter
sudo systemctl start prometheus-plex-exporter
7. Verification
Before moving on, let’s verify that everything is working at every layer.
Step A: Check if the exporter is running locally Run this command inside your LXC container. You should see a list of metrics (like plex_server_info).
curl -s localhost:9000/metrics | head -n 10
Step B: Check if Prometheus is scraping
- Ensure you have added the target to your Prometheu’s config file (aka
prometheus.yml)scrape_configs:- job_name: 'plex'scrape_interval: 15sstatic_configs:- targets: ['<YOUR_LXC_IP>:9000'] - Restart Prometheus
sudo systemctl enable prometheus
sudo systemctl start prometheus - Open your Prometheus UI (usually port
9090). - Go to Status > Targets.
- Verify that the
plextarget is in the UP state (green).
Step C: Check Grafana
- Open Grafana.
- Import the dashboard from the repo:
examples/dashboards/Media Server.json. - Select your Prometheus data source.
- If the dashboard loads but shows “No Data”, ensure the Job, Instance, and Server variables at the top left are populated. If they are empty, check Step B.
Visualizing in Grafana
The repository comes with a fantastic pre-built dashboard. I originally discovered this dashboard in Timothy Stewart’s cool post for Plex Pro Week ’25: Big Data, Big Dashboard.
It provides incredible visibility into transcode sessions, bandwidth usage, and library growth without needing to build panels from scratch.
Updating the Exporter
One of the benefits of this setup is how easy it is to update. Since we separated the binary from the configuration, we can simply rebuild the binary and replace it.
When a new version of prometheus-plex-exporter is released, follow these steps:
- Pull the latest code:
cd ~/prometheus-plex-exportergit pull origin main# or whatever branch/tag you want - Rebuild the binary:
go build -mod vendor -o prometheus-plex-exporter ./cmd/prometheus-plex-exporter - Replace the running binary:
sudo systemctl stop prometheus-plex-exportersudo systemctl start prometheus-plex-exporter - Verify: Check the status to ensure it started back up correctly:
sudo systemctl status prometheus-plex-exporter
Conclusion
You now have a robust, native Plex exporter running in your LXC container. By separating the binary from the configuration and startup script, you’ve made it easy to update the exporter in the future without breaking your setup.
A huge thanks to Timothy Stewart for building this exporter and sharing the dashboard design with the community!

