Skip to main content
← All guides

Share a Streamlit app privately

Why qURL here

Show someone the Streamlit app running on your machine without deploying a copy. Keep its origin and XSRF checks enabled, and allow only the exact origin of the recipient’s open qURL™ link.

Steps

To share a Streamlit app privately with qURL by LayerV, bind it to 127.0.0.1, publish port 8501 with qurl publish, and send a link from qurl share. Once the recipient opens it, add their exact https origin to server.corsAllowedOrigins and restart, keeping CORS and XSRF protection on. Your app keeps running on your own machine, and qURL carries the live session to the recipient.

  1. Install the qURL CLI

    Install the qURL CLI. On macOS, install it with Homebrew. On Linux and Windows, download the package for your platform from the latest release; the CLI page lists each one. Nothing asks you to sign up.

    brew install layervai/tap/qurl
    qurl --version
  2. Bind Streamlit to localhost

    With Streamlit’s server.address unset, streamlit run listens on every interface and prints a Network URL that anyone on your network can open. Set it to 127.0.0.1 in .streamlit/config.toml next to your app. Leave enableCORS and enableXsrfProtection at their defaults, true.

    # .streamlit/config.toml
    [server]
    address = "127.0.0.1"
    port = 8501
  3. Start the app

    Run Streamlit as usual from the folder that holds .streamlit/config.toml, and keep it running.

    streamlit run app.py
  4. Publish the app from a second terminal

    Publish Streamlit through qURL. The first publish creates this device’s identity, starts a background service that keeps serving after you close the terminal (while you stay logged in), and prints the app’s CRID, its stable ID. The Access row says who can open the app: a plain publish makes it private from qurl 3.4.1 on. qurl share turns the CRID into an access link, and the link is what you send.

    qurl publish http://127.0.0.1:8501
  5. Trust the recipient’s exact origin

    Streamlit accepts its WebSocket only from the page’s own host, local addresses, and the origins you list. Through qURL the browser is on r_….qurl.site while Streamlit receives c-….qurl.site, so until you list the origin the recipient sees the app’s loading skeleton and nothing else. Ask the recipient to send you the exact https origin from the address bar of the page they just opened (scheme and hostname, without a path). They must keep that page open; do not open their single-use link yourself. Add it to server.corsAllowedOrigins, restart streamlit run, and ask them to reload the same page. Do not list https://*.qurl.site: it includes apps run by other publishers.

    # .streamlit/config.toml
    [server]
    address = "127.0.0.1"
    port = 8501
    corsAllowedOrigins = ["https://r_your-link.qurl.site"]
  6. End the review and restore local settings

    Stop sharing, remove the recipient origins you added to corsAllowedOrigins, then restart Streamlit. Keep its CORS and XSRF protection enabled.

    qurl stop <CRID>

What the recipient sees

After the reload, the app runs at an address like https://r_….qurl.site/.

More

Widgets rerun the script as they do locally, over Streamlit’s WebSocket, which a qURL link carries. File uploads work with XSRF protection on: its cookie belongs to the host the browser is on.

Troubleshooting

