Skip to main content

DigitalOcean

info

The Defang DigitalOcean Provider is available for Public Preview as of October 2024.

Why should you use Defang with DigitalOcean? Defang allows you to easily create and manage full, scalable applications with DigitalOcean. Defang aims to make it easier to deploy your services to the cloud. DigitalOcean is one of the most popular cloud providers in the world and with Defang, you can bypass the complexities of the DigitalOcean platform. Let Defang do it for you and spend more time working on what's important to you!

Getting Started

Install Defang

To get started with the Defang BYOC DigitalOcean Provider, first install the latest version of the Defang CLI.

Sign up for DigitalOcean

Next, make sure you have signed up for a DigitalOcean account.

Authenticate with DigitalOcean

After signing up for your account, be sure to set up your personal access token. Defang will need to find this value in your shell as the DIGITALOCEAN_TOKEN environment variable.

Authenticate with DigitalOcean Spaces

You will also need a DigitalOcean Spaces access key. Defang will need to find this value in your shell as the SPACES_ACCESS_KEY_ID, and SPACES_SECRET_ACCESS_KEY environment variables.

Configure your shell environment

export DIGITALOCEAN_TOKEN=<your-token>
export SPACES_ACCESS_KEY_ID=<your-key-id>
export SPACES_SECRET_ACCESS_KEY=<your-key>

The Defang CLI will automatically check if these envinonment variables are set before running.

Deploy your project to DigitalOcean

Once you are ready to go, add the --provider=digitalocean to your command to tell the Defang CLI to use the DigitalOcean provider or set the DEFANG_PROVIDER environment variable to digitalocean.

$ defang compose up --provider=digitalocean
# or
$ export DEFANG_PROVIDER=digitalocean

Region

The Defang BYOC DigitalOcean Provider will use the region specified in the REGION environment variable. For a list of regions available in DigitalOcean, see the region documentation.

Architecture

Defang uses resources that are native to the cloud provider you are using. The following describes the current state of Defang's support for DigitalOcean, the specific resources that Defang uses, and the roadmap for future support.

Deployment

To deploy your services, the Defang CLI packages your code and uploads it to a Spaces Object Storage bucket in your account. The CLI then deploys an App Platform App that uses Pulumi to build your container image and run your service.

Runtime

The Provider runs your workloads using the DigitalOcean App Platform.

Secrets

Defang allows you to configure your services with sensitive config values in DigitalOcean. Sensitive values are added and stored with encryption in your app once it has been deployed.

Future Improvements

The following features are still in development for DigitalOcean:

Stay tuned for future updates!