Skip to content

Instantly share code, notes, and snippets.

@hector
Last active January 26, 2020 16:18
Show Gist options
  • Save hector/8b1f0ff4c7f63ec22ad871ddb574dce3 to your computer and use it in GitHub Desktop.
Save hector/8b1f0ff4c7f63ec22ad871ddb574dce3 to your computer and use it in GitHub Desktop.
ngrok as a service
authtoken: YOUR_TOKEN_HERE
json_resolver_url: ""
dns_resolver_ips: []
log: /var/log/ngrok.log
tunnels:
ssh:
proto: tcp
addr: 22

Installation

  1. Download and unzip ngrok to /usr/local/bin/ngrok
  2. Create a configuration file in /etc/ngrok/config.yml
  3. Place authtoken from ngrok website in the configuration file
  4. Copy ngrok.service to /etc/systemd/system/ngrok.service
  5. Execute sudo systemctl enable ngrok.service
  6. Execute sudo systemctl daemon-reload
  7. Execute sudo systemctl start ngrok.service
[Unit]
Description=Share local port(s) with ngrok
After=syslog.target network.target
[Service]
PrivateTmp=true
Type=simple
Restart=always
RestartSec=1min
StandardOutput=null
StandardError=null
ExecStart=/usr/local/bin/ngrok start -config /etc/ngrok/config.yml --all
ExecStop=/usr/bin/killall ngrok
[Install]
WantedBy=multi-user.target
@hector
Copy link
Author

hector commented Apr 24, 2018

https://ngrok.com/docs/ngrok-link#service

It has not worked: this is only for ngrok-link, a special version of ngrok to target procution environment which is not downloadable.

@hector
Copy link
Author

hector commented Apr 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment