Skip to main content

Get Started with DBOS

Deploy Your First App to the Cloud

Using the CLI?

1. Initialize your application

Create a folder for your app with a virtual environment, then enter the folder and activate the virtual environment. Next, install dbos and initialize your folder with a sample application.

You can choose another name for your app. Names should be 3 to 30 characters long and contain only lowercase letters and numbers, dashes, and underscores.

python3 -m venv my-app/.venv
cd my-app
source .venv/bin/activate
pip install dbos
dbos init

2. Install the DBOS Cloud CLI

The Cloud CLI requires Node.js 20 or later.

Instructions to install Node.js

Run the following commands in your terminal:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

nvm install 22
nvm use 22

Run this command to install it.

npm i -g @dbos-inc/dbos-cloud@latest

3. Deploy to DBOS Cloud!

First, run pip freeze to create a requirements file specifying your app's dependencies. Then, run dbos-cloud app deploy to deploy your app to DBOS Cloud. Follow the prompts to sign in and to provision a Postgres database server on the cloud.

pip freeze > requirements.txt
dbos-cloud app deploy

In less than a minute, it should print Access your application at <URL>. To see that your app is working, visit <URL> in your browser.

https://<username>-my-app.cloud.dbos.dev

Welcome to DBOS!

Congratulations, you've successfully deployed your first app to DBOS Cloud! You can see your deployed app in the cloud console.

1. Find a Template

From https://console.dbos.dev/launch, select the template you'd like to deploy. When prompted, create a database for your app with default settings.

Not sure which template to use? We recommend the DBOS Web App Starter.

Cloud Console Templates

2. Connect to GitHub

To ensure you can easily update your project after deploying it, DBOS will create a GitHub repository for it. You can deploy directly from that GitHub repository to DBOS Cloud.

First, sign in to your GitHub account. Then, set your repository name and whether it should be public or private.

Deploy with GitHub

3. Deploy to DBOS Cloud

Click "Create GitHub Repo and Deploy" and DBOS will clone a copy of the source code into your GitHub account, then deploy your project to DBOS Cloud. In less than a minute, your app should deploy successfully.

Congratulations, you've successfully deployed your first app to DBOS Cloud! Click the URL on your application page to see your application live on the Internet.

Application page

To start building, edit your application on GitHub (for the web app starter, source code is in app/main.py), commit your changes, then press "Deploy From GitHub" to see your changes reflected in the live application.

Run DBOS Locally

1. Create a Virtual Environment

In a clean directory, create a Python virtual environment

If you already created a git repository from the cloud console, you can clone your repository and create a virtual environment there instead.

python3 -m venv .venv
source .venv/bin/activate

2. Install and Initialize DBOS

Install DBOS with pip install dbos, then initialize a starter application. We recommend dbos-toolbox, which contains example code for useful DBOS features.

If you cloned a git repository, you don't need to run dbos init—your app is already initialized.

pip install dbos
dbos init --template dbos-toolbox

3. Start Your App

Now, create some database tables, then start your app! DBOS will automatically guide you through connecting to your app to a Postgres database.

dbos migrate
dbos start
http://localhost:8000/

Welcome to DBOS!

Congratulations, you're running DBOS locally! To learn more about building DBOS apps, check out the Python programming guide.