SOP 005: Install ngrok as a Windows Service ​
Fresh| Field | Value |
|---|---|
| SOP ID | SOP-005 |
| Version | 1.0 |
| Status | Active |
| Last Updated | 2026-02-13 |
Purpose ​
Install ngrok as a native Windows service so it starts automatically on boot, restarts after crashes, and runs continuously in the background.
Prerequisites ​
- ngrok installed and authenticated
- Administrator privileges
- A valid ngrok configuration file with endpoints defined
Procedure ​
Step 1: Create Configuration File ​
Create or edit the ngrok config file. Recommended location: C:\ngrok\ngrok.yml
bash
ngrok config editExample config with endpoints:
yaml
version: "3"
authtoken: YOUR_AUTHTOKEN
endpoints:
- name: webapp
url: https://your-domain.ngrok.app
upstream:
url: 8080
protocol: http1
- name: api
url: https://your-api.ngrok.app
upstream:
url: 3000
protocol: http1Step 2: Validate Configuration ​
bash
ngrok config checkStep 3: Install the Service ​
Run as Administrator:
bash
ngrok service install --config C:\ngrok\ngrok.ymlImportant
Do NOT move or delete the ngrok executable or config file after installation. The service references their exact locations.
Step 4: Start the Service ​
bash
ngrok service startStep 5: Verify ​
Check Windows Services (services.msc) for the ngrok service, or run:
bash
ngrok service statusService Management Commands ​
| Command | Description |
|---|---|
ngrok service install --config PATH | Install the service |
ngrok service start | Start the service |
ngrok service stop | Stop the service |
ngrok service restart | Restart the service |
ngrok service uninstall | Remove the service |
What the Service Does ​
- Starts when Windows boots
- Automatically restarts after crashes
- Manageable via Windows Services panel
- Logs errors and warnings to Windows Event Log
- Runs all endpoints defined in config (equivalent to
ngrok start --all)
Verification Checklist ​
- [ ] Config file exists and is valid
- [ ] Service installed successfully
- [ ] Service appears in Windows Services
- [ ] Service status is "Running"
- [ ] Endpoints are accessible via public URLs
- [ ] Service survives a system restart
Troubleshooting ​
| Issue | Solution |
|---|---|
| Exit code 5 | Config file not found or no permission to access it |
| Input/output error | Same as exit code 5 — verify config path |
| Service won't start | Check Windows Event Log for detailed errors |
| Permission denied | Run commands as Administrator |
| Endpoints not accessible | Verify the upstream services are running |