do-disposable

Visit site

A tool to create/destroy a Droplet from the command line. Useful for actions where you might be constrained by your host systems connection or specs.

do-disposable

Allows you to create a disposable Droplet with a simple CLI interface. This is useful for trying to run actions which may be network intensive to do on your standard internet connection or too CPU intensive for your system since you can start a Droplet to the size you need and then have it easily disposed of when you’re done.

The following sub-commands are included:

  • auth: Authenticates the user and creates the configuration if this doesn’t exist. This is the sub-command you will be prompted to run on first launch of this tool.
  • setregion: Allows you to modify the region. Note that you need to go through the setup with do-disposable auth first (that will also configure this for the first time).
  • setsize: Allows you to modify the Droplet size. Note that you need to go through the setup with do-disposable auth first (that will also configure this for the first time).
  • up: Allows you to start up a new disposable Droplet.

Additionally, when deploying the Droplet, the following commands are deployed to the Droplet:

  • copyfrom <host file/folder path> [droplet save location]: Allows you to copy a file/folder from the host to the Droplet.
  • copyback <droplet file/folder path> [host save location]: Allows you to copy a file/folder back from the Droplet.

First Usage

You can find a binary for your operating system in the releases page.

On first boot, you should be logged in to DigitalOcean and then run do-disposable auth. On the first boot, this will then walk through through the authentication, set region and set size configurations.

From here, you can simply start the droplet with do-disposable up (see starting the droplet for help with this).

Authentication

To change your SSH key/token after the first boot, you can run do-disposable auth. When you run this, you will be prompted for your DigitalOcean token:

token_prompt

You can get this from the API section of the DigitalOcean dashboard: api token

This will also automatically generate/save the SSH key which do-disposable will use internally.

Set Region

To set the region outside of the first boot, you can use do-disposable setregion. This will prompt you to hit the key of the region which you wish to use:

setregion

Set Size

To set the size outside of the first boot, you can use do-disposable setsize. This will prompt you to hit the key of the size which you wish to use:

setsize

Starting The Droplet

To start the Droplet, you can use do-disposable up. Note that by default, up will use the default values from your configuration and the latest Debian release for your distro. The following flags can be used:

  • distro: Allows you to override the distro slug with another one from the DigitalOcean API. This defaults to the latest Debian release (e.g.: -distro ubuntu-19-10-x64).
  • region: Allows you to override the region slug with another one. Will default to the one set above (e.g.: -region nyc3).
  • size: Allows you to override the size slug with another one. Will default to the one set above (e.g.: -size s-1vcpu-2gb).

To get slugs for different Droplet attributes, you can use this tool.

From here, you can run Linux commands (including copyfrom and copyback) and then you can exit the Droplet. Exiting will destroy the Droplet:

session

Was this helpful?
 
Leave a comment


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Publish your Tool on Community

Have you created an Integration, API Wrapper, Service, or other Tool that helps developers build on DigitalOcean? Help users find it by listing it in Community Tools.

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel