> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stably.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Localhost Support

> Test your localhost applications with Stably using the CLI to create secure tunnels and enable local development testing.

<Note>
  This documentation is for **Stably Classic**. For the new Stably Web Editor, see [Stably Web Editor](/stably/stably-web-editor).
</Note>

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](https://ngrok.com), 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):

```bash theme={null}
# 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](https://ngrok.com/download) and install it.

2. Create a free ngrok account at [https://ngrok.com](https://ngrok.com)

3. Authenticate ngrok with your auth token (available in your ngrok dashboard):

```bash theme={null}
ngrok config add-authtoken YOUR_NGROK_AUTH_TOKEN
```

### Step 3: Create the Tunnel

Run ngrok to create a tunnel to your local application:

```bash theme={null}
# Replace 3000 with your application's port
ngrok http 3000
```

For example, if your app runs on port 8080:

```bash theme={null}
ngrok http 8080
```

ngrok will display output similar to:

```
ngrok                                       (Ctrl+C to quit)

Session Status                online
Account                       your-email@example.com
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](https://app.stably.ai) 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.
