Deploy your first preview environment in under a minute.

Prerequisites

Before you begin, make sure you have:

Step 1: Set Your API Key

Export your API key as an environment variable:

export PREV_API_KEY="your-api-key-here"

You can find your API key in the Dashboard under API Keys.

Step 2: Deploy Your Project

Navigate to your project directory and run:

prev create .

That's it! The CLI will automatically detect your project type, package your source code, and deploy it.

Step 3: Access Your Preview

After a few seconds, you'll receive a URL like:

https://k7f2m9xq.us.prev.sh

The URL contains the subdomain and the deployment region. Share this URL with anyone — no login required to view.

Common Deployment Examples

Deploy with a Custom Subdomain

prev create . --subdomain my-demo

Your preview will be available at https://my-demo.us.prev.sh (region is included in the URL).

Deploy with a Longer TTL

prev create . --ttl 7d

The environment will stay active for 7 days instead of the default 24 hours.

Deploy a Docker Image

prev create --image nginx:latest --port 80

Deploy to a Specific Region

prev create . --region eu

Deploy from a GitHub Repository

prev create --source github.com/user/repo

Deploy with Password Protection

prev create . --credentials admin:mysecretpass

What Happens Behind the Scenes

  • The CLI packages your project into an archive
  • Your code is sent to the prev API
  • A Docker image is built based on your project type
  • The image is deployed to our infrastructure
  • A unique URL is generated and returned to you
  • Next Steps