The Hetzner package for Laravel is an elegant, type-safe SDK for managing your Hetzner Cloud servers, DNS, networks, load balancers, and more. All API endpoints are implemented in this package, giving you full access to the Hetzner API:
use Boci\HetznerLaravel\HetznerClient; $client = HetznerClient::factory() ->withApiKey('your-api-token') ->make(); // Create a server$response = $client->servers()->create([ 'name' => 'my-server', 'server_type' => 'cpx11', 'image' => 'ubuntu-24.04', 'location' => 'nbg1',]); $server = $response->server();$action = $response->action();$rootPassword = $response->rootPassword(); echo "Server ID: " . $server->id();echo "Server Name: " . $server->name();echo "Status: " . $server->status();echo "Root Password: " . $rootPassword;
This package also includes a convenient Facade you can use to access the API:
use Boci\HetznerLaravel\Facades\HetznerLaravel as Hetzner; Hetzner::servers()->list();Hetzner::servers()->retrieve('12345');Hetzner::servers()->delete('12345');
Main Features
- Modern Architecture: Clean, organized, and maintainable code structure
- Testing Ready: Includes ClientFake for easy testing and mocking
- Meta Information: Access rate limits and request details
- Type Safe: Full type safety with PHP 8.2+
- Resource Based: Clean, organized API resources
- Laravel Integration: Seamless Laravel service provider and facade
- Complete API Coverage: All Hetzner Cloud API endpoints implemented
🧑💻 You can get started with this package in Laravel v12+ on GitHub: amar8eka/hetzner-laravel