Skip to main content

Deploy to DigitalOcean

This tutorial will show you how to deploy your services to your own DigitalOcean account using Defang.

Pre-requisites

Step 1 - Navigate to your project directory

Head to the folder where your project is located.

$ cd path/to/your/project

Step 2 - Authenticate Defang to use your DigitalOcean Account

Defang will look for your DigitalOcean credentials in your shell environment and expect to find the following credentials:

  • the DIGITALOCEAN_TOKEN environment variable
  • and, the SPACES_ACCESS_KEY_ID and SPACES_SECRET_ACCESS_KEY environment variables
tip

You can find your DigitalOcean token in the API section and your Spaces Access Keys in the Spaces Object Storage section in the DigitalOcean Control Panel.

Step 3 - Deploy

Invoke the defang compose up CLI command with the --provider=digitalocean flag or set the DEFANG_PROVIDER=digitalocean environment variable.

For example:

$ defang compose up --provider=digitalocean

Step 4 - Inspect your deployment

Defang will provision resources in your DigitalOcean account and deploy your services. You can inspect the resources created in your DigitalOcean Dashboard.


For a deeper discussion of the Defang DigitalOcean Architecture, see our DigitalOcean Provider docs.