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

# Ephemerals

> Deploy your backend to an ephemeral, a disposable Xano environment in Xano's cloud with its own URL, and list, inspect, export and delete ephemerals before they expire.

An ephemeral is a disposable Xano environment in Xano's cloud. It runs the same backend as the
[Xano Engine](/run/xano-engine), at a URL other people can reach, and it expires on its own. Use
one to share a build, and as the source of a [release](/ship/releases).

## Deploy to an ephemeral

An ephemeral is created under your Xano workspace, so sign in once first:

```bash theme={null}
npx xanosdk login
```

Then deploy to an ephemeral:

```bash theme={null}
npm run xano:deploy:ephemeral                       # scaffolded project: backend and built frontend
npx xanosdk deploy ./xano/index.ts --ephemeral      # any project: backend only
```

The scaffolded script builds the frontend and passes `--static ./frontend/dist`, so the ephemeral
serves both (see [Frontend hosting](/run/frontend-hosting)). The deploy prints the backend URL,
and the frontend URL when it published one.

```
→ Deploying xano/index.ts → ephemeral "e4f2-9ab1" ("my-app") (refresh, full replace)
  on your-instance.xano.io · workspace 3
✓ Refreshed ephemeral "e4f2-9ab1" ("my-app") (URL unchanged) (1.1s)
  https://your-instance.xano.io/tenant/e4f2-9ab1
  Expires in 0h 56m
  Manage with `npx xanosdk ephemeral get e4f2-9ab1`
  Open the builder with `npx xanosdk impersonate ephemeral:e4f2-9ab1`
→ Deploying static frontend ./frontend/dist → ephemeral "e4f2-9ab1" ("my-app")
  Routing: spa — every path serves index.html.
✓ Config injected into 1 document: window.XANO_HOST
✓ Static host deployed
  https://a1b2c3-your-instance.xano.io
✓ Frontend is live
```

Not every instance has ephemerals turned on. Where they are off, `deploy --ephemeral` says so and
names who can turn them on. A deploy to the Xano Engine still works meanwhile.

## Create, refresh and expire

The project tracks one ephemeral. Its record is `.xano/ephemeral.json`, which is uncommitted.

* **The first deploy creates it.** These flags apply only then:

  | Flag | What it sets |
  | - | - |
  | `--expires-hours <n>` | How long it lives, 1 to 24 hours. Default: 1. |
  | `--name <n>` | Its display name. Default: the workspace name, else this directory's name. |

  On an ephemeral that already exists they are accepted and not acted on, and the `--json`
  summary lists them under `notApplied`.
* **Every later deploy refreshes it.** The ephemeral keeps its name and backend URL, and the deploy
  replaces what it holds: tables are recreated and seeded again.
* **When it expires, it is gone.** The next deploy creates a new ephemeral with a new URL and
  clears the old record.

```bash theme={null}
npx xanosdk deploy ./xano/index.ts --ephemeral --expires-hours 8 --name my-app-review
```

## Keep rows, or start over

A deploy to an ephemeral replaces everything on it unless you pass `--keep-data`, which merges as
on the Engine: code and schema changes land, and the rows already in the tables stay.

```bash theme={null}
npx xanosdk deploy ./xano/index.ts --ephemeral --keep-data   # merge, keep rows
npx xanosdk deploy ./xano/index.ts --ephemeral --reset       # replace and re-seed, overriding --keep-data
```

A `--keep-data` deploy merges only into an ephemeral an earlier deploy finished filling. A new or
recreated one is replaced and seeded, and the deploy says why.

## Manage ephemerals

These commands take an ephemeral's name (the handle, such as `e4f2-9ab1`), not its display name.
`ephemeral list` shows the handle in bold.

| Command | What it does |
| - | - |
| `xanosdk ephemeral list` | The ephemerals under your workspace. `--all-workspaces` spans every workspace. |
| `xanosdk ephemeral get <name>` | One ephemeral's URL, status and expiry. |
| `xanosdk ephemeral delete <name>` | Tears it down now instead of waiting for expiry. `--yes` skips the prompt. |
| `xanosdk ephemeral export [name]` | Writes its bundle JSON to `.xano/exports/` (default: this project's ephemeral). `--format multidoc` writes XanoScript instead. |

After a deploy to an ephemeral, it is the backend this project tracks, so `xanosdk status`,
`test run-all`, `tables` and `env pull` reach it with no flag. Name another one as
`ephemeral:<name>`.

## Cut a release from it

A release is cut from what is running on an ephemeral, not from the Engine:

```bash theme={null}
npx xanosdk deploy ./xano/index.ts --ephemeral --test   # deploy to an ephemeral and run its tests
npx xanosdk release create v1.4.0                        # cut from that ephemeral
```

[Releases](/ship/releases) covers the rest of the flow.

## Next

* Serve a frontend beside the backend: [Frontend hosting](/run/frontend-hosting).
* Ship what you tested: [Releases](/ship/releases).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.