Installation¶
To use the open-source version of dstack
(which is self-hosted to use your own cloud accounts or data centers),
go ahead and set up the server.
To use dstack Sky (a managed service that allows you to use either GPUs via marketplace, or connect to your own cloud accounts or data centers), proceed to dstack Sky.
Set up the server¶
Configure backends¶
Before starting the dstack
server, create ~/.dstack/server/config.yml
and
configure a backend for each cloud account that you'd like to use.
projects:
- name: main
backends:
- type: aws
creds:
type: access_key
access_key: AIZKISCVKUKO5AAKLAEH
secret_key: QSbmpqJIUBn1V5U3pyM9S6lwwiu8/fOJ2dgfwFdW
Go to the server/config.yml reference for details on how to configure backends for AWS, GCP, Azure, OCI, Lambda, TensorDock, Vast.ai, RunPod, CUDO, Kubernetes, etc.
Start the server¶
Once the ~/.dstack/server/config.yml
file is configured, proceed to start the server:
$ pip install "dstack[all]" -U
$ dstack server
Applying ~/.dstack/server/config.yml...
The admin token is "bbae0f28-d3dd-4820-bf61-8f4bb40815da"
The server is running at http://127.0.0.1:3000/
$ docker run -p 3000:3000 \
-v $HOME/.dstack/server/:/root/.dstack/server \
dstackai/dstack
Applying ~/.dstack/server/config.yml...
The admin token is "bbae0f28-d3dd-4820-bf61-8f4bb40815da"
The server is running at http://127.0.0.1:3000/
For more details on how to deploy
dstack
using Docker, check its Docker repo.
By default,
dstack
stores its state in~/.dstack/server/data
using SQLite. To use a database, set theDSTACK_DATABASE_URL
environment variable.
Once the dstack
server is up, feel free to use the CLI or API to work with it.
Set up the CLI¶
To point the CLI to the dstack
server, configure it
with the server address, user token and project name:
$ pip install dstack
$ dstack config --url http://127.0.0.1:3000 \
--project main \
--token bbae0f28-d3dd-4820-bf61-8f4bb40815da
Configuration is updated at ~/.dstack/config.yml
This configuration is stored in ~/.dstack/config.yml
.
Add on-prem servers¶
If you'd like to use
dstack
to run workloads on your on-prem servers, see on-prem fleets command.
dstack Sky¶
Set up the CLI¶
If you've signed up with dstack Sky ,
open the project settings, and copy the dstack config
command to point the CLI to the project.
Then, install the CLI on your machine and use the copied command.
$ pip install dstack
$ dstack config --url https://sky.dstack.ai \
--project peterschmidt85 \
--token bbae0f28-d3dd-4820-bf61-8f4bb40815da
Configuration is updated at ~/.dstack/config.yml
Configure backends¶
By default, dstack Sky uses the GPU from its marketplace, which requires a credit card to be attached in your account settings.
To use your own cloud accounts, click the settings icon of the corresponding backend and specify credentials:
What's next?¶
- Check the server/config.yml reference on how to configure backends
- Follow quickstart
- Browse examples
- Join the community via Discord