PHPackages                             pxgamer/digitalocean-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. pxgamer/digitalocean-php

ActiveLibrary[API Development](/categories/api)

pxgamer/digitalocean-php
========================

An easy to use wrapper for the DigitalOcean API written in PHP.

v2.1.2(8y ago)179MITPHPPHP ^7.1

Since Dec 7Pushed 8y ago1 watchersCompare

[ Source](https://github.com/pxgamer/digitalocean-php)[ Packagist](https://packagist.org/packages/pxgamer/digitalocean-php)[ RSS](/packages/pxgamer-digitalocean-php/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (2)Versions (13)Used By (0)

digitalocean-php
================

[](#digitalocean-php)

[![Latest Version on Packagist](https://camo.githubusercontent.com/89374783c4536498e009a731f11055bfd6e7db1cdbb4c19fd3ba2bf9e61d4a5f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f707867616d65722f6469676974616c6f6365616e2d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pxgamer/digitalocean-php)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/c9e857da54c459d322dfd77d80f691f053505cb7948590057d3c132b4109be45/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f707867616d65722f6469676974616c6f6365616e2d7068702f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/pxgamer/digitalocean-php)[![Style CI](https://camo.githubusercontent.com/99ec912397c5a8a9135a33474fd58b6e38309391c4a73ba2dd5a490f1eefd408/68747470733a2f2f7374796c6563692e696f2f7265706f732f37313334393537342f736869656c64)](https://styleci.io/repos/71349574)[![Code Coverage](https://camo.githubusercontent.com/af25cda205838f97da5fb6e724e0e0da2c8015d5adf3dcbfa32619b69a61838c/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f707867616d65722f6469676974616c6f6365616e2d7068702e7376673f7374796c653d666c61742d737175617265)](https://codecov.io/gh/pxgamer/digitalocean-php)[![Total Downloads](https://camo.githubusercontent.com/a6bae7b64b5df8b3596c1b88d92107daf550f7d499932c8fa276c0e4b9c5de78/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f707867616d65722f6469676974616c6f6365616e2d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pxgamer/digitalocean-php)

An easy to use wrapper for the DigitalOcean API written in PHP.

Structure
---------

[](#structure)

```
src/
tests/
vendor/

```

Install
-------

[](#install)

Via Composer

```
$ composer require pxgamer/digitalocean-php
```

Usage
-----

[](#usage)

```
use \pxgamer\DigitalOcean\Client;
$client = new Client();
```

### Classes

[](#classes)

*Client*

- This is the main class and is used to hold the CURL functions. It also contains the API key, and should be called first.
- *This class **must** be passed to other classes upon their initialisation.*

*Account*

- This class is used to retrieve account information.

*Domains*

- This class is used to modify and retrieve domain information.

*Droplets*

- This class is used to manage multiple droplets, or all droplets for an account.

*Droplet*

- This class is used to manage droplets individually and can provides functions such as creating snapshots, enabling and disabling features, etc.

```
// Use the specific classes as their short names
use \pxgamer\DigitalOcean;

// Create a new Client instance
$client   = new DigitalOcean\Client();
$client->setAuthKey('API_KEY');

// Initialise a new instance of each class
$account  = new DigitalOcean\Account($client);
$domains  = new DigitalOcean\Domains($client);
$droplets = new DigitalOcean\Droplets($client);
$droplet  = new DigitalOcean\Droplet($client);
```

### Methods

[](#methods)

#### Client Class

[](#client-class)

```
/**
 * This is required to be initialised first.
 * It must be passed into all other classes.
 */
use \pxgamer\DigitalOcean\Client;
$client = new Client();
$client->setAuthKey('API_KEY');
```

#### Account Class

[](#account-class)

*Initialise Account Class*

```
use \pxgamer\DigitalOcean\Account;
$account = new Account($client);
```

*Getting Account Information*

```
$account->getAccount();
```

#### Domains Class

[](#domains-class)

*Initialise Domains Class*

```
use \pxgamer\DigitalOcean\Domains;
$domains = new Domains($client);
```

*Getting a list of domains*

```
$domains->listDomains();
```

*Getting information for a specific domain*

```
$domains->getDomain('example.com');
```

*Create a new domain*

```
$domains->createDomain('example.com');
```

*Deleting a domain*

```
$domains->deleteDomain('example.com');
```

#### Droplets Class

[](#droplets-class)

*Initialise Droplets Class*

```
// Requires the Client class to be initialised
use \pxgamer\DigitalOcean\Droplets;
$droplets = new Droplets($client);
```

*Listing droplets*

```
$droplets->listDroplets();
```

*Listing neighbours of Droplets (droplets in the same location)*

```
$droplets->listNeighbours();
```

#### Droplet Class

[](#droplet-class)

*Initialise Droplet Class*

```
// Requires the Client class to be initialised
use \pxgamer\DigitalOcean\Droplet;
$droplet = new Droplet($client);
```

*Setting the Droplet ID*

```
$droplet->setDroplet('DROPLET_ID');
```

*Getting information about a droplet*

```
// Requires the droplet ID to be set
$droplet->getDroplet();
```

*Creating a Droplet*

```
$dropletAttributes = (array)[
    'name' => 'example.com',       // Required
    'region' => 'nyc3',            // Required
    'size' => '512mb',             // Required
    'image' => 'ubuntu-14-04-x64', // Required
    'ssh_keys' => null,
    'backups' => false,
    'ipv6' => true,
    'user_data' => null,
    'private_networking' => null,
    'volume' => null,
    'tags' => [
        'web'
    ],
];

$droplet->createDroplet($dropletAttributes);
```

*Deleting a Droplet*

```
// Requires the droplet ID to be set
$droplet->deleteDroplet();
```

*Listing a Droplet's neighbours*

```
// Requires the droplet ID to be set
$droplet->listNeighbours();
```

*Create a snapshot*

```
// Requires the droplet ID to be set
$droplet->createSnapshot('SNAPSHOT-NAME');
```

*Enabling backups for a Droplet*

```
// Requires the droplet ID to be set
$droplet->enableBackups();
```

*Disabling backups for a Droplet*

```
// Requires the droplet ID to be set
$droplet->disableBackups();
```

*Rebooting a Droplet*

```
// Requires the droplet ID to be set
$droplet->reboot();
```

*Power Cycling a Droplet*

```
// Requires the droplet ID to be set
$droplet->powerCycle();
```

*Shutting down a Droplet*

```
// Requires the droplet ID to be set
$droplet->shutdown();
```

*Powering off a Droplet*

```
// Requires the droplet ID to be set
$droplet->powerOff();
```

*Powering on a Droplet*

```
// Requires the droplet ID to be set
$droplet->powerOn();
```

*Resizing a Droplet*

```
/**
 * Requires the droplet ID to be set
 *
 * Attributes:
 * - $size [string] (e.g. '1gb')
 * - $increaseDiskSize [boolean] (e.g. false) - Determines whether this is a permanent resize or not
 */

$droplet->resize('1gb', false);
```

*Reset a Droplet's password*

```
// Requires the droplet ID to be set
$droplet->passwordReset();
```

*Renaming a Droplet*

```
// Requires the droplet ID to be set
$droplet->rename('NEW_DROPLET_NAME');
```

*Enable IPv6 for a Droplet*

```
// Requires the droplet ID to be set
$droplet->enableIPv6();
```

*Enable Private Networking for a Droplet*

```
// Requires the droplet ID to be set
$droplet->enablePrivateNetworking();
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE\_OF\_CONDUCT](CODE_OF_CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [pxgamer](https://github.com/pxgamer)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~36 days

Recently: every ~8 days

Total

11

Last Release

3127d ago

Major Versions

v1.0.6 → v2.0.02017-01-03

PHP version history (3 changes)v1.0.2PHP &gt;=5.5.0

v2.0.1PHP &gt;=5.6.0

v2.1.0PHP ^7.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1899334?v=4)[Owen Voke](/maintainers/owenvoke)[@owenvoke](https://github.com/owenvoke)

---

Top Contributors

[![owenvoke](https://avatars.githubusercontent.com/u/1899334?v=4)](https://github.com/owenvoke "owenvoke (41 commits)")

---

Tags

php-wrapper

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/pxgamer-digitalocean-php/health.svg)

```
[![Health](https://phpackages.com/badges/pxgamer-digitalocean-php/health.svg)](https://phpackages.com/packages/pxgamer-digitalocean-php)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
