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

    Redeploy vs In-Place Update

    Dashboard RedeployCLI %%INLINECODE_1%%
    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.