PHPackages                             dunglas/digital-ocean-bundle - 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. dunglas/digital-ocean-bundle

ActiveSymfony-bundle[API Development](/categories/api)

dunglas/digital-ocean-bundle
============================

DigitalOcean API v2 client for Symfony and API Platform

v1.2.0(1y ago)312.2k5[1 issues](https://github.com/dunglas/DunglasDigitalOceanBundle/issues)MITPHPPHP &gt;=8.1CI passing

Since Aug 31Pushed 1y ago2 watchersCompare

[ Source](https://github.com/dunglas/DunglasDigitalOceanBundle)[ Packagist](https://packagist.org/packages/dunglas/digital-ocean-bundle)[ GitHub Sponsors](https://github.com/dunglas)[ RSS](/packages/dunglas-digital-ocean-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (8)Versions (5)Used By (0)

DigitalOcean Bundle for Symfony and API Platform
================================================

[](#digitalocean-bundle-for-symfony-and-api-platform)

DunglasDigitalOceanBundle allows using [the DigitalOcean API](https://docs.digitalocean.com/reference/api/api-reference/)from your [Symfony](https://symfony.com) and [API Platform](https://api-platform.com) projects. It registers the [DigitalOcean PHP API Client](https://github.com/DigitalOceanPHP/Client) as a Symfony service.

If you aren't yet a DigitalOcean user, use [this affiliate link](https://m.do.co/c/5d8aabe3ab80) to get $100 in free credit!

If you want to deploy your Symfony apps to DigitalOcean, [checkout this tutorial](https://github.com/dunglas/symfony-docker/blob/main/docs/production.md).

Example
-------

[](#example)

```
// src/Controller/DigitalOceanController.php
namespace App\Controller;

use DigitalOceanV2\Client;
use DigitalOceanV2\ResultPager;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

class ProductController
{
    #[Route("/droplets")]
    public function listDroplets(Client $doClient): Response
    {
        // get the first 100 droplets as an array
        $droplets = $doClient->droplet()->getAll();

        // or create a new result pager
        $pager = new ResultPager($doClient);

        // and get all droplets as an array
        $droplets = $pager->fetchAll($doClient->droplet(), 'getAll');

        // ...
    }
}
```

Of course, you can also inject the client service into your commands, messenger handlers and any other service.

[More examples](https://github.com/DigitalOceanPHP/Client#examples).

Installation
------------

[](#installation)

Make sure Composer is installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md)of the Composer documentation.

### Applications that use Symfony Flex

[](#applications-that-use-symfony-flex)

Open a command console, enter your project directory and execute:

```
composer require dunglas/digital-ocean-bundle symfony/http-client nyholm/psr7 guzzlehttp/promises
```

The previous command installs the bundle, Symfony HttpClient and [the dependencies it needs](https://symfony.com.ua/doc/current/http_client.html#psr-18-and-psr-17)to "provide" [`psr/http-client-implementation`](https://packagist.org/providers/psr/http-client-implementation) and [`psr/http-factory-implementation`](https://packagist.org/providers/psr/http-factory-implementation).

Alternatively, you can use any other implementation of these interfaces such as Guzzle.

### Applications that don't use Symfony Flex

[](#applications-that-dont-use-symfony-flex)

#### Step 1: Download the Bundle

[](#step-1-download-the-bundle)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

```
$ composer require dunglas/digital-ocean-bundle symfony/http-client nyholm/psr7 guzzlehttp/promises
```

#### Step 2: Enable the Bundle

[](#step-2-enable-the-bundle)

Then, enable the bundle by adding it to the list of registered bundles in the `config/bundles.php` file of your project:

```
// config/bundles.php

return [
    // ...
    \Dunglas\DigitalOceanBundle\DunglasDigitalOceanBundle::class => ['all' => true],
];
```

Configuration
-------------

[](#configuration)

```
dunglas_digital_ocean:
    connections:
        primary: # can be any name
            token:
        secondary:
            token:
    default_connection: primary # If not set, the first in the list will be used
```

This configuration automatically registers the following autowiring aliases:

```
DigitalOceanV2\Client $primaryClient
DigitalOceanV2\Client $secondaryClient

```

If you have only one client, you can use this shortcut:

```
dunglas_digital_ocean:
```

Use the `DigitalOceanV2\Client` type to inject the default DigitalOcean client.

Credits
-------

[](#credits)

This bundle is brought to you by [Kévin Dunglas](https://dunglas.fr). It is sponsored by [Les-Tilleuls.coop](https://les-tilleuls.coop).

###  Health Score

41

—

FairBetter than 88% of packages

Maintenance46

Moderate activity, may be stable

Popularity29

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 50% 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 ~636 days

Total

3

Last Release

439d ago

PHP version history (2 changes)v1.0.0PHP &gt;=7.2.5

v1.1.0PHP &gt;=8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/57224?v=4)[Kévin Dunglas](/maintainers/dunglas)[@dunglas](https://github.com/dunglas)

---

Top Contributors

[![dunglas](https://avatars.githubusercontent.com/u/57224?v=4)](https://github.com/dunglas "dunglas (2 commits)")[![tacman](https://avatars.githubusercontent.com/u/619585?v=4)](https://github.com/tacman "tacman (1 commits)")[![tarlepp](https://avatars.githubusercontent.com/u/595561?v=4)](https://github.com/tarlepp "tarlepp (1 commits)")

---

Tags

api-platformdevopsdigitaloceankubernetesphpsymfonysymfony-bundleapisymfonyvpsdigitaloceanCloud HostingSSD

### Embed Badge

![Health badge](/badges/dunglas-digital-ocean-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/dunglas-digital-ocean-bundle/health.svg)](https://phpackages.com/packages/dunglas-digital-ocean-bundle)
```

###  Alternatives

[toin0u/digitalocean-v2

DigitalOcean API v2 client for PHP

7341.1M16](/packages/toin0u-digitalocean-v2)[toin0u/digitalocean

DigitalOcean API PHP 5.3+ library

15562.9k](/packages/toin0u-digitalocean)[harmbandstra/swagger-ui-bundle

Exposes swagger UI inside your Symfony project through a route (eg. /docs)

42867.3k](/packages/harmbandstra-swagger-ui-bundle)[php-tmdb/symfony

Symfony Bundle for TMDB (The Movie Database) API. Provides easy access to the php-tmdb/api library.

3649.7k](/packages/php-tmdb-symfony)

PHPackages © 2026

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