# Share an app from a GitHub Codespace privately

> A Codespaces port is private to you or public to anyone; Ona (Gitpod) and Coder ports are similar. Share the app with one person through a qURL link instead.

Source: https://layerv.ai/guides/share-a-codespace-privately/

---

[← All guides](https://layerv.ai/guides/) 

# Share an app from a GitHub Codespace privately

## Why qURL here

Show someone the app running inside your Codespace while keeping its port private. qURL™ publishes from the foreground process, so the share lasts while that process and Codespace run.

Copies a prompt for any agent that runs commands. 

## What you need

- A running codespace with your app listening on 127.0.0.1 inside it
- A terminal in the codespace (the editor’s terminal, or gh codespace ssh)

Content updated November 4, 2026.

## Steps

A private Codespaces port opens only for you, and the other choice for someone outside your organization is a public port that anyone with the URL can open. Instead, install the qURL CLI in the codespace, publish the app in the foreground, and send a one-time link from `qurl share`. Keep the codespace from timing out while they use it.

1. ### Install the qURL CLI in the codespace  
This is the qURL skill’s installer: it checks the download against the release checksums and installs into \~/.local/bin, with no sudo. \~/.local is outside /workspaces, so a rebuild of the container removes the CLI and its identity; a stop and start keeps both.  
```  
(umask 022 && mkdir -p "$HOME/.local/bin" "$HOME/.local/state") &&
  chmod go-w "$HOME/.local" "$HOME/.local/bin" "$HOME/.local/state" &&
  installer=$(mktemp) &&
  curl -fsSL --retry 3 --proto '=https' -o "$installer" \
    https://raw.githubusercontent.com/layervai/qurl-integrations/main/scripts/install.sh &&
  INSTALL_DIR="$HOME/.local/bin" sh "$installer" &&
  rm -f "$installer"
export PATH="$HOME/.local/bin:$PATH"
qurl --version
```
2. ### Publish the app in the foreground  
Codespaces’ default images don’t run systemd, so the background service can’t start (their systemctl is a stand-in that only prints a notice); --foreground serves from this shell instead. Replace 3000 with your app’s port. With --foreground the share lasts as long as this process runs. The block waits up to 90 seconds for the CRID and prints the publish log if publishing fails. Keep the commands in one shell: $pub and $CRID don’t carry over to a new one. The app’s Codespaces port stays as it was, private to you unless you changed it.  
```  
run=$(mktemp -d)
nohup qurl publish http://127.0.0.1:3000 --foreground --quiet \
  > "$run/crid" 2> "$run/publish.log" < /dev/null &
pub=$!
for _ in $(seq 1 90); do
  [ "$(wc -c < "$run/crid")" -ge 60 ] && break
  kill -0 "$pub" 2>/dev/null || break
  sleep 1
done
CRID=$(head -n 1 "$run/crid")
[ -n "$CRID" ] || { echo "publish failed:"; cat "$run/publish.log"; kill "$pub" 2>/dev/null; false; }
```
3. ### Create a link  
The link opens once. --ttl ends it if nobody opens it in time; the session it starts lasts 1 hour by default.  
```  
qurl share "$CRID" --ttl 1h
```
4. ### Send the link to one person  
Send it in a direct message, not a public channel: whoever opens it first uses it. Avoid email and apps that preview links, because a scanner that runs the page could use its one opening. Don’t open it yourself to check it, for the same reason. Run `qurl share` again whenever you need a fresh link.
5. ### Keep the codespace awake while they use it  
GitHub stops an idle codespace after 30 minutes by default, and stopping it ends the share. Typing and terminal output reset the timer; traffic to a shared port does not, unless it writes to a terminal. Before a long review, raise your timeout (up to 240 minutes) in your Codespaces settings, or keep the dev server’s request log in an open terminal.
6. ### Stop sharing  
Stop the publisher when the review is done. The resource and its CRID stay; publishing the same port again later returns the same CRID.  
```  
kill "$pub"
```

## What the recipient sees

They open the link in a browser and see your app, served from the codespace, with no GitHub sign-in.

When the codespace stops or you stop the publisher, the app stops answering.

## How cloud dev environments share a running port

From each vendor’s docs, checked on 2026-11-04\. qURL works the same in each: install the CLI in the workspace and publish in the foreground.

__How cloud dev environments share a running port__
| Environment           | Default                                     | Other levels                                                                                                                         | Viewer needs                                                  | Stops when idle                                      |
| --------------------- | ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------- | ---------------------------------------------------- |
| GitHub Codespaces     | Private: visible only to you                | Organization (GitHub Team or Enterprise Cloud); Public: anyone who knows the URL and port                                            | GitHub sign-in, except on a public port                       | After 30 minutes by default; 5 to 240 minutes        |
| Ona (formerly Gitpod) | Creator only, when the CLI opens a port     | Organization members only; Anyone (no login required)                                                                                | Sign-in, except at the everyone level                         | After 30 minutes if no preference is set             |
| Coder                 | Owner: only the workspace owner             | Organization; Authenticated (any user of the deployment); Public                                                                     | A Coder login, except on a public port                        | Workspaces shut down after a period of inactivity    |
| Daytona               | Not documented                              | Public sandbox: preview links open without authentication; otherwise a token or a signed URL (60 seconds by default, up to 24 hours) | A preview token or a signed URL, unless the sandbox is public | After 15 minutes by default                          |
| DevPod                | Forwards ports to your own machine over SSH | Not documented                                                                                                                       | Not applicable: only you                                      | Forwarding needs your IDE or an SSH session open     |
| qURL in any of these  | Private: nobody else until you share        | One-time links from qurl share; device keys with qurl grants --add                                                                   | A browser; no account                                         | When the workspace stops, so the share stops with it |

Sources: [GitHub Codespaces: forwarding ports](https://docs.github.com/en/codespaces/developing-in-a-codespace/forwarding-ports-in-your-codespace) , [GitHub Codespaces: timeout period](https://docs.github.com/en/codespaces/setting-your-user-preferences/setting-your-timeout-period-for-github-codespaces) , [Ona: ports](https://ona.com/docs/ona/integrations/ports) , [Ona: port sharing policy](https://ona.com/docs/ona/organizations/policies/port-sharing) , [Ona: environment timeout](https://ona.com/docs/ona/organizations/policies/environment-timeout) , [Coder: port forwarding](https://coder.com/docs/user-guides/workspace-access/port-forwarding) , [Coder: workspace scheduling](https://coder.com/docs/user-guides/workspace-scheduling) , [Daytona: preview and authentication](https://www.daytona.io/docs/en/preview-and-authentication) , [Daytona: sandboxes](https://www.daytona.io/docs/en/sandboxes) , [DevPod: how it works](https://devpod.sh/docs/how-it-works/overview).

## Troubleshooting

__Troubleshooting__
| If you see                                             | Do this                                                                                                                                                                                       |
| ------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| The app stopped answering partway through a review     | The codespace probably timed out. Start it again, run the publish block again in a new terminal, and send a new link. After a stop and start the CRID is the same; after a rebuild it is new. |
| publish says “qurl: command not found” after a rebuild | A rebuild keeps only /workspaces. Run the install step again; the first publish then creates a new identity and a new CRID.                                                                   |

__More troubleshooting__
| If you see                                                                                                             | Do this                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| The recipient sees “Blocked request”, “Invalid Host header” or a similar host error                                    | The dev server rejects qURL’s hostname. The guide to allowing a tunnel’s hostname lists the setting for each framework.                                                                                                                                                                                                                                                                                                               |
| qurl publish says the local app is not accepting TCP connections                                                       | Start 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: line     | Your 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 →](https://layerv.ai/guides/share-from-a-container-or-ci/)                                                                                                                                                                                                  |
| 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 not just send the forwarded Codespaces URL? 

GitHub makes a forwarded port private by default, and a private port is visible only to you. An organization port reaches members of the repository’s organization, and a public port anyone who knows the URL and port number.

Does the share survive closing the browser tab? 

Yes, while the codespace keeps running. Closing the tab does not stop a codespace; the idle timeout does. Stopping the codespace, or a rebuild, ends the share.

Does this work in Ona (Gitpod), Coder, Daytona or DevPod? 

Yes: the steps are plain shell for any Linux workspace that can reach the internet. Each of these stops idle workspaces, Ona after 30 minutes and Daytona after 15 by default, and the share stops with the workspace. Where a workspace runs systemd, a plain qurl publish also works.

Can I share it with VS Code’s Ports panel instead? 

Not from a remote workspace. VS Code’s own port forwarding through dev tunnels exposes only services running on your local machine, and its docs say remote connections aren’t supported yet. In a codespace the Ports panel sets the Codespaces port visibility described above.

Can a coding agent in the codespace do this? 

Yes. The steps are plain shell, and the qURL skill uses the same installer and the same foreground block. Ask it to keep the publish and the commands that use $CRID in one shell, because many agent tools end background jobs when a command returns.

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

Opening the 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.

## Related Resources

[Guide: Give every pull request a private preview from GitHub Actions →](https://layerv.ai/guides/private-pull-request-previews-on-github-actions/) [Guide: Share an app from a remote dev server over SSH →](https://layerv.ai/guides/share-from-a-remote-dev-server/) [Guide: Share a preview from each git worktree →](https://layerv.ai/guides/share-previews-from-git-worktrees/) [Guide: Share an app from a container or CI →](https://layerv.ai/guides/share-from-a-container-or-ci/) [Guide: Allow a tunnel’s hostname in your dev server →](https://layerv.ai/guides/allow-tunnel-hostname-in-dev-server/) [qURL vs Microsoft dev tunnels →](https://layerv.ai/compare/qurl-vs-microsoft-dev-tunnels/) [GitHub docs: Forwarding ports in your codespace ↗](https://docs.github.com/en/codespaces/developing-in-a-codespace/forwarding-ports-in-your-codespace) [GitHub docs: Codespaces timeout period ↗](https://docs.github.com/en/codespaces/setting-your-user-preferences/setting-your-timeout-period-for-github-codespaces) [GitHub docs: Rebuilding the container ↗](https://docs.github.com/en/codespaces/developing-in-a-codespace/rebuilding-the-container-in-a-codespace)

## Publish your app now

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

[Install the CLI →](https://layerv.ai/cli/)



---

*This markdown version is auto-generated from [https://layerv.ai/guides/share-a-codespace-privately/](https://layerv.ai/guides/share-a-codespace-privately/) for AI agents. Curated agent resources: [llms.txt](https://layerv.ai/llms.txt). For the full interactive experience, visit the HTML version.*

