> ## Documentation Index
> Fetch the complete documentation index at: https://docs.piebald.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> Piebald can be run from your desktop or your browser.

# Web mode

<Badge color="blue">Available in Piebald Basic (Free)</Badge>

Piebald can run as web app instead of a desktop app, if you prefer.  This enables you to run it on a headless device (e.g. a remote server) while still being able to access the UI on a desktop machine.  In some cases the webapp can perform better than the desktop app.

To start the webapp, download the binaries and execute `piebald-web` or `piebald-web.exe`.  You can either double-click the executable file or execute it from the command line:

```sh theme={null}
# Unix
$ ./piebald-web

# Windows
C:\> ./piebald-web.exe
```

Then open the displayed URL in the browser.

### Security

In order to prevent external access to your Piebald database via the webapp, there's an ownership system in place that only allows one Piebald account to access the webapp. Other Piebald accounts can't access the webapp unless you explicitly sign out and reset ownership.

### Server configuration

The webapp's default port is 7000, which you can configure via the `PIEBALD_WEB_PORT` environment variable.

It binds to `127.0.0.1` by default, which prohibits access to the webapp from outside the device you're running it on.  If you need to access it remotely, bind to `0.0.0.0` using the `PIEBALD_WEB_ADDRESS` environment variable.

You can also configure the webapp to use HTTPS (e.g. a self-signed certificate) via the `PIEBALD_WEB_TLS_CERTS` and `PIEBALD_WEB_TLS_KEY` environment variables.

macOS and Linux:

```sh theme={null}
export PIEBALD_WEB_PORT=80
export PIEBALD_WEB_ADDRESS=0.0.0.0
export PIEBALD_WEB_TLS_CERTS=cert.pem
export PIEBALD_WEB_TLS_KEY=key.pem
./piebald-web
```

Windows via PowerShell:

```powershell theme={null}
$env:PIEBALD_WEB_PORT=80
$env:PIEBALD_WEB_ADDRESS='0.0.0.0'
$env:PIEBALD_WEB_TLS_CERTS='cert.pem'
$env:PIEBALD_WEB_TLS_KEY='key.pem'
.\piebald-web.exe
```

Windows via Command Prompt:

```powershell theme={null}
set PIEBALD_WEB_PORT=80
set PIEBALD_WEB_ADDRESS=0.0.0.0
set PIEBALD_WEB_TLS_CERTS=cert.pem
set PIEBALD_WEB_TLS_KEY=key.pem
.\piebald-web.exe
```
