Install Grafana as a Windows Service
Run Grafana reliably on Windows by installing it as a service. This guide covers startup types, accounts, ports & firewall, logs, and quick fixes.
Prerequisites
- Grafana installed via the official Windows x64 MSI.
- Administrative privileges on the machine.
- Port 3000 available (or choose a custom port and update firewall rules).
Service setup (GUI)
- Open Services (services.msc) and locate Grafana.
- Open Properties → set Startup type to Automatic.
- Click Start to run the service.
- Verify: open http://localhost:3000.
Service control (PowerShell)
Get-Service grafanaStart-Service grafanaStop-Service grafanaSet-Service -Name grafana -StartupType AutomaticUse an elevated PowerShell window.
Create service manually (if needed)
If the MSI didn't register the service, you can create one manually. Adjust the paths as needed.
sc.exe create grafana binPath= "C:\\Program Files\\GrafanaLabs\\grafana\\bin\\grafana-server.exe --config C:\\Program Files\\GrafanaLabs\\grafana\\conf\\default.ini" start= autosc.exe start grafanaNote: Paths may differ depending on your installation folder.
Service account & permissions
- Default: Local System. Simple, but broad rights.
- Recommended: a dedicated service account with least privileges needed (read logs, bind to port, read config).
- If using a custom account, grant Log on as a service and file/port access as required.
Harden access by restricting Windows Firewall scope to necessary subnets and enabling HTTPS behind a reverse proxy.
Ports & Windows Firewall
- Default port: 3000. Changeable in Grafana config.
- Create a firewall rule to allow inbound traffic on your chosen port for specific networks.
See Windows Firewall guide for step-by-step rules.
Logs & data
- Check service status in Event Viewer → Windows Logs → Application/System.
- Grafana logs and data reside under the Grafana data directory (see your installation config).
Troubleshooting
- Service won't start: check Event Viewer and Grafana logs; ensure the port isn't in use.
- Port in use (3000): find the process using netstat/Resource Monitor, change Grafana port and update firewall rules.
- Permission issues: run as admin; if using a custom account, grant necessary rights.
- After upgrade fails: stop the service, restore backup, consider previous MSI (see Upgrade & Rollback).
See also: Common Errors.