AMAR BEKA.

[ OPEN SOURCE ]

HETZNER SDK
FOR LARAVEL

A Laravel SDK for Hetzner Cloud that covers the whole API, types every response, and fakes cleanly in tests.

PACKAGE
boci/hetzner-laravel
REQUIRES
PHP 8.2+ · Laravel 12+
LICENCE
MIT
PRESS
Covered by Laravel News

WHY IT EXISTS

Hetzner is where a great deal of European infrastructure quietly lives, and its API is good. What was missing was a Laravel-shaped way into it: a service provider, a facade, real types on the way back, and a way to test against it without touching a live account.

It covers every resource the API exposes rather than a convenient subset — actions, billing, certificates, DNS zones, firewalls, floating IPs, images, ISOs, load balancers, locations, networks, placement groups, primary IPs, servers, SSH keys and volumes. A partial SDK is worse than none: the moment you reach the resource it skipped, you are back to raw requests, and now there are two ways of talking to the same API in one codebase.

[ OPEN SOURCE ]

Hetzner SDK for Laravel

An elegant, type-safe SDK for managing Hetzner Cloud: servers, DNS, networks, load balancers and every other resource the API exposes.

composer require boci/hetzner-laravel
use Boci\HetznerLaravel\Client;

$client = Client::factory()
    ->withApiKey('your-api-token')
    ->make();

$response = $client->servers()->create([
    'name' => 'my-server',
    'server_type' => 'cpx11',
    'image' => 'ubuntu-24.04',
    'location' => 'nbg1',
]);
VIEW ON GITHUB

WHAT IS IN IT

Type safety

Full PHP 8.2+ types on requests and responses, so an IDE can tell you what came back.

Testing-ready

A ClientFake for mocking, so a test that provisions a server does not provision a server.

Request metadata

Rate limits and request details come back alongside the data rather than being thrown away.

Resource-based

The API is organised by resource, so the code reads the way the documentation does.

Laravel-native

Service provider and facade, registered on install. Nothing to wire up.

Documented

A separate docs repository with tutorials, samples and API reference.

Using it, or want something like it?

Issues and pull requests are welcome, and so is a conversation about building one for another platform.

GET IN TOUCH