PHPackages                             team-nifty-gmbh/plesk-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. [API Development](/categories/api)
4. /
5. team-nifty-gmbh/plesk-sdk

ActiveLibrary[API Development](/categories/api)

team-nifty-gmbh/plesk-sdk
=========================

PHP SDK for Plesk RESTful API

v1.0.2(7mo ago)013[1 PRs](https://github.com/Team-Nifty-GmbH/plesk-sdk/pulls)MITPHPPHP ^8.2CI failing

Since Sep 9Pushed 1mo agoCompare

[ Source](https://github.com/Team-Nifty-GmbH/plesk-sdk)[ Packagist](https://packagist.org/packages/team-nifty-gmbh/plesk-sdk)[ RSS](/packages/team-nifty-gmbh-plesk-sdk/feed)WikiDiscussions main Synced 1mo ago

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

Plesk PHP SDK
=============

[](#plesk-php-sdk)

**A modern PHP SDK for the Plesk RESTful API, built with Saloon**

📋 Description
-------------

[](#-description)

This SDK provides a clean, intuitive interface for interacting with the Plesk API in PHP applications. Built on top of Saloon HTTP client, it offers a robust and developer-friendly way to manage Plesk servers programmatically.

### Key Features

[](#key-features)

- 🚀 **Full Plesk API Coverage** - Complete implementation of Plesk's RESTful API v2
- 🏗️ **Built with Saloon** - Leveraging the powerful Saloon HTTP client for reliable API interactions
- 🔧 **Laravel Integration** - First-class Laravel support with Service Provider, Facade, and helper functions
- 📦 **Standalone Usage** - Can be used in any PHP project, not just Laravel
- 🎯 **Type-Safe** - Full PHP 8.2+ type hints and enums for better IDE support
- 📊 **DTO Support** - Structured data transfer objects using Spatie's Laravel Data package
- ⚡ **Auto-generated** - Generated from OpenAPI specification for accuracy and completeness
- 🔄 **Configurable** - SSL verification, timeouts, and retry logic configuration
- 🧪 **Testable** - Built with testing in mind, easily mockable with Saloon's testing utilities

### Supported Resources

[](#supported-resources)

- **Domains** - Full domain lifecycle management
- **Clients** - Customer and reseller account management
- **Databases** - MySQL/PostgreSQL database and user management
- **DNS** - DNS zone and record management
- **FTP Users** - FTP account management
- **Extensions** - Plesk extension management
- **Server** - Server configuration and information
- **CLI** - Command line operations
- **Auth** - API key and authentication management

### Requirements

[](#requirements)

- PHP 8.2+
- Laravel 11.x or 12.x (optional, for Laravel integration)
- Plesk server with API access enabled

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

[](#installation)

```
composer require team-nifty/plesk-sdk
```

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

[](#configuration)

### Laravel

[](#laravel)

The package will auto-register the service provider. Publish the config file:

```
php artisan vendor:publish --tag=plesk-config
```

Add your Plesk credentials to your `.env` file:

```
PLESK_URL=https://your-plesk-server.com:8443
PLESK_USERNAME=admin
PLESK_PASSWORD=your-password
PLESK_API_KEY=your-api-key
PLESK_VERIFY_SSL=true
PLESK_TIMEOUT=30
PLESK_RETRY_TIMES=3
PLESK_RETRY_SLEEP=100
```

### Usage in Laravel

[](#usage-in-laravel)

Using the Helper Function:

```
// List all domains
$domains = plesk()->domains()->listAllDomains()->send()->json();

// Create a new domain
$domain = plesk()->domains()->createNewDomain(
    name: 'example.com',
    hostingType: \TeamNifty\Plesk\Enums\DomainRequestHostingType::virtual,
    ownerClientId: 1
)->send();

// Get domain details
$domain = plesk()->domains()->domainDetails(id: 123)->send()->dto();
```

Using the Facade:

```
use TeamNifty\Plesk\Facades\Plesk;

// List all domains
$domains = Plesk::domains()->listAllDomains()->send()->json();

// Create a new domain
$domain = Plesk::domains()->createNewDomain(
    name: 'example.com',
    hostingType: \TeamNifty\Plesk\Enums\DomainRequestHostingType::virtual,
    ownerClientId: 1
)->send();

// Get domain details
$domain = Plesk::domains()->domainDetails(id: 123)->send()->dto();
```

Using dependency injection:

```
use TeamNifty\Plesk\Plesk;

class PleskController extends Controller
{
    public function __construct(
        private Plesk $plesk
    ) {}

    public function index()
    {
        $domains = $this->plesk->domains()->listAllDomains()->send()->json();

        return view('domains.index', compact('domains'));
    }
}
```

### Standalone Usage

[](#standalone-usage)

```
use TeamNifty\Plesk\Plesk;

$plesk = new Plesk(
    url: 'https://your-plesk-server.com:8443',
    username: 'admin',
    password: 'your-password',
    apiKey: 'your-api-key'
);

// List all clients
$clients = $plesk->clients()->listAllClients()->send()->json();

// Create a new client
$client = $plesk->clients()->createNewClientAccount(
    login: 'john.doe',
    email: 'john@example.com',
    type: \TeamNifty\Plesk\Enums\ClientType::CUSTOMER
)->send()->dto();
```

Available Resources
-------------------

[](#available-resources)

- **Auth** - Authentication and API key management
- **Cli** - Command line interface operations
- **Clients** - Client account management
- **Databases** - Database and database user management
- **Dns** - DNS record management
- **Domains** - Domain management
- **Extensions** - Extension management
- **FtpUsers** - FTP user management
- **Server** - Server configuration and information

Examples
--------

[](#examples)

### Working with Domains

[](#working-with-domains)

```
use TeamNifty\Plesk\Facades\Plesk;
use TeamNifty\Plesk\Enums\DomainRequestHostingType;

// Create a domain with hosting
$domain = Plesk::domains()->createNewDomain(
    name: 'example.com',
    description: 'My website',
    hostingType: DomainRequestHostingType::virtual,
    hostingSettings: [
        'ftp_login' => 'example_ftp',
        'ftp_password' => 'secure_password123'
    ],
    ownerClientId: 1
)->send()->dto();

// Update domain
$updated = Plesk::domains()->updateDomain(
    id: $domain->id,
    description: 'Updated description'
)->send()->dto();

// Get domain status
$status = Plesk::domains()->getDomainStatus(id: $domain->id)->send()->dto();

// Delete domain
Plesk::domains()->deleteDomain(id: $domain->id)->send();
```

### Working with Databases

[](#working-with-databases)

```
use TeamNifty\Plesk\Facades\Plesk;
use TeamNifty\Plesk\Enums\DatabaseType;

// Create a database
$database = Plesk::databases()->createDatabase(
    name: 'myapp_db',
    type: DatabaseType::mysql,
    parentDomainId: 123,
    serverId: 1
)->send()->dto();

// Create database user
$dbUser = Plesk::databases()->createDatabaseUser(
    login: 'myapp_user',
    password: 'secure_password',
    databaseId: $database->id
)->send()->dto();

// List all databases
$databases = Plesk::databases()->getDatabases()->send()->json();
```

### Working with DNS

[](#working-with-dns)

```
use TeamNifty\Plesk\Facades\Plesk;
use TeamNifty\Plesk\Enums\DnsRecordType;

// Get DNS records for a domain
$records = Plesk::dns()->getDomainOrDomainAliasDnsRecords(
    domainId: 123
)->send()->json();

// Create a DNS record
$record = Plesk::dns()->createDomainOrDomainAliasDnsRecord(
    domainId: 123,
    type: DnsRecordType::A,
    host: 'subdomain',
    value: '192.168.1.100'
)->send()->dto();

// Update DNS record
$updated = Plesk::dns()->updateDnsRecord(
    dnsRecordId: $record->id,
    value: '192.168.1.101'
)->send()->dto();

// Delete DNS record
Plesk::dns()->deleteDnsRecord(dnsRecordId: $record->id)->send();
```

Error Handling
--------------

[](#error-handling)

```
use Saloon\Exceptions\Request\RequestException;

try {
    $domain = Plesk::domains()->domainDetails(id: 999)->send()->dto();
} catch (RequestException $e) {
    $status = $e->getStatus(); // HTTP status code
    $response = $e->getResponse(); // Saloon Response object
    $body = $e->getResponse()->body(); // Response body

    // Handle the error
    Log::error('Plesk API error', [
        'status' => $status,
        'message' => $body
    ]);
}
```

Testing
-------

[](#testing)

For testing, you can mock the Plesk client:

```
use TeamNifty\Plesk\Plesk;
use Saloon\Http\Faking\MockResponse;
use Saloon\Laravel\Facades\Saloon;

// Mock specific requests
Saloon::fake([
    'domains' => MockResponse::make(['id' => 1, 'name' => 'example.com'], 200),
]);

// Your test code
$domain = Plesk::domains()->listAllDomains()->send();

// Assert the request was sent
Saloon::assertSent(function ($request) {
    return $request instanceof \TeamNifty\Plesk\Requests\Domains\ListAllDomains;
});
```

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

[](#contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

Support
-------

[](#support)

For issues, questions, or suggestions, please use the [GitHub Issues](https://github.com/team-nifty/plesk-sdk/issues) page.

License
-------

[](#license)

This package is open-source software licensed under the MIT license.

---

**Tags**: `plesk`, `api`, `sdk`, `php`, `laravel`, `saloon`, `rest-api`, `plesk-api`, `server-management`, `hosting`, `web-hosting`

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance80

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 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 ~17 days

Total

3

Last Release

211d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/315f809551baee16f7c5531f89a864b4d5b59bde8882779c30d4a01ae36e718e?d=identicon)[team-nifty](/maintainers/team-nifty)

---

Top Contributors

[![patrickweh](https://avatars.githubusercontent.com/u/40495041?v=4)](https://github.com/patrickweh "patrickweh (6 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/team-nifty-gmbh-plesk-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/team-nifty-gmbh-plesk-sdk/health.svg)](https://phpackages.com/packages/team-nifty-gmbh-plesk-sdk)
```

###  Alternatives

[andreaselia/laravel-api-to-postman

Generate a Postman collection automatically from your Laravel API

1.0k586.2k3](/packages/andreaselia-laravel-api-to-postman)[mll-lab/laravel-graphiql

Easily integrate GraphiQL into your Laravel project

683.2M9](/packages/mll-lab-laravel-graphiql)[spatie/laravel-route-discovery

Auto register routes using PHP attributes

23645.0k2](/packages/spatie-laravel-route-discovery)[dragon-code/laravel-json-response

Automatically always return a response in JSON format

1118.6k1](/packages/dragon-code-laravel-json-response)[surface/laravel-webfinger

A Laravel package to create an ActivityPub webfinger.

113.8k](/packages/surface-laravel-webfinger)

PHPackages © 2026

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