Ruby bindings for Digital Ocean's API.
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Digital Ocean API

This gem is a simple and easy-to-use wrapper for Digital Ocean's API.


Add this line to your application's Gemfile:

gem 'digital-ocean'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install digital-ocean


To use the API methods, you'll need to retrieve your client ID and API key from Digital Ocean after logging in. You can then instantiate a new client and use the API methods.

# Create a new client
client = DigitalOcean.client(
  :client_id => "202cd122bd857fb65d80bf804ef47fde",
  :api_key   => "cd7d64f341654411eadb4b32e2c6a2ae"


Retrieve a list of your droplets

This method returns an array of droplets each with the following attributes: backups_active, created_at, id, image_id, ip_address, locked, name, private_ip_address, region_id, size_id, status

# => #<Hashie::Mash droplets=[#<Hashie::Mash backups_active=false cre...

Retrieve a droplet by its ID

This method retrieves a single droplet by its ID.


Create a new droplet

This method creates a new droplet. It takes the following parameters:

  • :name Required, String, this is the name of the droplet - must be formatted by hostname rules.
  • :size_id Required, Numeric, this is the id of the size you would like the droplet created at.
  • :image_id Required, Numeric, this is the id of the image you would like the droplet created with.
  • :region_id Required, Numeric, this is the id of the region you would like your server in.
  • :ssh_key_ids Optional, Numeric CSV, comma separated list of ssh_key_ids that you would like to be added to the server.
  • :private_networking Optional, Boolean, enables a private network interface if the region supports private networking.
  :name        => '',
  :size_id     => 63,
  :region_id   => 4,
  :ssh_key_ids => "ssh-key rsa e5ab78..,ssh-key rsa...",
  :private_networking => true


Retrieve a list of available regions

This method returns a list of regions that are available to create a new droplet in with info about each location.



Retrieve a list of available sizes

This method retrieves a list of available sizes for a new droplet along with information about each size.



  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request