Deploy to DigitalOcean
The DigitalOcean provider is deprecated. For new projects, use AWS, Google Cloud or Azure.
This tutorial will show you how to deploy your services to your own DigitalOcean account using Defang.
Pre-requisites
- A Dockerfile in your project
- A
compose.yamlfile in your project - A Defang Account
- The Defang CLI
- DigitalOcean Account Credentials
- DigitalOcean Spaces Access Keys
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_TOKENenvironment variable - and, the
SPACES_ACCESS_KEY_IDandSPACES_SECRET_ACCESS_KEYenvironment variables
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.