As an alternative to the
dstack start command,
you can run the Hub server via Docker. This is recommended if you want to deploy the Hub server in an environment that
Here's how to run
dstack via Docker:
$ docker run --name dstack -p <port-on-host>:3000 \ -v <path-to-data-directory>:/root/.dstack/hub \ dstackai/dstack
Here's the list of environment variables which you can override:
DSTACK_HUB_ADMIN_TOKEN– (Optional) The default token of the
adminuser. By default, it's generated randomly at the first startup.
DSTACK_HUB_DATA– (Optional) The path to the directory where the Hub server stores the state. Defaults to
dstack saves state in a local directory (see
If you want to persist state automatically to a cloud object storage, you can configure the following environment
LITESTREAM_REPLICA_URL- The url of the cloud object storage. Examples:
To persist state into an AWS S3 bucket, provide the following environment variables:
AWS_ACCESS_KEY_ID- The AWS access key ID
AWS_SECRET_ACCESS_KEY- The AWS secret access key
To persist state into an AWS S3 bucket, provide one of the following environment variables:
GOOGLE_APPLICATION_CREDENTIALS- The path to the GCP service account key JSON file
GOOGLE_APPLICATION_CREDENTIALS_JSON- The GCP service account key JSON
Azure Blob Storage
To persist state into an Azure blog storage, provide the following environment variable.
LITESTREAM_AZURE_ACCOUNT_KEY- The Azure storage account key
More details on options for configuring persistent state.
When you run
dstack via Docker, it doesn't allow you to configure a project that runs dev environments, pipelines, and apps locally.
You can only configure the projects that run dev environments, pipelines, and apps in the cloud.
If you want
dstack to run dev environments,
pipelines, and apps both locally and in the cloud, it is recommended to start the Hub server using the
dstack start command.