Plain is headed towards 1.0! Subscribe for development updates →

 1# plain.tunnel
 2
 3**Connect to your local development server remotely.**
 4
 5The Plain Tunnel is a hosted service, like [ngrok](https://ngrok.com/) or [Cloudflare Tunnel](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/), that is specifically designed to work with Plain and provide the minimum set of features you need to get your local development server connected to the internet. It will provision a subdomain of plaintunnel.com for you, and forward traffic to your local development server.
 6
 7This is especially useful for testing webhooks, doing mobile styling on a real device, or temporarily sharing your local development URL with someone.
 8
 9_Note: In the future this will likely require a small subscription to use custom subdomains (vs randomly generated ones)._
10
11## Usage
12
13The simplest way to use `plain.tunnel` is to install it from PyPI (`uv add plain.tunnel --dev`), then add it to your `plain.dev` configuration.
14
15```toml
16[tool.plain.dev.run]
17tunnel = {cmd = "plain tunnel $PLAIN_DEV_URL --subdomain myappname --quiet"}
18```
19
20To show a tunnel URL (whether you are using `plain.tunnel` or not), you can add `PLAIN_DEV_TUNNEL_URL` to your local `.env` file.
21
22```bash
23PLAIN_DEV_TUNNEL_URL=https://myappname.plaintunnel.com
24```
25
26![](https://assets.plainframework.com/docs/plain-dev-tunnel.png)
27
28Depending on your setup, you may need to add your tunnel to the `settings.ALLOWED_HOSTS`, which can be done in `settings.py` or in your dev `.env`.
29
30```bash
31PLAIN_ALLOWED_HOSTS='["*"]'
32```
33
34## CLI
35
36To use `plain.tunnel` manually, you can use the `plain tunnel` command (or even use it as a one-off with something like `uvx plain-tunnel`).
37
38```console
39plain tunnel https://app.localhost:8443
40```