PHPackages                             snscripts/virtualmin-sdk - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. snscripts/virtualmin-sdk

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

snscripts/virtualmin-sdk
========================

Unofficial SDK for Virtualmin Control Panel

0.3.3(9y ago)32491[1 PRs](https://github.com/mikebarlow/virtualmin-sdk/pulls)1MITPHPPHP &gt;=5.5.0

Since Jul 10Pushed 5y ago2 watchersCompare

[ Source](https://github.com/mikebarlow/virtualmin-sdk)[ Packagist](https://packagist.org/packages/snscripts/virtualmin-sdk)[ Docs](https://github.com/snscripts/virtualmin-sdk)[ RSS](/packages/snscripts-virtualmin-sdk/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (4)Dependencies (4)Versions (9)Used By (1)

Virtualmin Control Panel SDK
============================

[](#virtualmin-control-panel-sdk)

[![Author](https://camo.githubusercontent.com/9d903e7623152bba92e485dae02e0ffe50922554087701bab4ab685ea10150d2/687474703a2f2f696d672e736869656c64732e696f2f62616467652f617574686f722d406d696b656261726c6f772d7265642e7376673f7374796c653d666c61742d737175617265)](https://twitter.com/mikebarlow)[![Source Code](https://camo.githubusercontent.com/5f00987f8b791ef4288f5343028746255ca46b85e3014b5f830e2a92f45f1497/687474703a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d736e736372697074732f7669727475616c6d696e2d2d73646b2d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/mikebarlow/virtualmin-sdk)[![Latest Version](https://camo.githubusercontent.com/f26397c9afc400a3117bec575cd7000bca564b8224d7149f7bd84b6b30c080dd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6d696b656261726c6f772f7669727475616c6d696e2d73646b2e7376673f7374796c653d666c61742d737175617265)](https://github.com/mikebarlow/virtualmin-sdk/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/mikebarlow/virtualmin-sdk/blob/master/LICENSE)

This is a PSR-2 Compliant Unofficial PHP SDK for the Virtualmin control panel which should hopefully make integrating your own systems into Virtualmin a piece of cake!

Requirements
------------

[](#requirements)

### Composer

[](#composer)

Virtualmin SDK requires the following:

- "php": "&gt;=5.5.0
- "guzzlehttp/guzzle": "6.2.\*",
- "cartalyst/collections": "1.1.\*"

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

[](#installation)

### Composer

[](#composer-1)

Simplest installation is via composer.

```
composer require snscripts/virtualmin-sdk 0.*

```

or adding to your projects `composer.json` file.

```
{
    "require": {
        "snscripts/virtualmin-sdk": "1.*"
    }
}

```

Usage
-----

[](#usage)

### Setup

[](#setup)

To get started you first need to define the Virtualmin class and pass in the Guzzle dependency.

```
use \Snscripts\Virtualmin\Virtualmin;

$Virtualmin = new Virtualmin(
    new GuzzleHttp\Client
);

```

Next you'll need to setup the connection to your Virtualmin Server. This requires the main account login details.

```
$Virtualmin->setConnection(
    'host:port',
    'user',
    'pass'
);

```

If you're server is running in http mode you can pass in the `Virtualmin::NOSECURE` constant as the fourth parameter of setConnection to disable the use of https. (Default behaviour is `Virtualmin::SECURE`).

```
$Virtualmin->setConnection(
    'host',
    'user',
    'pass',
    Virtualmin::NOSECURE
);

```

If you are running https on but it's in a development environment and doesn't actually have a valid SSL certificate, you can disable the checking of the certificate with:

```
$Virtualmin->setVerify(Virtualmin::NOVERIFY);

```

**THIS SHOULD NOT BE DONE IN PRODUCTION AND IS TO ONLY BE USED DURING DEVELOPMENT IF NEEDED**

### Using

[](#using)

When using the SDK you may find [this page](https://www.virtualmin.com/documentation/developer/cli) from the Virtualmin Documentation useful. It details what actions and parameters are available on the Command Line Tool for managing your Virtualmin Server. All these commands and parameters are transferrable to this SDK (Not all commands supported yet).

Each supported section of the API comes with a "Manager" class, this class defines all the available actions for. It then also accepts any parameters needed for that request and then runs it.

Each Manager class should accept the Virtualmin object defined from the Virtualmin class, used in the examples above.

### PlanManager

[](#planmanager)

The plan manager is responsible for handling the Plans Related actions.

```
$PlanManager = new \Snscripts\Virtualmin\Plans\PlanManager($Virtualmin);
$plans = $PlanManager->ListPlans()->run();
$Plan = $plans->first(); // get the first plan returned

```

The ListPlans action will return a Collection of results (or an empty collection if no plans created). Each item in the Collection should be an instance of \\Snscripts\\Virtualmin\\Plans\\Plan containing the required details for that plan.

### HostingManager

[](#hostingmanager)

The Hosting Manager is responsible for handling the "Virtual Servers" or Shared Hosting accounts.

```
$HostingManager = new \Snscripts\Virtualmin\Hosting\HostingManager($Virtualmin);

$createResult = $HostingManager->CreateService()
	->setDomain('example.com')
	->setPlan($Plan->id)
	->setPass('password')
	->setLimitsFromPlan() // this makes it use the disk quota and broadband limits from the set plan otherwise define your own
	->setFeaturesFromPlan() // this makes it use the defined features on your plan otherwise define your own.
	->run();

```

`$createResult` will contain an instance of `\Snscripts\Virtualmin\Results\Result`. With that object you can do `$createResult->getStatus()` to retrieve a boolean true / false representation of whether the call was successful or not and `$createResult->getMessage()` to retrieve a verbose reason for the call failing or a success message.

```
$deleteResult = $HostingManager->DeleteService()
	->setDomain('example.com')
	->run();

$disableResult = $HostingManager->DisableService()
	->setDomain('example.com')
	->run();

$enableResult = $HostingManager->EnableService()
	->setDomain('example.com')
	->run();

```

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

[](#contributing)

Please see [CONTRIBUTING](https://github.com/mikebarlow/virtualmin-sdk/blob/master/CONTRIBUTING.md) for details.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/mikebarlow/virtualmin-sdk/blob/master/LICENSE) for more information.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 70.8% 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 ~1 days

Total

8

Last Release

3631d ago

### Community

Maintainers

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

---

Top Contributors

[![mikebarlow](https://avatars.githubusercontent.com/u/293049?v=4)](https://github.com/mikebarlow "mikebarlow (34 commits)")[![snsmurf](https://avatars.githubusercontent.com/u/43972359?v=4)](https://github.com/snsmurf "snsmurf (14 commits)")

---

Tags

sdkvirtualmin

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/snscripts-virtualmin-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/snscripts-virtualmin-sdk/health.svg)](https://phpackages.com/packages/snscripts-virtualmin-sdk)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k532.1M2.5k](/packages/aws-aws-sdk-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

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