Deploy new code to an existing environment without changing its URL. This is ideal when you've already shared a preview link with a client or reviewer and need to push changes.
How It Works
# First deploy
prev create . --subdomain client-demo
# URL: https://client-demo.us.prev.sh
# Make changes, then update
prev create --to client-demo .
# Same URL, new codeThe --to flag tells the CLI to:
The URL, subdomain, and Traefik routing stay the same. The TTL is reset from the current time.
Redeploy vs In-Place Update
| Dashboard Redeploy | CLI %%INLINECODE_1%% | |
|---|---|---|
| What it does | Restarts the container | Rebuilds from new source |
| Source code | Same image | New code uploaded |
| Use case | App crashed or hung | Code changes needed |
| Speed | Seconds | Same as initial deploy |
| URL | Unchanged | Unchanged |
Optional Overrides
You can change project settings during an update:
# Change the startup command
prev create --to client-demo --exec "node server.js" .
# Change the exposed port
prev create --to client-demo --port 8080 .
# Change the project type
prev create --to client-demo --type static .Settings not specified are preserved from the original deployment.
Security
Only the account that created the environment can update it. The API validates ownership through your API key — knowing a subdomain alone is not enough.