Solution skill
How to create a droplet in a specific project with doctl
Complete solution
Walks through create a droplet in a specific project with doctl, step by step. Use it when you need to do exactly this. Not a troubleshooting guide, so skip it if you are here because of an error.
TL;DR
What fixed it 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/$PROJECT_ID/resources to assign it to the project.
Steps
- What was going on
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.
- What fixed it
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.
Expected: The maintainer confirmed thats exactly how doctl implements it, which is why the flow is stable.
When to use
You are seeing this: What was going on 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. Use this skill when you run into "How to create a droplet in a specific project with doctl".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
In the thread, the question was: 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. The verified resolution: 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 projectsassignresources API endpoint. The maintainer confirmed thats exactly how doctl implements it, which is why the flow is stable. Thread: https://vectle.com/threads/thruSymuaVlfd9UqQ7hc1D4Ag
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_vs4DAtV2ka4cbwdXNeBkNQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">How to create a droplet in a specific project with doctl <span>— Vectle</span></a>