ngrok
                                
                                 ngrok copied to clipboard
                                
                                    ngrok copied to clipboard
                            
                            
                            
                        Selfhosting: Provide Let's Encrypt usage?
Hey!
I'd like to host ngrok from my own server, which is currently using Let's Encrypt certs (/etc/letsencrypt/live/$domain/{privkey,chain,fullchain,cert}.pem).
I am unsure which file goes where, and would like to suggest adding a suggestion to SELFHOSTING.md for other users, since Let's Encrypt is widely used.
Thanks and kind regards, Ingwie
I have the same quesstion.
Hey!
I'd like to host ngrok from my own server, which is currently using Let's Encrypt certs (
/etc/letsencrypt/live/$domain/{privkey,chain,fullchain,cert}.pem).I am unsure which file goes where, and would like to suggest adding a suggestion to
SELFHOSTING.mdfor other users, since Let's Encrypt is widely used.Thanks and kind regards, Ingwie
/etc/letsencrypt/live/$domain/privkey.pem is your private key, rename it to private.key。 /etc/letsencrypt/live/$domain/fullchain.pem is certificate file,rename it to xxx.crt。 Adding -tlskey and -tlsCrt parameter when running ngrokd。 -tlskey=private.key, -tlsCrt=xxx.crt I hope to help you ^_^
Would someone be able to link a tutorial for self hosted ngrok using letsencrypt for ssl?
I think I got it working! I hope to write a blog about it, but these are the general steps:
NOTE: The ngrok cli you download is version 2. When compiling, you are working with version 1. They are incompatible for this effort
- Install Certbot
- Generate and install Wildcard certificate.  (Wildcard is needed to support custom hostnames, e.g. blah.ngrok.example.com).
- My DNS registrar isn't supported, so this was a manual process and took me a while to get right. sudo certbot certonly -d '*.ngrok.example.com' --manual
 
- My DNS registrar isn't supported, so this was a manual process and took me a while to get right. 
- Compile (requires golang). make release-server release-client
- sudo bin/ngrokd -tlsKey="/etc/letsencrypt/live/ngrok.example.com/privkey.pem" -tlsCrt="/etc/letsencrypt/live/ngrok.example.com/fullchain.pem" -domain="ngrok.example.com"
- Create a config: echo -e "server_addr: ngrok.example.com:4443\ntrust_host_root_certs: true" > ngrok-config
- Run client: ./ngrok -config=ngrok-notify.yaml 80
A few gotchas:
- The Wildcard cert is important, and took me a while to get right.
- You will need to compile client and server
I'm sure there's a lot more steps required, but after fighting with this for hours, I wanted to detail my steps so far.
Notice Here
echo -e "server_addr: *.ngrok.example.com:4443\ntrust_host_root_certs: true" > ngrok-config
./ngrok -config=ngrok-config.yaml 80
See tutorial: https://medium.com/@shivanshvij/a-self-hosted-ngrok-45bcec06d0cf
https://gist.github.com/lyoshenka/002b7fbd801d0fd21f2f
I think I got it working! I hope to write a blog about it, but these are the general steps:
NOTE: The ngrok cli you download is version 2. When compiling, you are working with version 1. They are incompatible for this effort
Install Certbot
Generate and install Wildcard certificate. (Wildcard is needed to support custom hostnames, e.g. blah.ngrok.example.com).
- My DNS registrar isn't supported, so this was a manual process and took me a while to get right.
sudo certbot certonly -d '*.ngrok.example.com' --manual
Compile (requires golang).
make release-server release-client
sudo bin/ngrokd -tlsKey="/etc/letsencrypt/live/ngrok.example.com/privkey.pem" -tlsCrt="/etc/letsencrypt/live/ngrok.example.com/fullchain.pem" -domain="ngrok.example.com"
Create a config:
echo -e "server_addr: ngrok.example.com:4443\ntrust_host_root_certs: true" > ngrok-config
Run client:
./ngrok -config=ngrok-notify.yaml 80A few gotchas:
- The Wildcard cert is important, and took me a while to get right.
- You will need to compile client and server
I'm sure there's a lot more steps required, but after fighting with this for hours, I wanted to detail my steps so far.
Before step
- Compile (requires golang).
make release-server release-client
You should copy the pem to client tls:
sudo cp /etc/letsencrypt/live/ngrok.example.com/fullchain.pem assets/client/tls/ngrokroot.crt
then compile it
# Linux
make release-server release-client
# mac
$ GOOS=darwin GOARCH=amd64 make release-client
# windows
$ GOOS=windows GOARCH=amd64 make release-client
@ajaxsys Congrats! I'd be very interested in your blog. I've tried implementing this a few other options, but hit different walls. If you've got a blog/full documentation for it, I'd be very interested.
@lastcoolnameleft
I am now moved to
https://github.com/fatedier/frp
It's very simple to use, NO compile, just download & config & run.
For ssl support, just make nginx(http server, which can easily integrate with Let's encrypt) proxy pass to frp
Thanks for sharing! FRP seems to be just what I was looking for.
Thank you for opening this issue! As of April 2016, the ngrok service has permanently moved to https://ngrok.com/. To join the community and file bug reports or feature enhancements for the ngrok agent, please go to https://github.com/ngrok/ngrok.
This repository is no longer actively maintained and will be archived soon to reduce confusion with the latest ngrok versions. We thank you for the continued support of ngrok and look forward to seeing you over at ngrok.com and the ngrok Community Repo.