Skip to main content
This documentation is for Stably Classic. For the new Stably Web Editor, see Stably Web Editor.
Stably supports creating tests on localhost. This is useful if you want to test your application in a local environment.

Setting Up Localhost Testing

To create tests for your localhost application, you need to expose your local server to the internet using a tunneling service. We recommend using ngrok, a popular and reliable tunneling solution.

Step 1: Start Your Local Application

First, ensure your application is running locally on your desired port (e.g., 3000):
# Example: Start your application
npm start  # or your application's start command
Make note of the port your application is running on (default is usually 3000, 8000, or 8080).

Step 2: Install and Set Up ngrok

  1. Download ngrok from https://ngrok.com/download and install it.
  2. Create a free ngrok account at https://ngrok.com
  3. Authenticate ngrok with your auth token (available in your ngrok dashboard):
ngrok config add-authtoken YOUR_NGROK_AUTH_TOKEN

Step 3: Create the Tunnel

Run ngrok to create a tunnel to your local application:
# Replace 3000 with your application's port
ngrok http 3000
For example, if your app runs on port 8080:
ngrok http 8080
ngrok will display output similar to:
ngrok                                       (Ctrl+C to quit)

Session Status                online
Account                       [email protected]
Version                       3.x.x
Region                        United States (us)
Forwarding                    https://xxxx-xx-xxx-xxx-xx.ngrok.io -> http://localhost:3000
Connections                   0/0

Step 4: Use Your Public URL

Copy the forwarding URL (e.g., https://xxxx-xx-xxx-xxx-xx.ngrok.io) and use it in the Stably App to point your tests to your local environment.

Important Notes

  • The tunnel will remain active as long as the ngrok process is running. To stop the tunnel, press Ctrl+C in your terminal.
  • Free ngrok accounts have some limitations (session timeout after 2 hours, limited bandwidth). For production testing or longer sessions, consider upgrading to a paid plan.
  • Each time you restart ngrok, you’ll get a new public URL. For persistent URLs, ngrok offers this feature on paid plans.