HubDocs

Guides

Instances

Give staging, a client, or a demo its own running copy.

View Markdown

Deploy a staging copy

From your app's project folder:

CLI
hub deploy --instance staging

Hub creates a separate instance and prints its URL. Production stays unchanged.

To set variables before its first deployment, create an empty instance of an existing app with hub app my-app instance create staging, then set its environment using my-app/staging. Deploy to it with hub deploy --name my-app --instance staging. The separate create command is optional when deploying directly.

Work with staging

List the app's instances:

CLI
hub app my-app instance list

Use app/instance in app commands:

CLI
hub app my-app/staging open
hub app my-app/staging logs

Each instance has its own releases, variables, access settings, and volumes. Staging does not copy production data. An app invitation grants access across the app's instances.

An app name alone targets prod for operations such as logs and status. Deletion is different: hub app my-app rm deletes the app and every instance; hub app my-app/staging rm deletes only staging.

Deleting and recreating an instance with the same name gives it separate volumes. It never adopts retained data from the deleted instance, and the CLI and dashboard do not offer a restore operation. See storage and deletion.

Check your allowance before adding an instance.

Remove an instance

CLI
hub app my-app instance remove staging

This removes only staging. In an interactive terminal, Hub asks you to confirm removal, then asks separately whether to delete its data volumes.

To remove it without prompts and retain its volumes:

CLI
hub app my-app instance remove staging --yes

To delete its volumes too, use --delete-data. This flag also skips both confirmation prompts:

CLI
hub app my-app instance remove staging --delete-data

Deleting volumes permanently removes the instance's stored data. Check the instance name and back up data you need before confirming.

Deployment options

On this page