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.prev.sh

# Make changes, then update
prev create --to client-demo .
# Same URL, new code

The --to flag tells the CLI to:

  • Package your updated source code
  • Upload it to the existing environment's API endpoint
  • Rebuild the Docker image from scratch
  • Push the new image to the registry
  • Restart the Nomad job with the new image
  • The URL, subdomain, and Traefik routing stay the same. The TTL is reset from the current time.

    Review Rounds with Feedback

    If the environment was created with --feedback, a successful in-place update starts the next review round on the same URL. The review status returns to pending_review, new feedback and approvals are attached to the new round, and approvals from earlier rounds no longer count for the current round.

    Previous change requests remain visible as previous changes, so a reviewer can see what was already raised while approving the latest deployed version. Failed updates do not advance the review round.

    Redeploy vs In-Place Update

    Dashboard RedeployCLI --to
    What it doesRestarts the containerRebuilds from new source
    Source codeSame imageNew code uploaded
    Use caseApp crashed or hungCode changes needed
    SpeedSecondsSame as initial deploy
    URLUnchangedUnchanged

    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.