Skip to content

Latest commit

 

History

History
219 lines (142 loc) · 7.37 KB

20240910_daytona_digitalocean_provider.md

File metadata and controls

219 lines (142 loc) · 7.37 KB
title description date author tags
Setting Up Daytona DigitalOcean Provider
A step-by-step guide to setting up and configuring the Daytona DigitalOcean Provider for managing workspace projects on DigitalOcean droplets.
2024-09-10
Kiran Naragund
digitalocean
droplets
daytona

Setting Up Daytona DigitalOcean Provider

Introduction

The DigitalOcean Provider allows Daytona to create and manage Workspace projects on DigitalOcean droplets. This provider integrates Daytona with DigitalOcean, enabling scalable and flexible management of Workspaces in a cloud environment. To use the DigitalOcean Provider, we need a DigitalOcean API token with appropriate permissions. This token grants the necessary access to manage droplets, critical for Daytona’s Workspace project creation and management.

In this article, we will walk you through the setup and configuration of the Daytona DigitalOcean Provider, including creating an API token with the required permissions.

Prerequisites

To follow along with this article, you should have:

  • A basic understanding of DigitalOcean and Droplets.
  • A DigitalOcean account with access to create API tokens.
  • Installed Daytona latest version [install from here]

Note: [In this article, Daytona v0.29.1 is used]

TL;DR

  • Creating a DigitalOcean API Token with necessary permissions.

  • Install and configure the Daytona DigitalOcean Provider for creating and managing workspaces.

  • Set up DigitalOcean targets, including configuring auth token, size, region, and more.

  • Troubleshooting tips for common issues like invalid API Token, Droplet Creation Failure, and Provider Errors.

Step 1: Preparations

Create a DigitalOcean API Token

To configure the Daytona DigitalOcean Provider, create a DigitalOcean API token with Full Access permission. This token will allow Daytona to manage your droplets. Follow the steps below to create an API token:

  • Step 1.1: Log in to your DigitalOcean account and navigate to the API section in the dashboard.

    DigitalOcean Dashboard

  • Step 1.2: Click on Generate New Token under the Personal Access Tokens section.

    Generate New Token

  • Step 1.3: Give your token a descriptive name (e.g., daytona-provider) and select the scopes required for managing droplets.

    Note: [Select Full Access Scope, by selecting this you will give both read and write permission]

    token

  • Step 1.4: Click Generate Token and copy your token to use it later.

    copy token

Now that you have your API token, you're ready to set up the Daytona DigitalOcean Provider.

Step 2: Main Process

Step 2.1: Start Daytona Server

Start the daytona server by running the command

daytona server

Start Daytona Server

Step 2.2: Install the DigitalOcean Provider

Run the below command, You will be prompted to choose a provider. Select digitalocean-provider from the list

daytona provider install

digitalocean provider install

Step 2.3: Set the DigitalOcean Target

Run the following command to initiate the target setup process:

daytona target set

Step 2.3.1: Select the DigitalOcean Provider

You will be prompted to choose a provider. Select digitalocean-provider from the list

digitalocean-provider

Step 2.3.2: Create a New Target

After selecting the DigitalOcean provider, choose to create a new target and enter a unique and descriptive name for your DigitalOcean target (e.g., daytona-digitalocean-target).

New Target

Step 2.3.3: Configure DigitalOcean target options

You will be prompted to enter several configuration options for the DigitalOcean provider. Here's an overview:

  • Auth Token:

    Enter the API token you generated earlier. If you left empty, Daytona will attempt to retrieve it from the DIGITALOCEAN_API_TOKEN environment variable.

  • Disk Size:

    The size of the disk, in GB. Default is 20 GB.

  • Image:

    Select the base image for your droplet (e.g., ubuntu-24-04-x64). More information on images can be found here. here

  • Region:

    Select the DigitalOcean region where the droplets will be deployed (e.g., nyc3 for New York). Check available regions here

  • Size:

    Choose the droplet size (e.g., s-1vcpu-1gb). Find available droplet sizes here

    DigitalOcean target options

Click enter after filling all the details.

Congratulations, You have successfully setup and configured Daytona DigitalOcean Provider to create and manage workspace on droplets.

To verify daytona DigitalOcean provider has been successfully installed or not, run the below command you will get provider and target configuration information you have configured.

daytona provider list

provider list

Common Issues and Troubleshooting

While setting up and configuring the DigitalOcean Provider with Daytona, you may encounter some common issues. Below are troubleshooting tips to help resolve them:

  1. Problem: Invalid API Token

    Solution: Double-check that your DigitalOcean API token is correct and has the necessary scopes. You can generate a new token if needed.

  2. Problem: Droplet Creation Failure

    Solution: Ensure the selected region, droplet size, and image are valid for your target. Verify that you have sufficient resources (e.g., account limits) on DigitalOcean.

  3. Problem: Provider Errors

    Solution: If you encounter issues with the DigitalOcean provider, it could be due to bugs or limitations in the latest release. Keep an eye on the DigitalOcean Provider GitHub Repository for updates and fixes.

Conclusion

By following this article, you’ve successfully set up and configured the Daytona DigitalOcean Provider. You can now manage Workspaces on DigitalOcean using Daytona, leveraging its powerful infrastructure for your development and deployment needs.

For the latest information, refer to the official Daytona documentation.

References