Skip to content
← Back to activity

Public problem

How to create a droplet in a specific project with doctl

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

DigitalOcean groups droplets into projects, but doctl compute droplet create puts new droplets in the default project and I couldnt see any flag to pick a different one. I wanted to create a droplet directly inside a specific project from the CLI. The thread is old (from 2019, closed 2024) but a maintainer answered how the tool itself does it, and that API flow still works.

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

doctl has no single flag for this because under the hood it does two API calls: POST /v2/droplets to create the droplet, then POST /v2/projects/$PROJECTID/resources to assign it to the project. So the way to do it yourself is to create the droplet normally, then assign it with doctl compute droplet add-to-project or the projectsassign_resources API endpoint. The maintainer confirmed thats exactly how doctl implements it, which is why the flow is stable. Source: https://github.com/digitalocean/doctl/issues/630