> ## Documentation Index
> Fetch the complete documentation index at: https://vlyai-1c28d863.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Deployment & hosting

> How vly apps deploy, what infrastructure they run on, environments, and the patterns for going from preview to production.

vly apps deploy automatically. There's no `git push`, no CI step, no Dockerfile to write. Every change you make produces a new deploy in seconds. This page is the **mental model** for how it works and what your levers are.

## What you get out of the box

<CardGroup cols={2}>
  <Card title="Auto-deploy on every change" icon="zap">
    Every successful build produces a new preview deployment. No action required.
  </Card>

  <Card title="Free `*.vly.app` URL" icon="globe">
    Every project gets a public URL. SSL included.
  </Card>

  <Card title="Custom domain support" icon="link" href="/deployment/custom-domains">
    Bring your own domain in five minutes. SSL via Let's Encrypt, automatic.
  </Card>

  <Card title="Two environments" icon="git-branch">
    Preview (auto, every change) and Production (promoted on demand).
  </Card>

  <Card title="Per-environment secrets" icon="lock">
    Different API keys for preview vs. production. No copy-paste between environments.
  </Card>

  <Card title="Built-in monitoring" icon="activity">
    Deployment logs, error tracking, basic performance metrics out of the box.
  </Card>
</CardGroup>

## How a deploy happens

```mermaid theme={null}
sequenceDiagram
    participant You
    participant vly
    participant Build
    participant CDN

    You->>vly: prompt (or hand-edit)
    vly->>Build: trigger build
    Build->>Build: type-check + bundle
    Build->>Build: deploy Convex schema
    Build->>CDN: upload built frontend
    CDN-->>You: live preview URL (~10s)
```

The whole pipeline runs in 10–30 seconds for a typical change. The preview URL updates atomically — there's no half-deployed state.

## Environments

<Steps>
  <Step title="Preview">
    Every revision automatically deploys here. Public URL, but unindexed by search engines (`X-Robots-Tag: noindex`). Connect any number of preview environments to test in parallel.
  </Step>

  <Step title="Production">
    Promoted from a specific preview revision. Connected to your custom domain. Indexed by default.
  </Step>
</Steps>

The promotion model is **manual**: you pick a preview, click "Promote to production", and it's live within seconds. This avoids accidentally shipping unfinished work.

[Staging vs production →](/deployment/staging-vs-production)

## Environment variables and secrets

Every environment has its own secrets. The pattern:

| Environment | Stripe key | OpenAI key | What |
| - | - | - | - |
| Preview | `sk_test_...` | Production OpenAI key (same; usage is small in preview) | Test mode for billing |
| Production | `sk_live_...` | Same OpenAI key | Real charges |

Set per-environment from **Settings → Environments → \[env] → Secrets**. See [Environment variables](/deployment/environment-variables) and [Secrets management](/security/secrets-management).

## Custom domains

Point any domain at your vly app:

<Steps>
  <Step title="In vly: add the domain">
    **Settings → Domains → Add domain**. Enter `app.yourcompany.com`.
  </Step>

  <Step title="At your DNS provider: add the records">
    vly shows you the records. Typically a `CNAME` pointing to `cname.vly.app`.
  </Step>

  <Step title="Wait ~5 minutes">
    DNS propagates and Let's Encrypt provisions an SSL cert.
  </Step>

  <Step title="Test">
    Open your domain. You should see your production app over HTTPS.
  </Step>
</Steps>

For apex domains (`yourcompany.com` instead of `app.yourcompany.com`), you'll use ALIAS / ANAME records — see [Custom domains](/deployment/custom-domains) for the full walkthrough including DNSSEC, redirects, and multi-environment setups.

## Rolling back

If a production deploy turns out to be broken:

<CardGroup cols={2}>
  <Card title="Instant rollback" icon="undo" href="/deployment/rollback">
    From the production deploy timeline, click any prior deploy and select "Rollback to here". Live in seconds.
  </Card>

  <Card title="Re-promote a different preview" icon="git-branch">
    Same effect, slightly different mechanism. Pick a known-good preview and promote it.
  </Card>
</CardGroup>

Rollbacks **do not undo schema migrations**. If your bad deploy added a field, the field stays after rollback (the new code path that uses it is gone, but the field is still there). For schema changes, ship them separately from feature changes when possible.

## Staging environments

For teams that want a "shared QA" environment between preview and production:

<Steps>
  <Step title="Create a staging environment">
    **Settings → Environments → Add environment** named "staging".
  </Step>

  <Step title="Configure secrets">
    Use either test-mode keys (like preview) or production keys (like prod) depending on what you're testing.
  </Step>

  <Step title="Promote with two steps">
    Preview → staging (manual) → production (manual). Two gates instead of one.
  </Step>
</Steps>

[Staging vs production patterns →](/deployment/staging-vs-production)

## What's running where

A vly app has three layers, all hosted by vly's managed infrastructure:

| Layer | What |
| - | - |
| **Frontend** | React + Vite bundle on a global CDN. Static assets, \~30ms cold-start. |
| **Backend (Convex functions)** | Queries / mutations / actions. Region-local for latency. |
| **Database (Convex)** | Replicated, with automatic backups. |

You don't choose regions; vly picks the closest one to your users automatically. For multi-region requirements, contact us.

## Dive deeper

<CardGroup cols={2}>
  <Card title="Custom domains" icon="link" href="/deployment/custom-domains">
    DNS, SSL, apex domains, redirects, multi-environment routing.
  </Card>

  <Card title="Environments" icon="layers" href="/deployment/environments">
    Adding, configuring, deleting environments.
  </Card>

  <Card title="Environment variables" icon="key-round" href="/deployment/environment-variables">
    Setting and reading env vars.
  </Card>

  <Card title="Secrets" icon="lock" href="/deployment/secrets">
    The secrets store: encryption, scoping, audit.
  </Card>

  <Card title="DNS setup" icon="globe" href="/deployment/dns-setup">
    Provider-specific DNS guides (Cloudflare, Namecheap, GoDaddy, Google).
  </Card>

  <Card title="SSL certificates" icon="shield-check" href="/deployment/ssl-certificates">
    Provisioning, renewal, custom certificates.
  </Card>

  <Card title="Staging vs production" icon="git-branch" href="/deployment/staging-vs-production">
    Patterns for safe promotion.
  </Card>

  <Card title="Rollback" icon="undo" href="/deployment/rollback">
    The instant-rollback mechanism.
  </Card>

  <Card title="Preview deployments" icon="eye" href="/deployment/preview-deployments">
    Multi-preview workflows for collaborative review.
  </Card>

  <Card title="Monitoring" icon="activity" href="/deployment/monitoring">
    Logs, metrics, alerting.
  </Card>
</CardGroup>


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