• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

[SOLVED] Ngrok – Run Raspberry Pi Command on Background (close SSH window)

Q&A Forum › Category: Home Automation › [SOLVED] Ngrok – Run Raspberry Pi Command on Background (close SSH window)
0 Vote Up Vote Down
yvonne asked 6 years ago

Dear Rui,

I can access my ui via ngrok, but on page 206 you write:

You can close the SSH window, but you can’t quit the ngrok software otherwise the tunnel stops.

I don’t understand that.

The ngrok is installed on the raspi. I can setup a ssh connection from my pc to the raspi and i type in ./ngrok http -auth=”name:password” 1880.

I can access the ui from any pc anywhere with my unique link.

But then I shut down my pc, while the raspberry pi is still running. That moment the SSH window is closed, but it seems to me that the ngrok software stopped as well, because from that moment on, I can’t access the ui from any pc or mobile.

That’s where I don’t understand how I don’t quit ngrok software.

I thought that the connection was made with the raspberry pi where the node-red software runs.

Thank you for your help.

Yvonne

3 Answers
0 Vote Up Vote Down
Rui Santos Staff answered 6 years ago

Hello Yvonne,

I need to update those instructions to show you how to do that, but in the meanwhile. Here’s what to do:

1. You need to install a software called screen, so that your command can be executed in the background. To install screen:

sudo apt install screen

2. Then, run the ngrok software on the background:

screen -d -m ./ngrok http -auth="yourusername:yourpassword" 1880

3. You won’t see anything being printed in the terminal window, so you must login into the ngrok website to find the ngrok URL to access from anywhere.

Does that work for you?

0 Vote Up Vote Down
yvonne answered 6 years ago

Hallo Rui,
Yes that works.
Thank you so much.
I’m sure this isn’t the last time I bother you;)
Have a nice day.
Yvonne

0 Vote Up Vote Down
Rui Santos Staff answered 6 years ago

I’ll mark this thread as “Resolved”. If you have more questions, feel free to post them 🙂
Have a nice day too. Regards,
Rui

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.