Skip to content

Instantly share code, notes, and snippets.

@apfelchips
Last active August 2, 2021 14:38
Show Gist options
  • Save apfelchips/823c462a17ad1292c4179d0c4ca94017 to your computer and use it in GitHub Desktop.
Save apfelchips/823c462a17ad1292c4179d0c4ca94017 to your computer and use it in GitHub Desktop.
autostart ngrok with systemd - put binary and ngrok.yml into /opt/ngrok/
# put me in: /etc/systemd/system/
# ngrok binary: https://ngrok.com/download
# sudo chmod +x /opt/ngrok/ngrok
[Unit]
Description=ngrok
After=network.target
[Service]
ExecStart=/opt/ngrok/ngrok start --all --config /opt/ngrok/ngrok.yml
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
IgnoreSIGPIPE=true
Restart=always
RestartSec=3
Type=simple
User=daemon
Group=daemon
[Install]
WantedBy=multi-user.target
# doc: https://ngrok.com/docs#tunnel-definitions
authtoken: xxxx
region: eu
tunnels:
ssh:
proto: tcp
addr: 22
# myapp-http:
# addr: 80
# proto: http
# hostname: example.com
# auth: "user:secretpassword"
# bind_tls: false
# myapp-https:
# addr: 443
# proto: tls
# hostname: example.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment