# Published apps

Put an app from a sandbox on a **permanent public address** – `https://my-app.box.wbxbox.net` or your own domain – that anyone can open without a token. The sandbox stays as long as the app is published, sleeps when nobody visits and wakes up on the next visit. Ideal for a small website, a demo, a dashboard or the web page of a bot your AI assistant built.

> **Paid plans.** Published apps are available on paid plans and to accounts that have topped up at least US$15 in total. Each app costs a small monthly fee above the number included in your plan – see [Price](#pricing).

## Publish an app

Run the app in a sandbox (listening on `0.0.0.0`), then publish its port under a name. The same call with the same name changes an existing app.

**AI assistant**

```
Build a small booking page for our dog-walking club in a sandbox
and publish it as dog-club, so it starts again with "python3 app.py".
```

The assistant uses the MCP tools `publish_app` and `unpublish_app` – see [MCP tools](https://sandbox.wbx.cz/docs/mcp/tools.md).

**Python**

```
from wbxsandbox import Sandbox, App

sb = Sandbox.create(template="base", timeout=600, name="dog-club")
sb.files.write("/home/user/dog-club/app.py", APP_CODE)
sb.run("cd /home/user/dog-club && nohup python3 app.py >/tmp/app.log 2>&1 &")

app = sb.publish("dog-club", 8000, start_command="python3 app.py", cwd="/home/user/dog-club")
print(app.url)          # https://dog-club.box.wbxbox.net/

App.list()              # your apps
app.unpublish()         # the sandbox stays
```

**TypeScript**

```
import { WBX } from "wbxsandbox";

const wbx = new WBX();
const sb = await wbx.sandboxes.get("sb_…");
const app = await sb.publish({ name: "dog-club", port: 8000, startCommand: "python3 app.py", cwd: "/home/user/dog-club" });
console.log(app.url);   // https://dog-club.box.wbxbox.net/

await wbx.apps.list();
await app.unpublish();
```

**curl**

```
curl -s -X POST https://sandbox.wbx.cz/v1/apps \
  -H "Authorization: Bearer $WBXSANDBOX_API_KEY" -H "Content-Type: application/json" \
  -d '{"sandbox_id": "sb_…", "port": 8000, "name": "dog-club",
       "start_command": "python3 app.py", "cwd": "/home/user/dog-club"}'
```

```
{
  "name": "dog-club",
  "url": "https://dog-club.box.wbxbox.net/",
  "sandbox_id": "sb_…",
  "port": 8000,
  "start_command": "python3 app.py",
  "cwd": "/home/user/dog-club",
  "domains": [],
  "created_at": "2026-11-26T15:17:41Z"
}
```

**Portal**

Open **Published apps** in the portal, pick the sandbox, the port and a name, optionally the start command, and click *Publish*. The page lists your apps with their address, the state of the sandbox and your domains.

- **`name`** – 3–40 lowercase letters, digits and dashes, starting and ending with a letter or digit. It becomes the address `https://<name>.box.wbxbox.net`. Names like `www`, `api`, `mail` or `admin` are reserved; a name another account uses is taken.
- **`port`** – The port your app listens on inside the sandbox.
- **`start_command`** – Optional. Runs in the background when nothing listens on the port – after the sandbox woke up without its memory, or when the app crashed. Output goes to `/tmp/wbx-app.log`.
- **`cwd`** – Optional folder for the start command.

## How a published app runs

- **No token.** Anyone with the address can open it. Our token and cookies never reach your app; the app gets the visitor's address in `X-Forwarded-For`.
- **Kept, not deleted.** A published sandbox is not deleted at the end of the retention period of your plan. Deleting a sandbox for unpaid credit still applies. When the sandbox is deleted, the app is unpublished within 5 minutes.
- **Sleeps without visitors.** The sandbox falls asleep like any other, so you pay for compute only while someone uses the app. The next visit wakes it up in a few seconds – with its memory the app answers right away.
- **Starts itself.** If nothing listens on the port, the start command runs once (even when many visitors arrive at once) and the visitor gets the page as soon as the app listens, within 40 seconds. A request with a body (a form, an API POST) that arrives at that moment gets `503` with `Retry-After` – send it again.
- HTTP and WebSockets work, over IPv4 and IPv6.

## Your own domain

Add your domain to a published app and point it to us. Once the DNS record works, a Let's Encrypt certificate is issued automatically within a few minutes and renewed on its own.

```
curl -s -X POST https://sandbox.wbx.cz/v1/apps/dog-club/domains \
  -H "Authorization: Bearer $WBXSANDBOX_API_KEY" -H "Content-Type: application/json" \
  -d '{"domain": "booking.example.com"}'
```

```
{
  "domain": "booking.example.com",
  "state": "pending",
  "url": "https://booking.example.com/",
  "dns": {
    "cname": {"type": "CNAME", "name": "booking.example.com", "value": "dog-club.box.wbxbox.net"},
    "root": [{"type": "A", "name": "booking.example.com", "value": "…"},
             {"type": "TXT", "name": "_wbx-verify.booking.example.com", "value": "wbx-verify=…"}]
  }
}
```

```
d = app.add_domain("booking.example.com")   # Python – d["dns"]["cname"] is the record to create
await app.addDomain("booking.example.com");  // TypeScript
```

| Domain | DNS record at your provider |
| --- | --- |
| A subdomain – `booking.example.com` | `CNAME` to the address of the app, e.g. `dog-club.box.wbxbox.net` |
| A root domain – `example.com` (cannot have a CNAME) | `A` (and `AAAA`) to the addresses in `dns.root`, plus a `TXT` record `_wbx-verify.example.com` with your verification code |

- `state`: `pending` (waiting for DNS – `error` says what is missing), `issuing` (DNS works, certificate on its way), `active`.
- The CNAME must point exactly to your app, so nobody can take over a domain that points to someone else's app.
- A domain that stops pointing to us is turned off after 7 days (`dns_lost_since`, `disable_at`) and comes back when DNS works again. A domain whose DNS is never set up is removed after 7 days.
- Up to 5 domains per app and 20 per account. Domains are included in the price of the app. Remove one with `DELETE /v1/apps/{name}/domains/{domain}`.

## List and unpublish

```
curl -s https://sandbox.wbx.cz/v1/apps -H "Authorization: Bearer $WBXSANDBOX_API_KEY"
curl -s -X DELETE https://sandbox.wbx.cz/v1/apps/dog-club -H "Authorization: Bearer $WBXSANDBOX_API_KEY"
```

Unpublishing removes the address and its domains; the sandbox and its files stay. Up to 10 apps per account.

## Price

Each published app costs a monthly fee above the number included in your plan, charged from your credit for the time it is published – an app published for half a month costs half. Your own domains are included. Compute while the app runs and storage while it sleeps are billed as usual. Current amounts are on the [pricing page](https://sandbox.wbx.cz/pricing#apps).

## Rules and errors

- A published app is public: do not publish admin panels, databases or anything with secrets. Apps that break the [terms](https://sandbox.wbx.cz/terms) (phishing, malware, abuse) are turned off by the operator – the address then shows `451` and the app cannot be changed or unpublished by the account.
- `403 feature_disabled` – published apps are not enabled for your account (paid plans, or a top-up of at least US$15).
- `409` – the name is taken, or you reached 10 apps / 5 domains per app. `404` – the sandbox or app is not yours or no longer exists.
- Every error code: [Errors](https://sandbox.wbx.cz/docs/errors.md).

## Next steps

- [A web app with a public URL](https://sandbox.wbx.cz/docs/guides/web-app.md): Start to finish, then publish it.
- [Public URLs with a token](https://sandbox.wbx.cz/docs/sandboxes/urls.md): Private addresses for development.
- [Sleep and wake](https://sandbox.wbx.cz/docs/sandboxes/sleep.md): What a sleeping sandbox keeps.

Source: https://sandbox.wbx.cz/docs/sandboxes/apps
