# Share an app from a remote dev server over SSH

> Share an app on a remote dev box or cloud VM without Tailscale or a VS Code tunnel: publish it with qURL and keep it up after SSH logout with systemd lingering.

Source: https://layerv.ai/guides/share-from-a-remote-dev-server/

---

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

# Share an app from a remote dev server over SSH

## Why qURL here

Share the app running on your remote dev server without opening an inbound port. With systemd lingering and an enabled app service, qURL™ keeps serving after SSH logout and a reboot.

Copies a prompt for any agent that runs commands. 

## What you need

- A Linux server with systemd that you reach over SSH: a cloud VM, a home server, or a team dev box
- An app that can listen on 127.0.0.1 on that server

Content updated November 4, 2026.

## Steps

On the server, install the qURL CLI, run loginctl enable-linger once, run the app as an enabled systemd user service, and publish it with `qurl publish`. qURL runs sharing as a systemd user service, and without lingering systemd stops your services when your last SSH session ends. With it, the app and the share keep running after you disconnect, and come back after a reboot.

1. ### Install the qURL CLI on the server  
Run this in your SSH session. It is the qURL skill’s installer: it checks the download against the release checksums and installs into \~/.local/bin, with no sudo. Add the export line to \~/.bashrc or \~/.zshrc if later sessions should find qurl.  
```  
(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. ### Turn on lingering for your user, once  
`qurl publish` installs its background service as a systemd user service. systemd starts your user manager when you log in and stops it, with every user service, a few seconds after your last session ends; lingering keeps it running and starts it at boot. Where polkit runs, as on Ubuntu cloud images, systemd’s default policy lets you turn lingering on for yourself, with no sudo. Without polkit, as in many minimal images, the command answers “Access denied”, and an administrator runs sudo loginctl enable-linger with your user name. The second line should print Linger=yes.  
```  
loginctl enable-linger
loginctl show-user "$USER" --property=Linger
```
3. ### Run the app as a user service  
An app started in your SSH shell may stop when you disconnect. A user service belongs to the user manager that lingering keeps, so it keeps running, and an enabled one starts again after a reboot. Run this in the app’s folder, and replace npm run dev with your own start command; make the app listen on 127.0.0.1 so it is not exposed on the server’s network. The file records your shell’s PATH and the full path of npm, because a service does not read your shell profile. This example requires paths without percent signs, quotes or backslashes; systemd treats those specially. Replace port 3000 with your app’s port (Vite uses 5173 by default). Read its output with journalctl --user -u preview-app, and stop it with systemctl --user stop preview-app. For a share that only has to last until the next reboot, systemd-run --user --unit=preview-app --same-dir -E PATH npm run dev is enough.  
```  
mkdir -p ~/.config/systemd/user
cat > ~/.config/systemd/user/preview-app.service <<EOF
[Unit]
Description=App shared with qURL
[Service]
WorkingDirectory=$PWD
Environment="PATH=$PATH"
ExecStart="$(command -v npm)" run dev
Restart=on-failure
[Install]
WantedBy=default.target
EOF
systemctl --user daemon-reload
systemctl --user enable --now preview-app
for _ in $(seq 1 30); do curl -fsS -o /dev/null http://127.0.0.1:3000 && echo up && break; sleep 1; done
```
4. ### Publish the app  
Replace 3000 with your app’s port. The first publish creates this server’s qURL identity, starts the background service, and prints the CRID. The Access line says private: nobody else can open it until you share it. With lingering on, the qURL service keeps serving after you log out, and it starts again after a reboot along with the app’s service.  
```  
qurl publish http://127.0.0.1:3000
```
5. ### Create a link for each person  
`qurl share` prints an access link (https://qurl.link/#…). On a terminal, the lines below it say who published the resource and when the link expires, for example “Expires in 1d (single use)”. A publisher LayerV has verified is shown as verified by LayerV; any other name is marked UNVERIFIED. With no flags the link can be opened once and expires within 24 hours. If the expiry line does not say “single use”, don’t send the link. Add --ttl 1h for a shorter window.  
```  
qurl share <CRID>
```
6. ### 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.
7. ### Check it after you disconnect  
Before you log out, make one more link, for yourself. Log out, wait a minute, then open that link on your laptop: the app should load. Don’t check with ssh <server> `qurl status` instead: that login starts your user manager again, so it reports the share as running even when lingering is off.  
```  
qurl share <CRID> --ttl 1h
```

## What the recipient sees

They open the link in a browser and see the app served from your server, at a qurl.site address with no sign-up.

They keep access for the session, 1 hour by default, whether or not you are still connected over SSH.

## Ways to share an app on a remote server, compared

Vendor rows follow the facts in /compare/localhost-tunnels (checked 2026-10-01) and the VS Code docs (checked 2026-11-04).

__Ways to share an app on a remote server, compared__
| Option                                  | Who can open it                                                         | Viewer needs                                                         | How long it lasts                                     |
| --------------------------------------- | ----------------------------------------------------------------------- | -------------------------------------------------------------------- | ----------------------------------------------------- |
| qURL with lingering (this guide)        | Nobody until you share; then whoever opens a one-time link              | A browser; no account                                                | Until you stop it; it survives SSH logout and reboots |
| Tailscale Serve                         | Authorized Tailscale users, including accepted machine-share recipients | The Tailscale client                                                 | Until stopped; --bg keeps it running across reboots   |
| Tailscale Funnel                        | Public: anyone on the internet                                          | A browser                                                            | Until you turn it off                                 |
| Microsoft dev tunnels                   | Private by default; your tenant, a GitHub organization, or anonymous    | A sign-in unless anonymous; an anti-phishing page on the first visit | A temporary tunnel ends when the host disconnects     |
| Cloudflare Tunnel (named)               | Public unless you add a Cloudflare Access application                   | A browser, plus an Access login if you add one                       | No per-link expiry                                    |
| ngrok                                   | Public: anyone with the URL                                             | A browser; free-plan browser traffic sees a warning page first       | While the ngrok agent runs                            |
| VS Code Remote-SSH or ssh -L forwarding | Only you, on your own machine                                           | Not applicable                                                       | While VS Code or the ssh connection is open           |

Sources: [Every localhost tunnel, compared](https://layerv.ai/compare/localhost-tunnels/) , [Tailscale Serve](https://tailscale.com/kb/1312/serve) , [Tailscale Funnel](https://tailscale.com/kb/1223/funnel) , [Microsoft dev tunnels: security](https://learn.microsoft.com/en-us/azure/developer/dev-tunnels/security) , [Cloudflare Tunnel](https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/get-started/create-remote-tunnel/) , [ngrok free plan limits](https://ngrok.com/docs/pricing-limits/free-plan-limits) , [VS Code Remote-SSH](https://code.visualstudio.com/docs/remote/ssh).

## Troubleshooting

__Troubleshooting__
| If you see                                                                              | Do this                                                                                                                                                                                                                                                                     |
| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| The link worked until you logged out, then the app stopped answering                    | Lingering is off, so systemd stopped your user services at logout. Run loginctl enable-linger and check that Linger=yes. Logging in starts the qURL service again; start the app as in step 3, and send a new link.                                                         |
| qurl status says serving, but the recipient sees “The page you requested was not found” | qURL is connected but the app is not running. An app started from your SSH shell can end at logout, and one started with systemd-run is gone after a reboot. Run it as the enabled user service of step 3, check systemctl --user status preview-app, then send a new link. |

__More troubleshooting__
| If you see                                                                                                             | Do this                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| systemd-run says it failed to connect to the bus, or the service cannot find npm                                       | Your session has no user manager: log in over SSH again, not with su or sudo -u, so XDG\_RUNTIME\_DIR is set. For a missing runtime, pass -E PATH, or give the command’s full path.                                                                                                                                                                                                                                                   |
| 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 run the app with nohup or tmux? 

Not reliably. systemd-logind’s KillUserProcesses setting decides whether your session’s processes are killed when you log out. systemd’s documented default is yes, which the systemd docs warn breaks tmux and screen; Ubuntu ships KillUserProcesses=no, so there they usually survive. Either way they don’t come back after a reboot. A user service is outside the session, so lingering keeps it, and enabling it brings it back at boot.

Can I share it with VS Code’s Ports panel or code tunnel? 

Not with someone else. Over Remote-SSH, VS Code forwards the server’s port to your own machine, and its dev-tunnel port forwarding exposes only services running locally, not over a remote connection. code tunnel gives you remote access to the server, with the same GitHub or Microsoft account on both ends and one user at a time.

How is this different from Tailscale Serve or Funnel? 

Tailscale Serve shares the app inside your tailnet, so each viewer needs the Tailscale client and access to your tailnet. Tailscale Funnel makes it public to anyone on the internet, with no access control on Funnel traffic. qURL needs nothing installed by the viewer and keeps the app private until you share a link.

Does the server need an open port? 

No. qURL connects out from the server, and the app listens on 127.0.0.1 only. Publishing does not close other routes: if the app also listens on 0.0.0.0 or a firewall port is open, it stays reachable there.

Can my coding agent do this over SSH? 

Yes. An agent that runs on the server, or runs commands there over SSH, can follow the same steps; the qURL skill uses the same installer. Turning on lingering changes how your account runs services, so have it ask you first.

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.

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.

## 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 GitHub Codespace privately →](https://layerv.ai/guides/share-a-codespace-privately/) [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: Revoke access to a shared app →](https://layerv.ai/guides/revoke-access-to-a-shared-app/) [qURL vs Tailscale Serve →](https://layerv.ai/compare/qurl-vs-tailscale-serve/) [qURL vs Tailscale Funnel →](https://layerv.ai/compare/qurl-vs-tailscale-funnel/) [qURL vs Microsoft dev tunnels →](https://layerv.ai/compare/qurl-vs-microsoft-dev-tunnels/) [systemd docs: loginctl enable-linger ↗](https://www.freedesktop.org/software/systemd/man/latest/loginctl.html) [systemd docs: logind.conf KillUserProcesses ↗](https://www.freedesktop.org/software/systemd/man/latest/logind.conf.html) [systemd docs: systemd-run ↗](https://www.freedesktop.org/software/systemd/man/latest/systemd-run.html)

## 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-from-a-remote-dev-server/](https://layerv.ai/guides/share-from-a-remote-dev-server/) for AI agents. Curated agent resources: [llms.txt](https://layerv.ai/llms.txt). For the full interactive experience, visit the HTML version.*

