When developing apps with [`shopify app dev`](/docs/api/shopify-cli/app/app-dev), you have multiple options for connecting your local development server to Shopify:
- [Cloudflare Quick Tunnels](#cloudflare-quick-tunnels) (default)
- [Localhost-based development](#localhost-based-development)
- [Bring your own tunnel](#bring-your-own-tunnel) (such as ngrok)
Choose the option that best fits your development needs and environment.
## Cloudflare Quick Tunnels
By default, Shopify uses [Cloudflare Quick Tunnels](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/do-more-with-tunnels/trycloudflare/) to open a publicly accessible tunnel to your app. Tunneling provides a secure (HTTPS) URL to your local environment.
> Tip:
> If you're experiencing connectivity errors with Cloudflare Quick Tunnels, refer to [Cloudflare guidance](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/configure-tunnels/tunnel-with-firewall/) on firewall requirements, or try one of the alternatives in this guide.
## Localhost-based development
When using Shopify CLI 3.77 or higher, you can serve your app using `localhost` (`127.0.0.1`) with a self-signed HTTPS certificate, which Shopify CLI generates for you.
To serve your app using `localhost`, run the following command:
> Note:
> Localhost-based development isn't compatible with the Shopify features that directly invoke your app, such as [Webhooks](/docs/apps/build/webhooks), [App proxy](/docs/apps/build/online-store/display-dynamic-data), and [Flow actions](/docs/apps/build/flow/actions), and features that require you to test your app from another device, such as [POS](/docs/apps/build/pos).
## Bring your own tunnel
The [`--tunnel-url` argument](/docs/api/shopify-cli/app/app-dev#flags-propertydetail-tunnelurlvalue) allows you to specify the URL of an alternate network tunnel to your app. You can use this argument with [ngrok](https://ngrok.com/) with the following steps:
1. Set up an [ngrok](https://ngrok.com/) account.
1. Install the [ngrok CLI](https://ngrok.com/download).
1. Follow the steps in the ngrok documentation to [set up your access token](https://ngrok.com/docs/agent/#authtokens).
1. In a terminal, start ngrok using the following command. You can alternatively choose another port number.
1. Note the URL ending in `ngrok-free.app` that's returned - you'll need this URL in the following command - and leave ngrok running.
1. Run `app dev` using the `--tunnel-url` argument. If you've chosen another port number, then use that instead.