How to Create Projects

Projects let you organize your DigitalOcean resources (like Droplets, Spaces, and load balancers) into groups that fit the way you work. You can create projects that align with the applications, environments, and clients that you host on DigitalOcean.


All of the DigitalOcean resources in your account start in a single default project. You can create additional projects and move resources between them to organize your resources in ways that align with how you use them.

Create a Project Using Automation

How to create a project using the DigitalOcean CLI

To create a project via the command-line, follow these steps:

  1. Install doctl, the DigitalOcean command-line tool.

  2. Create a personal access token, and save it for use with doctl.

  3. Use the token to grant doctl access to your DigitalOcean account.

                  doctl auth init
                
  4. Finally, create a project with doctl projects create. The basic usage looks like this, but you'll want to read the usage docs for more details:

                  doctl projects create [flags]
                
How to create a project using the DigitalOcean API

To create a project using the DigitalOcean API, follow these steps:

  1. Create a personal access token, and save it for use with the API.

  2. Send a POST request to https://api.digitalocean.com/v2/projects

    cURL

    To create a project with cURL, call:

    
                    curl -X POST \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
      -d '{"name":"my-web-api", "description": "My website API", "purpose": "Service or API", "environment": "Production"}' \
      "https://api.digitalocean.com/v2/projects"

    Go

    Go developers can use Godo, the official DigitalOcean V2 API client for Go. To create a project with Godo, use the following code:

    
                    import (
        "context"
        "os"
    
        "github.com/digitalocean/godo"
    )
    
    func main() {
        token := os.Getenv("DIGITALOCEAN_TOKEN")
    
        client := godo.NewFromToken(token)
        ctx := context.TODO()
    
        createReq := &godo.CreateProjectRequest{
          Name:        "my-web-api",
          Description: "My website API",
          Purpose:     "Service or API",
          Environment: "Production",
        }
    
        client.Projects.Create(ctx, createReq)
    }

    Ruby

    Ruby developers can use DropletKit, the official DigitalOcean V2 API client for Ruby. To create a project with DropletKit, use the following code:

    
                    require 'droplet_kit'
    token = ENV['DIGITALOCEAN_TOKEN']
    client = DropletKit::Client.new(access_token: token)
    
    project = DropletKit::Project.new(
      name: 'my-api',
      description: 'My website API',
      purpose: 'Service or API',
      environment: 'Production'
    )
    client.projects.create(project)

    Python

    
                    import os
    from pydo import Client
    
    client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
    
    req = {
      "name": "my-web-api",
      "description": "My website API",
      "purpose": "Service or API",
      "environment": "Production"
    }
    
    resp = client.projects.create(body=req)

Create a Project Using the Control Panel

In the control panel’s main menu, under the Projects section, click + New Project to open the project creation page.

Create new project

On the Create new project page, enter the name, description, and purpose of the project. You can change any project setting later by returning to the Settings tab.

  • Name your project (required). The project name is meant to be human-readable, so you can include spaces and special characters.

  • Add a description (optional). The project’s description appears at the top of all of all project pages, beneath the project’s name.

    The description can be up to 255 characters long (including spaces). The first 97 characters are displayed on the page heading.

  • Tell us what it’s for? (required). This field lets us show relevant tips and tutorials for your use case. There are several common purposes in the list, but you can choose Other to describe it yourself.

    The purpose can be up to 199 characters long. If you enter a longer description, you receive an error when you click Create Project.

When you’re done, click Create Project to go to the Move Resources page. Here, you can optionally move existing resources into the new project.

Move resources

When you click into the text area, a list of all movable resources from other projects appears. You can keep typing to filter the list. Click the names of the resources you want to move, then click the Move Resources button. If you choose Skip for now, you can move resources in later.

Either choice finalizes the creation of your project and redirects you to the Resources tab of the new project.

Example project with a Droplet

Resources you add appear on the Resources tab, grouped by type.