# Install qURL on a server

> Install the CLI, link an account over SSH, and keep a Linux share running.

Source: https://layerv.ai/docs/cli/

---

# Install qURL™ on a server

Run the CLI as the same Linux user each time. Keep its device state across restarts. An account is optional. Signed identity requires CLI 4.5.0 or later.

Install and check

```
curl -fsSL https://raw.githubusercontent.com/layervai/qurl-integrations/main/scripts/install.sh | sh
qurl version
qurl whoami
```

## Link an account over SSH

On your computer, forward local port 8765 to the server. Keep this SSH session open:

On your computer

```
ssh -o ExitOnForwardFailure=yes -L 8765:127.0.0.1:8765 app@your-server
```

In that server session, run `qurl account setup --headless` with CLI 4.7.1 or later. Open the printed URL in your computer’s browser. Sign in with the same method as your LayerV account. The callback stays on loopback through SSH. Finish within 15 minutes. The headless option uses the existing browser flow; it does not use a device code.

With CLI 4.7.0 or earlier, run `qurl account setup` instead. If no browser can start, use the browser launcher below to print its URL:

CLI 4.7.0 on Linux

```
mkdir -p "$HOME/.local/bin"
cat > "$HOME/.local/bin/qurl-browser" <<'SH'
#!/bin/sh
printf '%s\n' "$1" > /dev/tty
SH
chmod 700 "$HOME/.local/bin/qurl-browser"
QURL_BROWSER="$HOME/.local/bin/qurl-browser" qurl account setup
qurl whoami -o json
```

Newer CLI releases show `account_id` after linking and in `whoami`. CLI 4.7.0 shows only the device `owner_id`. That owner stays unchanged after linking. In the dashboard, open Devices, or choose the device under Protected Resources. Existing CRIDs and links stay unchanged.

## Keep a share running on Linux

The normal background mode uses a systemd user service. For a server, enable lingering so it continues after logout, then publish:

Background service

```
sudo loginctl enable-linger "$USER"
qurl publish http://127.0.0.1:3000 --name "Server app" --access email_capture
qurl list
```

If another service manager must own the process, use `--foreground`. For example, save this as `~/.config/systemd/user/qurl-app.service`. Set ExecStart to the absolute path reported by `command -v qurl`:

systemd user unit

```
[Unit]
Description=qURL server app

[Service]
ExecStart=/usr/local/bin/qurl publish http://127.0.0.1:3000 --name "Server app" --access email_capture --foreground
Restart=on-failure
RestartSec=5

[Install]
WantedBy=default.target
```

Start the unit

```
systemctl --user daemon-reload
systemctl --user enable --now qurl-app.service
journalctl --user -u qurl-app.service
```

Use one supervisor for the share. Stop its existing background share before starting the foreground unit. Keep the same user and device state. Never delete state to fix a link problem. Copies of the same state use the same device identity; use separate enrollments when hosts need separate identities.

[Configure signed identity, email consent, and CSRF](https://layerv.ai/docs/signed-identity/).



---

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

