xhostd
Sign in Start building
← Concepts

Preview and staging environments on xhostd

A preview or staging environment lets you test a web app change at its own URL before production. On xhostd each one is a channel with its own database.

A preview environment lets you deploy and test a change at a separate URL before it reaches production. In xhostd, each preview or staging environment is called a channel.

A channel is a complete, always-running copy of your app. It has its own address, database, file storage, and domains. Production doesn't change until you deploy to it.

Who this is for

You want to try a change without risking the live app. For example:

  • Claude Code redesigned the checkout page of your shop, and you want to click through it first.
  • A client wants to review a new feature at a link before you release it.
  • Your team wants a long-lived staging site at staging.example.com.

How it works

  • Every app starts with one channel. It's named prod, and it's your production environment.
  • Each channel has its own parts. It gets its own HTTPS address, file storage, custom domains, and Postgres database, unless the app is a static site. A preview can't change production data.
  • A preview starts with an empty database. It doesn't hold a copy of production data, so keep that in mind when you judge a change.
  • Settings are shared by default. A setting for the whole app applies to every channel, and a channel can override it.
  • Channels are always on. Every channel runs on every plan, with no sleep mode and no start-up delay. A reviewer can open a preview link days later and find it running.

Preview or staging

Both are channels. A preview is a temporary channel for one change, and you delete it when you're done. Staging is a longer-lived channel that you use again and again before production, often on its own domain, such as staging.example.com.

Test a change before production

Ask your AI coding agent to create a preview channel for the change. Review the URL, then tell the agent to deploy the approved version to production. Delete the preview afterward to free its slots.

Claude Code, Cursor, Codex, and other connected agents can create channels and deploy to them. For a first deploy, connect your agent and read Deploy a Claude Code app to a live HTTPS URL.

How many slots you get

Your plan sets one slot limit for the whole account. The limit counts the enabled services of every app you own: each service that is on in a channel uses one slot, in prod and in each extra channel. Three slots can be three single-service apps, or one such app with production and two previews. The pricing page states the limit of each plan.

A preview isn't a separate bill. CPU, memory, and storage are account totals, so a new channel doesn't multiply them.

Each channel with a database also has its own backups, and a restore of one channel never touches another. Read Postgres backups and recovery on xhostd.

Next step

When you're ready to try it, read Use a preview channel for the full workflow.

Technical notes

  • Domains. A custom domain belongs to one channel at a time, and a channel can have up to five.