Search code examples
raspbianngrok

Ngrok session expired (raspberry project)


I've made a server on my raspberry and a mobile app to control it. I can connect to it when my mobile is connected to the same net, but I cannot do it outside of the net.

Actually I'm using ngrok to reach it but the session expires in 8 hours.

Is there any way to keep it on all the time I want? (or kind of, like a script that auto execute ngrok if the system detects that is not running)

And without ngrok how could I reach that server?


Solution

  • You can keep the ngrok on all the time by using the authtoken. https://ngrok.com/docs#authtoken

    First, go to ngrok website and login with an account. Then, go to the dashboard and get the token from Step 3 (Connect your account).

    Run the command

    ngrok authtoken <YOUR_TOKEN>