Problem with accessing YunoHost services through ngrok

  • Hardware: Raspberry Pi at home
  • YunoHost version: 11.2.4
  • I have access to my server: Through SSH and through the webadmin
  • Are you in a special context or did you perform some particular tweaking on your YunoHost instance? Yes
  • If yes, please explain: I don’t have access to my router settings, so I’m trying to use ngrok to access my YunoHost instance from outside my local network.

Description of my issue

I’m trying to set up remote access to my YunoHost instance hosted on a Raspberry Pi. Since I don’t have access to my router settings, I decided to use ngrok as a workaround. I successfully set up ngrok and opened the 443 port. When I use the ngrok-provided URL, it redirects me to the YunoHost admin panel instead of the user panel.

Here’s what I’ve done so far:

  1. Installed YunoHost on a Raspberry Pi.
  2. Configured WiFi access for the Raspberry Pi.
  3. Installed and set up ngrok to forward the 443 port.
  4. When accessing the ngrok URL (e.g., https://randomstring.ngrok.io), I’m redirected to the YunoHost admin panel (https://randomstring.ngrok.io/yunohost/admin/#/) instead of the user panel. For instance, when I try to access https://randomstring.ngrok.io/mattermost , I expect to land on the Mattermost application. Instead, I’m redirected to the YunoHost admin panel.

I’d like to know how I can configure YunoHost or ngrok to redirect to the user panel instead of the admin panel when accessing from the ngrok URL. Any help or guidance would be greatly appreciated!

Hello, and welcome!

This worked for me:

  1. Configure a working domain in YunoHost (I chose vps.local), install an app on it.
  2. Create an ngrok account
  3. Download ngrok’s binary
  4. Create a Domain in ngrok’s user panel, e.g. still-smooth-chipmunk.ngrok-free.app
  5. Run ngrok http --domain=still-smooth-chipmunk.ngrok-free.app https://vps.local --host-header=vps.local
  6. Profit

The --host-header flag instructs YunoHost to serve http for vps.local instead of the ngrok domain:

Note that these ngrok domains are not meant to support all your usual services (DNS, mail, notably). Expect the YunoHost diagnosis to complain about them (you can ignore the warnings).


It seems it can also work if you add the ngrok domain like any other domain in the webadmin. Diagnosis will still complain about it.

ngrok http --domain=still-smooth-chipmunk.ngrok-free.app https://localhost

1 Like

Hey,

Just wanted to drop a quick thank you for your spot-on response. Seriously, you saved me from spending hours (or even more, knowing myself :sweat_smile:) on this issue. Your answer was a game-changer!

Oh, and a big shoutout to ChatGPT for helping me navigate through this network maze. But for real, without your reply, I’d still be scratching my head over this.

Big thanks!

And also… Thank you for warm welcome :upside_down_face:

Hey @tituspijean its me again :smiley:

Thanks to your help, I’ve successfully set up mydomain.ngrok.app/mattermost and mydomain.ngrok.app/yunohost/admin (for which I’m very grateful!). However, I’ve noticed an issue accessing mydomain.ngrok.app/yunohost/sso, which seems to be the main application page.

Out of pure curiosity, I’d like to understand why this specific path isn’t working correctly. Is this related to the earlier mention that “ngrok domains are not meant to support all your usual services”? In general it does not bother me that much because Mattermost is working but Im just curious and really keen to learn in this topic. Im new to this :slight_smile:

Have a nice day!

For the SSO address, my guess is that it actually tries to redirect you to the main domain as set in the webadmin, which is most likely not the ngrok domain.

Someday, in a future version of YunoHost, we hope to make sure each domain has its own SSO portal (so no redirection). We cannot give timelines, but keep posted. :slight_smile:

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.