Configure Windows Firewall for Grafana

Create minimal, scoped firewall rules for Grafana's HTTP/HTTPS access. Prefer Private/Domain profiles, restrict to subnets, and verify connectivity.

Do you even need an inbound rule?

  • Local only (localhost): No inbound rule required.
  • LAN access: Add an inbound rule on the listening port (default 3000), Private profile only.
  • Internet exposure: Use a reverse proxy with HTTPS and strict firewall scope. Avoid Public networks when possible.

Add inbound rule (PowerShell)

New-NetFirewallRule -DisplayName "Grafana HTTP" -Direction Inbound -Action Allow -Protocol TCP -LocalPort 3000 -Profile Private
Restrict to a subnet (recommended):
New-NetFirewallRule -DisplayName "Grafana HTTP (LAN)" -Direction Inbound -Action Allow -Protocol TCP -LocalPort 3000 -Profile Private -RemoteAddress 192.168.1.0/24

Add inbound rule (netsh)

netsh advfirewall firewall add rule name="Grafana HTTP" dir=in action=allow protocol=TCP localport=3000 profile=private
Restrict to a subnet:
netsh advfirewall firewall add rule name="Grafana HTTP (LAN)" dir=in action=allow protocol=TCP localport=3000 remoteip=192.168.1.0/24 profile=private

HTTPS via reverse proxy

  • Terminate HTTPS at IIS/NGINX/Apache on port 443 with a valid certificate.
  • Open firewall for 443 (Private/Domain) and proxy internally to Grafana's port (e.g., 3000).
  • Restrict scope to required subnets; avoid Public profile when possible.

Change port? Update firewall

  • Grafana default port is 3000. If you change it, adjust the firewall rule accordingly.
  • Delete old rule and add a new one for the new port.
netsh advfirewall firewall delete rule name="Grafana HTTP"

Verify connectivity

Test-NetConnection -ComputerName localhost -Port 3000
netstat -ano | findstr :3000
Open a browser from an allowed machine: http://HOSTNAME:3000

GUI path (Windows Defender Firewall)

  1. Open Windows Defender Firewall with Advanced Security.
  2. Inbound Rules → New Rule… → Port → TCP → Specific local ports: 3000.
  3. Allow the connection → apply to Private (and Domain if applicable).
  4. Name the rule (e.g., "Grafana HTTP") and finish.
  5. Optionally edit the rule's Scope to restrict remote IP addresses.

Common pitfalls

  • Rule on wrong profile (Public only) → clients on Private network still blocked.
  • Endpoint protection or corporate firewall blocking traffic in addition to Windows Firewall.
  • Port already in use by another app — change Grafana port and update rules.
More help: Common Errors