This repository provides a complete guide and script to install and run Prometheus Node Exporter as a systemd service on Ubuntu (native or WSL with systemd support).
- Auto-download and install Node Exporter
- Create a dedicated user
- Configure and enable systemd service
- Persistent monitoring on reboots
| File | Description |
|---|---|
node_exporter_service_setup.sh |
Bash script to install Node Exporter as a service |
node_exporter.service (auto-generated) |
systemd unit file used by the script |
- Clone this repository:
git clone https://github.com/your-username/node-exporter-service.git
cd node-exporter-service- Make the script executable:
chmod +x node_exporter_service_setup.sh- Run the script:
./node_exporter_service_setup.sh- Check Node Exporter status:
systemctl status node_exporterAfter successful setup, you can view metrics at:
http://localhost:9100/metrics
If you're using WSL2:
- Ensure
systemdis enabled in your WSL distro (e.g., viagenie) - Alternatively, run node_exporter manually with:
/usr/local/bin/node_exporter