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

# Local Tunnel

Upstash Workflow requires your application to be publicly accessible in production.
The recommended approach is running the development server we provide locally and work with local addresses.
An alternative is to making your application publibly accessible so that you can work with the managed Upstash Workflow servers.

The easiest way to make a local URL publically available is [ngrok](https://ngrok.com), a free tunneling service.

Create an account on [dashboard.ngrok.com/signup](https://dashboard.ngrok.com/signup) and follow the [setup instructions](https://dashboard.ngrok.com/get-started/setup) to download the ngrok CLI and connect your account. This process takes only a few minutes and is totally free.

You can connect your account like this:

<Tabs>
  <Tab title="macOS">
    <Frame>
      <img src="https://mintcdn.com/upstash/V1WwT580M-elE8rq/img/qstash-workflow/ngrok_mac_setup.png?fit=max&auto=format&n=V1WwT580M-elE8rq&q=85&s=b97dd2ce9a636055d0fb70f7b84b5bf1" width="1260" height="693" data-path="img/qstash-workflow/ngrok_mac_setup.png" />
    </Frame>
  </Tab>

  <Tab title="Windows">
    <Frame>
      <img src="https://mintcdn.com/upstash/V1WwT580M-elE8rq/img/qstash-workflow/ngrok_windows_setup.png?fit=max&auto=format&n=V1WwT580M-elE8rq&q=85&s=757344c0a66d7d545bc423d323d9345c" width="1260" height="693" data-path="img/qstash-workflow/ngrok_windows_setup.png" />
    </Frame>
  </Tab>
</Tabs>

Once you have installed the ngrok CLI, add your ngrok-issued auth token like this:

```bash Terminal theme={"system"}
ngrok config add-authtoken <YOUR-AUTH-TOKEN>
```

and replace `<YOUR-AUTH-TOKEN>` with your actual auth token.

### Start the tunnel

Make your local server available publically by running the following command:

```bash theme={"system"}
ngrok http <PORT>
```

for example, if your Next.js server is running on port `3000`, the command is:

```bash theme={"system"}
ngrok http 3000
```

The output will look something like this:

```plaintext theme={"system"}
Session Status                online
Account                       <YOUR-NAME> (Plan: Free)
Version                       3.1.0
Region                        Europe (eu)
Latency                       -
Web Interface                 http://127.0.0.1:4040
Forwarding                    https://e02f-2a02-810d-af40-5284-b139-58cc-89df-b740.eu.ngrok.io -> http://localhost:3000
Connections                   ttl     opn     rt1     rt5     p50     p90
                              0       0       0.00    0.00    0.00    0.00
```

The long URL in the `Forwarding` line serves the same purpose as your localhost URL, the only difference being that it is publically accessible. We need this URL to make our workflow available to QStash for local development, either as the `baseUrl` parameter or the `UPSTASH_WORKFLOW_URL` environment variable (both options provide the same functionality).

Note: The `UPSTASH_WORKFLOW_URL` environment variable is only necessary for local development. In production, the `baseUrl` parameter is automatically set and can be omitted.

<Tip>
  Ensure that the port of your local server matches the one you're using with ngrok. For example, if your server is
  running on port 8080, use `ngrok http 8080`.
</Tip>
