PHPackages                             dutchie027/vultr - 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. dutchie027/vultr

ActiveLibrary[API Development](/categories/api)

dutchie027/vultr
================

Vultr PHP API

v3.0.1(3y ago)92571MITPHPPHP &gt;=8.0CI failing

Since Dec 18Pushed 3y ago1 watchersCompare

[ Source](https://github.com/dutchie027/vultr-php)[ Packagist](https://packagist.org/packages/dutchie027/vultr)[ RSS](/packages/dutchie027-vultr/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (10)Dependencies (8)Versions (18)Used By (0)

vultr-php
=========

[](#vultr-php)

[![Latest Stable Version](https://camo.githubusercontent.com/8e5f8fd06076c12b0cf8cdaa6304967707005eeef79f202022e7dae10ca9de31/68747470733a2f2f706f7365722e707567782e6f72672f647574636869653032372f76756c74722f76)](//packagist.org/packages/dutchie027/vultr)[![Total Downloads](https://camo.githubusercontent.com/b2ddef8b442c45fe0970450b286b0761b947fa697b3868c07316764eae5e06a3/68747470733a2f2f706f7365722e707567782e6f72672f647574636869653032372f76756c74722f646f776e6c6f616473)](//packagist.org/packages/dutchie027/vultr)[![License](https://camo.githubusercontent.com/7605ee6021cf7fd90cc65c156c62fdd4df5463822da684bea642959d4a9b86f0/68747470733a2f2f706f7365722e707567782e6f72672f647574636869653032372f76756c74722f6c6963656e7365)](//packagist.org/packages/dutchie027/vultr)[![CodeFactor](https://camo.githubusercontent.com/cef5872876691633800bc23d87ea08d2430a8e124bd756da4fd6afa95fd8850a/68747470733a2f2f7777772e636f6465666163746f722e696f2f7265706f7369746f72792f6769746875622f647574636869653032372f76756c74722d7068702f6261646765)](https://www.codefactor.io/repository/github/dutchie027/vultr-php)[![PHPStan Check](https://github.com/dutchie027/vultr-php/actions/workflows/standards.yml/badge.svg)](https://github.com/dutchie027/vultr-php/actions/workflows/standards.yml)

PHP Library Intended to Interact with [Vultr's v2 API](https://www.vultr.com/api/v2)

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

[](#installation)

```
composer require dutchie027/vultr
```

Usage
-----

[](#usage)

```
// require the composer library
require_once ('vendor/autoload.php');

// make the connction to the API for use
// this will use "vultr.ini" with the KVPs created
// at composer load. As a minimum you need the API
$api = new dutchie027\Vultr\API();

...
```

### vultr.ini

[](#vultrini)

This file drives the main configuration of the software. By default, it looks for the file in the root directory of your project using the name vultr.ini. If you want, you can give it another name and specifiy the full .ini path in the class instantiation.

The minimum Key/Value Pair in the `[api]` key with the `TOKEN` being your API token from the My Vultr Portal.

```
# minimum vultr.ini
[api]
TOKEN='8675309TOMMY30918IN'
```

The full settings that can be supplied in the .ini are:

```
# full vultr.ini
[api]
TOKEN='12345

[log]
LOG_PREFIX='vultr'
LOG_LEVEL=200
LOG_DIR='/var/log/'
```

General Information
-------------------

[](#general-information)

### Class Listing

[](#class-listing)

The library has the following classes:

- [Account](/docs/Account.md)
- [API](/docs/API.md)
- [Backups](/docs/Backups.md)
- [BareMetal](/docs/BareMetal.md)
- [BlockStorage](/docs/BlockStorage.md)
- [DNS](/docs/DNS.md)
- [Firewalls](/docs/Firewalls.md)
- [Instances](/docs/Instances.md)
- [ISO](/docs/ISO.md)
- [LoadBalancers](/docs/LoadBalancers.md)
- [ObjectStorage](/docs/ObjectStorage.md)
- [OperatingSystems](/docs/OperatingSystems.md)
- [Plans](/docs/Plans.md)
- [PrivateNetworks](/docs/PrivateNetworks.md)
- [Regions](/docs/Regions.md)
- [ReservedIPs](/docs/ReservedIPs.md)
- [Snapshots](/docs/Snapshots.md)
- [SSHKeys](/docs/SSHKeys.md)
- [StartupScripts](/docs/StartupScripts.md)
- [Users](/docs/Users.md)

Class Information
-----------------

[](#class-information)

### API

[](#api)

The main connection requires at minimum, an API key. You can get this by visiting [My Vultr Portal -&gt; Account -&gt; API](https://my.vultr.com/settings/#settingsapi). In the portal, make sure you set the IP(s) you'll be calling the API from also, as by default it will lock it to the single IP you request the API from.

Once you have the API token, you can simply connect with it or you can add options

```
// Ensure we have the composer libraries
require_once ('vendor/autoload.php');

// Instantiate with defaults
$api = new dutchie027\Vultr\API();
```

### Account

[](#account)

Once you have a client, you can ask for the basic information about your account. NOTE: All payloads are returned in JSON, so you can choose how you want to deal with them:

```
// Ensure we have the composer libraries
require_once ('vendor/autoload.php');

// Instantiate with defaults
$api = new dutchie027\Vultr\API();

// Lets get the account info and what else this API key can do
print_r(json_decode($api->account()->getAccountInfo(), true));
```

### Block Storage

[](#block-storage)

#### Creating Block Storage

[](#creating-block-storage)

```
// Ensure we have the composer libraries
require_once ('vendor/autoload.php');

// Instantiate with defaults
$api = new dutchie027\Vultr\API();

$config = [
    'region' => 'ewr',
    'size' => '10',
    'label' => 'my first storage',
];

$json_return = $api->blockStorage()->createBlockStorage($config);
```

##### Config

[](#config)

If you call this without any `$config` it will still create block storage. It will use the defaults as described below.

ParameterTypeDescriptionDefault Value`region`stringThe region where you want the storage created. *NOTE* If you choose a location that does NOT have block storate, it will revert to the default.ewr`size`integerThe size (in GB) of how much storage you want created. *NOTE* This value must be between 10 and 1000010`label`stringA text label to be associated with the storage*null*##### Return Value

[](#return-value)

You will be returned with a JSON payload that includes the newly created Block ID as well as the cost (in dollars) and size (in GB):

```
{
  "block": {
    "id": "8692c434-08fa-4efb-a0fb-966a338aee07",
    "date_created": "2020-12-18T03:11:57+00:00",
    "cost": 1,
    "status": "pending",
    "size_gb": 10,
    "region": "ewr",
    "attached_to_instance": "",
    "label": "my first storage"
  }
}
```

#### Updating Block Storage

[](#updating-block-storage)

```
// Ensure we have the composer libraries
require_once ('vendor/autoload.php');

// Instantiate with defaults
$api = new dutchie027\Vultr\API();

$config = [
    'blockid' => '8692c434-08fa-4efb-a0fb-966a338aee07',
    'size' => '40',
    'label' => 'not my first rodeo',
];

$api->blockStorage()->updateBlockStorage($config);
```

##### Block Storage Config

[](#block-storage-config)

Block storage can only be updated once every 60 seconds. To update the storage you need a minimum of the `blockid` and either a `size` or new `label`.

#### Deleting Block Storage

[](#deleting-block-storage)

```
// Ensure we have the composer libraries
require_once ('vendor/autoload.php');

// Instantiate with defaults
$api = new dutchie027\Vultr\API();

$api->blockStorage()->deleteBlockStorage($blockid);
```

The block ID is in the form of a GUID (something like 8692c434-08fa-4efb-a0fb-966a338aee07). If you provide a GUID that isn't in your storage container, it will fail.

#### Listing Specific Storage

[](#listing-specific-storage)

```
// Ensure we have the composer libraries
require_once ('vendor/autoload.php');

// Instantiate with defaults
$api = new dutchie027\Vultr\API();

$json_return = $api->blockStorage()->getBlockStorage($blockid);
```

The block ID is in the form of a GUID (something like 8692c434-08fa-4efb-a0fb-966a338aee07). If you provide a GUID that isn't in your storage container, it will fail.

#### Attaching Block Storage

[](#attaching-block-storage)

```
// Ensure we have the composer libraries
require_once ('vendor/autoload.php');

// Instantiate with defaults
$api = new dutchie027\Vultr\API();

$config = [
 'block_id' => '98772323-044a-4efb-a0fb-1234338abb07',
 'instance' => '12345434-08fa-4efb-a0fb-966a338aee07',
    'live' => false,
];

$api->blockStorage()->attachBlockStorage($config);
```

All three values are required in the `$config`. The `block_id` is the ID of the block storage you want to attach. The `instance` is the instance ID of the machine you want the storage attached to. It must also be in the same location as the storage. The value `live` is either `true` or `false`. If it is set to `true` it will attach the storage but NOT restart the instance. If you set `live` to `false` it will RESTART the instance and then attach the block storage.

#### Detatching Block Storage

[](#detatching-block-storage)

```
// Ensure we have the composer libraries
require_once ('vendor/autoload.php');

// Instantiate with defaults
$api = new dutchie027\Vultr\API();

$config = [
 'block_id' => '98772323-044a-4efb-a0fb-1234338abb07',
    'live' => false,
];

$api->blockStorage()->detatchBlockStorage($config);
```

Both values are required in the `$config`. The `block_id` is the ID of the block storage you want to detatch. The value `live` is either `true` or `false`. If it is set to `true` it will attach the storage but NOT restart the instance. If you set `live` to `false` it will RESTART the instance and then detatch the block storage.

### Regions

[](#regions)

For the most part, this is a support class, but if you want to use it you can. Here's a few things you can do with it:

```
// Ensure we have the composer libraries
require_once ('vendor/autoload.php');

// Instantiate with defaults
$api = new dutchie027\Vultr\API();

// Print various information about the Regions. All pretty self-explanatory
$api->regions()->listIds();
$api->regions()->listCities();
$api->regions()->listCountries();
$api->regions()->listContinents();
$api->regions()->listNames();
```

To-Do
-----

[](#to-do)

- Bring in more of the function(s) from Vultr
- Document the class(es) with proper doc blocks better
- Move the documentation in to separate markdowns

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

[](#contributing)

If you're having problems, spot a bug, or have a feature suggestion, [file an issue](https://github.com/dutchie027/vultr-php/issues). If you want, feel free to fork the package and make a pull request. This is a work in progresss as I get more info and further test the API.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 65.1% 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 ~43 days

Recently: every ~120 days

Total

17

Last Release

1334d ago

Major Versions

v0.5-alpha → v1.0.02020-12-18

v1.9.0 → 2.0.02021-04-30

2.0.5 → v3.x-dev2022-10-16

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6707999?v=4)[dutchie027](/maintainers/dutchie027)[@dutchie027](https://github.com/dutchie027)

---

Top Contributors

[![dutchie027](https://avatars.githubusercontent.com/u/6707999?v=4)](https://github.com/dutchie027 "dutchie027 (127 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (51 commits)")[![jasoryeh](https://avatars.githubusercontent.com/u/13290941?v=4)](https://github.com/jasoryeh "jasoryeh (17 commits)")

---

Tags

automationphpphp-librariesvultrvultr-apivultr-api-wrappervultr-phpphpcomposerautomationpaasSystem Administrationserver administrationVulrt

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/dutchie027-vultr/health.svg)

```
[![Health](https://phpackages.com/badges/dutchie027-vultr/health.svg)](https://phpackages.com/packages/dutchie027-vultr)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

563.6M13](/packages/checkout-checkout-sdk-php)[magento/magento2-functional-testing-framework

Magento2 Functional Testing Framework

15312.0M36](/packages/magento-magento2-functional-testing-framework)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M47](/packages/tencentcloud-tencentcloud-sdk-php)[ellaisys/aws-cognito

Laravel Authentication using AWS Cognito (Web and API)

123256.9k1](/packages/ellaisys-aws-cognito)

PHPackages © 2026

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