Troubleshooting
If you seeDo this
The recipient sees the app’s loading skeleton and nothing elseIf the terminal logs “Rejecting WebSocket connection with disallowed Origin or Host header”, their origin is not in server.corsAllowedOrigins. Add the exact https://r_….qurl.site origin from their address bar, restart streamlit run, and have them reload. A new link can land on a new hostname; add that one too.
A forum answer says to set enableCORS and enableXsrfProtection to falseDon’t. With enableCORS false, Streamlit accepts a WebSocket from any origin and sends Access-Control-Allow-Origin: * on most routes. enableXsrfProtection only guards file uploads, and it works through qURL. One corsAllowedOrigins entry is enough.
Show 7 more fixes
More troubleshooting
If you seeDo this
You set server.allowedHosts and the WebSocket is still rejectedserver.allowedHosts (Streamlit 1.61 and later) checks the Host header, which through qURL is c-….qurl.site. Add that host, and keep localhost and 127.0.0.1 so the app still opens on your machine; or leave the list empty, which accepts any Host.
qurl publish says the local app is not accepting TCP connectionsStart the app first and check that curl works on the same address. qurl publish connects to localhost as 127.0.0.1, so if your app listens only on IPv6 (on macOS or Linux, lsof -iTCP -sTCP:LISTEN -nP shows [::1]), publish 'http://[::1]:PORT' instead, or start the dev server with --host 127.0.0.1 and publish that address. Neither requires listening on your LAN. Keep the quotes: zsh treats the brackets as a pattern.
The recipient sees “Access link invalid”The link was already used or has expired. Run qurl share again and send the new link.
The recipient sees “Resource not found”The resource was deleted after the link was made. Publish the app again, then run qurl share and send the new link.
publish rejects http://127.0.0.1 with “only HTTPS URLs are allowed”, asks you to log in, or prints no Access: lineYour qURL CLI is out of date. On macOS run brew update, then brew upgrade qurl; elsewhere install the latest release. After updating, qurl --version prints 3.4.1 or later, and every publish is private by default.
publish says this Linux session “can’t reach a systemd user manager”You are in a container or sandbox without a user service manager. Run qurl publish with --foreground; sharing lasts as long as that process runs. Container and CI setup →
publish says “Quota Exceeded” with “protected resource limit reached”, or “Your qURL account has reached a plan limit”You can see this without an account: a device with no account can keep up to 3 active resources, with links that last up to 24 hours. Run qurl list --status active, then qurl delete <CRID> for any you no longer need (it asks you to confirm; --yes skips that). qurl stop keeps the resource, so it does not free a slot.

Frequently Asked Questions

Why does Streamlit show “Please wait…” or “Connection error” through a tunnel?

Streamlit needs its WebSocket to open before the app becomes interactive. Through qURL, add the recipient’s exact https origin to server.corsAllowedOrigins and restart Streamlit. Keep CORS and XSRF protection enabled, then have the recipient reload the same page.

Which Streamlit settings matter behind a private link?

For Streamlit, set server.address to 127.0.0.1, list the recipient’s exact origin in server.corsAllowedOrigins, and keep server.enableCORS and server.enableXsrfProtection enabled. If you configured server.allowedHosts, also allow the c-….qurl.site Host that the app receives.

Why does Streamlit reject the WebSocket through qURL and not through ngrok?

Streamlit accepts a WebSocket whose Origin matches the Host it receives. Through ngrok both name the same hostname. Through qURL the browser is on r_….qurl.site and Streamlit receives c-….qurl.site, so the origin has to be listed in server.corsAllowedOrigins.

Does Streamlit listen on my network by default?

Yes. With Streamlit’s server.address unset it binds every interface and prints a Network URL with your machine’s LAN address. Setting server.address to 127.0.0.1 keeps it on this computer; qURL connects to it there.

Do I need to turn off XSRF protection?

No. Streamlit’s config docs now say it does not enable server.enableCORS for you when server.enableXsrfProtection is true, and that a WebSocket does not need a valid XSRF token, so XSRF protection does not replace CORS.

Who else can reach my app while the link is open?

Opening a qURL link starts a session for that browser, which lasts 1 hour by default. After a browser opens it, another browser on the same public IP cannot use its access. A script or agent that opens the link without a browser is admitted by its network address instead, which other devices on that public IP share until the session ends. A link admits whoever opens it: the API’s IP and country rules do not apply to the signed links qurl share issues. Keep your app’s own sign-in for anything sensitive.

Does my computer have to stay on?

Yes. Your Streamlit app runs on your machine. The machine and app must stay running and connected; the app is unavailable while the machine is asleep.

How do I stop sharing?

Run qurl stop <CRID> to pause serving the app, and qurl start <CRID> to resume it; a stopped app still counts toward your resource limit. qurl delete <CRID> removes the resource for good after asking you to confirm; its CRID can never be shared again.

Publish your app now

Install the CLI, then run one command. No sign-up, no API key.

Install the CLI →

Book a pilot

Tell us what to hide. We’ll scope a pilot.

Enterprise starts with a paid pilot on one application, typically 60 to 90 days, credited in full toward year one if you convert within 60 days. After that, an annual package sized to what you protect, not per seat.