Get Started with DBOS
Deploy Your First App to the Cloud
Using the CLI?
- Python
- TypeScript
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.
- macOS or Linux
- Windows (PowerShell)
- Windows (cmd)
python3 -m venv my-app/.venv
cd my-app
source .venv/bin/activate
pip install dbos
dbos init
python3 -m venv my-app/.venv
cd my-app
.venv\Scripts\activate.ps1
pip install dbos
dbos init
python3 -m venv my-app/.venv
cd my-app
.venv\Scripts\activate.bat
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
- macOS or Linux
- Windows
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
Download Node.js 20 or later from the official Node.js download page and install it.
After installing Node.js, create the following folder: C:\Users\%user%\AppData\Roaming\npm
(%user%
is the Windows user on which you are logged in).
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.
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. Initialize your application
DBOS TypeScript requires Node.js 20 or later.
Instructions to install Node.js
- macOS or Linux
- Windows
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
Download Node.js 20 or later from the official Node.js download page and install it.
After installing Node.js, create the following folder: C:\Users\%user%\AppData\Roaming\npm
(%user%
is the Windows user on which you are logged in).
Initialize your app with this command.
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.
It creates and initializes a new folder named my-app/
with a sample app. Enter the folder to perform the next step.
npx -y @dbos-inc/create@latest -n my-app
cd my-app/
2. Deploy to DBOS Cloud!
Install the DBOS Cloud CLI.
npm i -g @dbos-inc/dbos-cloud@latest
Then, run this command to deploy your app to DBOS Cloud. Follow the prompts to sign in and to provision a Postgres database server on the cloud.
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.
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 + FastAPI starter.
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.
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!
4. View Your Application
At this point, your app is serverlessly deployed, with its very own URL assigned. If you continue to your application page, you can click on the URL to see your application live on the Internet.
To start building, edit your application on GitHub (for the DBOS + FastAPI 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 Your App Locally
- Python
- TypeScript
1. Git Clone Your Application
Clone your application from git and enter its directory.
git clone <your-git-url> my-app
cd my-app
2. Set up a Virtual Environment
Create a virtual environment and install dependencies.
- macOS or Linux
- Windows (PowerShell)
- Windows (cmd)
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python3 -m venv .venv
.venv\Scripts\activate.ps1
pip install -r requirements.txt
python3 -m venv .venv
.venv\Scripts\activate.bat
pip install -r requirements.txt
3. Install the DBOS Cloud CLI
The Cloud CLI requires Node.js 20 or later.
Instructions to install Node.js
- macOS or Linux
- Windows
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
Download Node.js 20 or later from the official Node.js download page and install it.
After installing Node.js, create the following folder: C:\Users\%user%\AppData\Roaming\npm
(%user%
is the Windows user on which you are logged in).
Run this command to install it.
npm i -g @dbos-inc/dbos-cloud@latest
4. Set up a Postgres Database
Your app needs a Postgres database to connect to. You can use a DBOS Cloud database, a Docker container, or a local Postgres installation.
Instructions to set up Postgres
- Use Cloud Postgres
- Launch Postgres with Docker
- Install Postgres
You can connect your local application to a Postgres database hosted in DBOS Cloud.
First, set a password for your DBOS Cloud database:
dbos-cloud db reset-password
Then connect your local app to your cloud database. When prompted, enter the password you just set.
dbos-cloud db local
- macOS
- Linux
- Windows (PowerShell)
- Windows (cmd)
You can install Docker on macOS through Docker Desktop.
Then, run this script to launch Postgres in a Docker container:
export PGPASSWORD=dbos
# Docker may require sudo -E
python3 start_postgres_docker.py
Follow the Docker Engine installation page to install Docker on several popular Linux distributions.
Then, run this script to launch Postgres in a Docker container:
export PGPASSWORD=dbos
# Docker may require sudo -E
python3 start_postgres_docker.py
You can install Docker on Windows through Docker Desktop.
Then, run this script to launch Postgres in a Docker container:
$env:PGPASSWORD = "dbos"
python3 start_postgres_docker.py
You can install Docker on Windows through Docker Desktop.
Then, run this script to launch Postgres in a Docker container:
set PGPASSWORD=dbos
python3 start_postgres_docker.py
If successful, the script should print Database started successfully!
- macOS
- Linux
- Windows (PowerShell)
- Windows (cmd)
Follow this guide to install Postgres on macOS.
Then, set the PGPASSWORD
environment variable to your Postgres password:
export PGPASSWORD=<your-postgres-password>
Follow these guides to install Postgres on popular Linux distributions.
Then, set the PGPASSWORD
environment variable to your Postgres password:
export PGPASSWORD=<your-postgres-password>
Follow this guide to install Postgres on Windows.
Then, set the PGPASSWORD
environment variable to your Postgres password:
$env:PGPASSWORD = "<your-postgres-password>"
Follow this guide to install Postgres on Windows.
Then, set the PGPASSWORD
environment variable to your Postgres password:
set PGPASSWORD=<your-postgres-password>
Alternatively, if you already have a Postgres database, update dbos-config.yaml
with its connection information.
5. Run the App
Next, run a schema migration to create tables for your app in your database. After that, start the app.
dbos migrate
dbos start
To see that it's working, visit this URL in your browser: http://localhost:8000/
Welcome to DBOS!
Congratulations, you've started a DBOS app locally! To learn more about building DBOS apps, check out our Python programming guide.
1. Git Clone Your Application
Clone your application from git and enter its directory.
git clone <your-git-url> my-app
cd my-app
2. Install Dependencies
DBOS TypeScript requires Node.js 20 or later.
Instructions to install Node.js
- macOS or Linux
- Windows
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
Download Node.js 20 or later from the official Node.js download page and install it.
After installing Node.js, create the following folder: C:\Users\%user%\AppData\Roaming\npm
(%user%
is the Windows user on which you are logged in).
Install dependencies.
npm install
3. Install the DBOS Cloud CLI
Run this command to install the Cloud CLI globally.
npm i -g @dbos-inc/dbos-cloud@latest
4. Set up a Postgres Database
Your app needs a Postgres database to connect to. You can use a DBOS Cloud database, a Docker container, or a local Postgres installation.
Instructions to set up Postgres
- Use Cloud Postgres
- Launch Postgres with Docker
- Install Postgres
You can connect your local application to a Postgres database hosted in DBOS Cloud.
First, set a password for your DBOS Cloud database:
dbos-cloud db reset-password
Then connect your local app to your cloud database. When prompted, enter the password you just set.
dbos-cloud db local
- macOS
- Linux
- Windows (PowerShell)
- Windows (cmd)
You can install Docker on macOS through Docker Desktop.
Then, run this script to launch Postgres in a Docker container:
export PGPASSWORD=dbos
# Docker may require sudo -E
node start_postgres_docker.js
Follow the Docker Engine installation page to install Docker on several popular Linux distributions.
Then, run this script to launch Postgres in a Docker container:
export PGPASSWORD=dbos
# Docker may require sudo -E
node start_postgres_docker.js
You can install Docker on Windows through Docker Desktop.
Then, run this script to launch Postgres in a Docker container:
$env:PGPASSWORD = "dbos"
node start_postgres_docker.js
You can install Docker on Windows through Docker Desktop.
Then, run this script to launch Postgres in a Docker container:
set PGPASSWORD=dbos
node start_postgres_docker.js
If successful, the script should print Database started successfully!
- macOS
- Linux
- Windows (PowerShell)
- Windows (cmd)
Follow this guide to install Postgres on macOS.
Then, set the PGPASSWORD
environment variable to your Postgres password:
export PGPASSWORD=<your-postgres-password>
Follow these guides to install Postgres on popular Linux distributions.
Then, set the PGPASSWORD
environment variable to your Postgres password:
export PGPASSWORD=<your-postgres-password>
Follow this guide to install Postgres on Windows.
Then, set the PGPASSWORD
environment variable to your Postgres password:
$env:PGPASSWORD = "<your-postgres-password>"
Follow this guide to install Postgres on Windows.
Then, set the PGPASSWORD
environment variable to your Postgres password:
set PGPASSWORD=<your-postgres-password>
Alternatively, if you already have a Postgres database, update dbos-config.yaml
with its connection information.
5. Run the App
Next, run a schema migration to create tables for your app in your database. After that, build and start the app.
npx dbos migrate
npm run build
npx dbos start
To see that it's working, visit this URL in your browser: http://localhost:3000/
Welcome to DBOS!
Congratulations, you've started a DBOS app locally! To learn more about building DBOS apps, check out our TypeScript programming guide.