⚙️ Guide

Install Grafana as a Windows Service

Run Grafana automatically at Windows startup as a managed service. This guide covers the MSI service setup, service account configuration, PowerShell management commands and troubleshooting when the service won't start.

How the Grafana Windows Service works

The Grafana MSI installer automatically registers a Windows Service named Grafana. The service runs the Grafana backend process (grafana-server.exe) under the LocalSystem account by default. It can be reconfigured to use a dedicated service account for better security isolation.

The service is created during MSI installation. If you installed Grafana manually (zip), see the manual service registration section below.

Verify and configure via Services console

1

Open Services

Press Win + R, type services.msc, press Enter. Scroll to find Grafana in the list.

2

Set Startup type to Automatic

Double-click the Grafana service → General tab → set Startup type to Automatic (or Automatic (Delayed Start) if you want it to start after other services). Click Apply.

3

Start the service

Click Start in the service properties dialog or right-click the Grafana row and choose Start. Wait a few seconds for it to initialise.

4

Verify in browser

Open http://localhost:3000. You should see the Grafana login page. Default credentials: admin / admin — change immediately.

Manage the service with PowerShell

All common service operations can be performed from an elevated PowerShell prompt.

# Check service status Get-Service -Name "Grafana" # Start the service Start-Service -Name "Grafana" # Stop the service Stop-Service -Name "Grafana" # Restart the service Restart-Service -Name "Grafana" # Set to start automatically at boot Set-Service -Name "Grafana" -StartupType Automatic # Disable the service (prevent startup) Set-Service -Name "Grafana" -StartupType Disabled
Tip: Run PowerShell as Administrator for all service management commands. Right-click the PowerShell icon → Run as administrator.

Configure a dedicated service account (recommended for production)

Running services as LocalSystem grants broad system access. For production, create a dedicated Windows account with minimal permissions.

1

Create a local service account

# Create a new local user for the Grafana service $pw = ConvertTo-SecureString "YourStrongPassword!" -AsPlainText -Force New-LocalUser -Name "svc-grafana" -Password $pw -Description "Grafana service account" -PasswordNeverExpires $true -UserMayNotChangePassword $true
2

Grant access to Grafana data directory

# Grant the service account full control of the Grafana data path $path = "C:\Program Files\GrafanaLabs\grafana\data" $acl = Get-Acl $path $rule = New-Object System.Security.AccessControl.FileSystemAccessRule("svc-grafana","FullControl","ContainerInherit,ObjectInherit","None","Allow") $acl.SetAccessRule($rule) Set-Acl $path $acl
3

Change service Log On account

Open services.msc → double-click Grafana → Log On tab → select This account → enter .\svc-grafana and the password → Apply → Restart service.

Manual service registration (zip install)

If you installed Grafana from a zip archive rather than the MSI, register the service manually with grafana-server.exe:

# Run from an elevated prompt in the Grafana bin directory # e.g. C:\grafanaingrafana-server.exe --config="..\conf\grafana.ini" --homepath=".." windows-service install # Then start it Start-Service -Name "Grafana"
Note: Adjust paths to match your actual install location. The --homepath must point to the directory containing the conf and data folders.

Troubleshooting: service won't start

Check Event Viewer

Open Event Viewer → Windows Logs → Application. Filter by source Grafana. Error messages here usually indicate the exact cause — port conflict, permission issue or missing config file.

Check Grafana logs directly

# Default log location Get-Content "C:\Program Files\GrafanaLabs\grafana\data\log\grafana.log" -Tail 50

Port already in use

If the log shows listen tcp :3000: bind: Only one usage of each socket address, port 3000 is occupied. Find the process and stop it, or change Grafana's port — see Change port guide.

Permission denied on data directory

The service account needs full control of the data directory. Re-run the ACL commands above or check folder permissions in Explorer → Properties → Security.

For more issues, see Common errors & troubleshooting.

Next: configure Grafana

With the service running, configure the port, paths and authentication in grafana.ini, then set up HTTPS for production access.

grafana.ini Guide → Set up HTTPS Firewall Rules