Skip to main content

Deploying to DBOS Cloud

Any application built with DBOS can be deployed to DBOS Cloud. DBOS Cloud is a serverless platform for durably executed applications. It provides:

  • Application hosting and autoscaling: Managed hosting of your application in the cloud, automatically scaling to millions of users. Applications are charged only for the CPU time they actually consume.
  • Managed workflow recovery: If a cloud executor is interrupted, crashed, or restarted, each of its workflows is automatically recovered by another executor.
  • Workflow and queue management: Dashboards of all active and past workflows and all queued tasks, including their status, inputs, outputs, and steps. Cancel, resume, or restart any workflow execution and manage the tasks in your distributed queues.

Deploying Your App to DBOS Cloud

1. 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

2. Create a requirements.txt File

Create a requirements.txt file listing your application's dependencies.

pip freeze > requirements.txt

3. Define a Start Command

Set the start command in the runtimeConfig section of your dbos-config.yaml to your application's launch command.

If your application includes an HTTP server, configure it to listen on port 8000.

To test that it works, try launching your application with dbos start.

runtimeConfig:
start:
- "fastapi run"

4. Deploy to DBOS Cloud

Run this single command to deploy your application to DBOS Cloud!

dbos-cloud app deploy

DBOS Cloud How-Tos

HTTP Serving & Port Numbers

DBOS Cloud provides your application with an HTTPS URL and routes traffic to it. It expects applications to listen for HTTP requests on port 3000 (TypeScript) or port 8000 (Python).

Environment Management

We recommend you configure your application with environment variables. You can use DBOS Cloud secrets to pass environment variables to your cloud application. You can even import secrets into DBOS Cloud from a .env file.

Database Setup

System Database

DBOS Cloud automatically constructs a system database for your application. You can access it at DBOS_SYSTEM_DATABASE_URL. You should not attempt to override or modify this URL.

Cloud-Provided Application Databases

You may connect an application database to your application through DBOS Cloud. If you do, connection information is provided via the DBOS_DATABASE_URL environment variable.

You may optionally direct DBOS Cloud to run migrations to set up your application's database schema by specifying migration commands in your dbos-config.yaml file:

migrate:
- npx knex migrate:latest

DBOS Cloud will provide a database URL to your migrations through the DBOS_DATABASE_URL environment variable.