Download the PHP package sq-dev/coolify-sdk without Composer
On this page you can find all versions of the php package sq-dev/coolify-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package coolify-sdk
Coolify SDK for PHP
A fully-typed PHP SDK for the Coolify API, built on Saloon v4. Provides a clean, fluent interface to manage applications, databases, services, servers, deployments, and more — with first-class Laravel integration.
Requirements
- PHP 8.1 or higher
- Saloon ^4.0
- illuminate/support ^10.0 | ^11.0 | ^12.0 | ^13.0
Installation
Configuration
Laravel
The package uses Laravel auto-discovery — the service provider and facade are registered automatically.
Add the following environment variables to your .env file:
COOLIFY_BASE_URL defaults to the Coolify Cloud API. Point it at your self-hosted instance if needed.
To publish the config file:
This creates config/coolify.php:
Standalone (without Laravel)
Instantiate the connector directly:
Quick Start
Using the Facade (Laravel)
Using Dependency Injection (Laravel)
Standalone Usage
API Resources Reference
All resources are accessed through the CoolifyConnector instance (or the Coolify facade in Laravel). Each method returns a CoolifyResponse object that extends Saloon's Response.
General
Methods available directly on the connector:
| Method | Description |
|---|---|
version() |
Get Coolify version |
healthcheck() |
Health check |
enable() |
Enable API |
disable() |
Disable API |
Applications
$coolify->applications()
| Method | Description |
|---|---|
list(?string $tag) |
List all applications, optionally filtered by tag |
get(string $uuid) |
Get application by UUID |
createPublic(...) |
Create from a public Git repository |
createPrivateGithubApp(...) |
Create from a private GitHub App repository |
createPrivateDeployKey(...) |
Create from a repository using a deploy key |
createDockerfile(...) |
Create from a raw Dockerfile |
createDockerImage(...) |
Create from a Docker registry image |
createDockerCompose(...) |
Create from a raw Docker Compose file |
update(string $uuid, array $data) |
Update an application |
delete(string $uuid, ...) |
Delete an application (with optional cleanup flags) |
start(string $uuid, ?bool $force, ?bool $instantDeploy) |
Start / deploy an application |
stop(string $uuid) |
Stop an application |
restart(string $uuid) |
Restart an application |
getLogs(string $uuid, ?int $lines) |
Get application logs |
listEnvs(string $uuid) |
List environment variables |
createEnv(string $uuid, ...) |
Create an environment variable |
updateEnv(string $uuid, ...) |
Update an environment variable |
bulkUpdateEnvs(string $uuid, array $data) |
Bulk update environment variables |
deleteEnv(string $uuid, string $envUuid) |
Delete an environment variable |
Creating a public application:
Managing environment variables:
Databases
$coolify->databases()
| Method | Description |
|---|---|
list() |
List all databases |
get(string $uuid) |
Get database by UUID |
update(string $uuid, array $data) |
Update a database |
delete(string $uuid, ...) |
Delete a database (with optional cleanup flags) |
start(string $uuid) |
Start a database |
stop(string $uuid) |
Stop a database |
restart(string $uuid) |
Restart a database |
createPostgresql(...) |
Create a PostgreSQL database |
createMysql(...) |
Create a MySQL database |
createMariadb(...) |
Create a MariaDB database |
createMongodb(...) |
Create a MongoDB database |
createRedis(...) |
Create a Redis database |
createKeydb(...) |
Create a KeyDB database |
createDragonfly(...) |
Create a Dragonfly database |
createClickhouse(...) |
Create a ClickHouse database |
getBackups(string $uuid) |
Get database backups |
createBackup(string $uuid, string $frequency, ...) |
Create a backup schedule |
updateBackup(string $uuid, string $scheduledBackupUuid, array $data) |
Update a backup schedule |
deleteBackup(string $uuid, string $scheduledBackupUuid, ...) |
Delete a backup schedule |
listBackupExecutions(string $uuid, string $scheduledBackupUuid) |
List backup executions |
deleteBackupExecution(string $uuid, string $scheduledBackupUuid, string $executionUuid) |
Delete a backup execution |
Creating a PostgreSQL database:
Setting up automated backups:
Services
$coolify->services()
| Method | Description |
|---|---|
list() |
List all services |
get(string $uuid) |
Get service by UUID |
create(string $serverUuid, string $projectUuid, ...) |
Create a new service |
update(string $uuid, ...) |
Update a service |
delete(string $uuid, ...) |
Delete a service (with optional cleanup flags) |
start(string $uuid) |
Start a service |
stop(string $uuid) |
Stop a service |
restart(string $uuid, ?bool $latest) |
Restart a service |
listEnvs(string $uuid) |
List environment variables |
createEnv(string $uuid, ...) |
Create an environment variable |
updateEnv(string $uuid, ...) |
Update an environment variable |
bulkUpdateEnvs(string $uuid, array $data) |
Bulk update environment variables |
deleteEnv(string $uuid, string $envUuid) |
Delete an environment variable |
Servers
$coolify->servers()
| Method | Description |
|---|---|
list() |
List all servers |
get(string $uuid) |
Get server by UUID |
create(...) |
Create a new server |
update(string $uuid, ...) |
Update a server |
delete(string $uuid) |
Delete a server |
getResources(string $uuid) |
Get server resources (apps, databases, services) |
getDomains(string $uuid) |
Get all domains on a server |
validate(string $uuid) |
Validate server connectivity |
Projects
$coolify->projects()
| Method | Description |
|---|---|
list() |
List all projects |
get(string $uuid) |
Get project by UUID |
create(?string $name, ?string $description) |
Create a new project |
update(string $uuid, ?string $name, ?string $description) |
Update a project |
delete(string $uuid) |
Delete a project |
listEnvironments(string $uuid) |
List environments for a project |
getEnvironment(string $uuid, string $environmentNameOrUuid) |
Get a specific environment |
createEnvironment(string $uuid, string $name) |
Create an environment |
deleteEnvironment(string $uuid, string $environmentNameOrUuid) |
Delete an environment |
Deployments
$coolify->deployments()
| Method | Description |
|---|---|
list() |
List all deployments |
get(string $uuid) |
Get deployment by UUID |
deploy(?string $tag, ?string $uuid, ?bool $force, ?int $pr) |
Trigger a deployment |
cancel(string $uuid) |
Cancel a running deployment |
listByApplication(string $uuid, ?int $skip, ?int $take) |
List deployments for a specific application |
Teams
$coolify->teams()
| Method | Description |
|---|---|
list() |
List all teams |
get(int $id) |
Get team by ID |
getMembers(int $id) |
Get team members |
current() |
Get the current team |
currentMembers() |
Get current team members |
Private Keys
$coolify->privateKeys()
| Method | Description |
|---|---|
list() |
List all private keys |
get(string $uuid) |
Get private key by UUID |
create(string $privateKey, ?string $name, ?string $description) |
Create a private key |
update(string $privateKey, ?string $name, ?string $description) |
Update a private key |
delete(string $uuid) |
Delete a private key |
Cloud Tokens
$coolify->cloudTokens()
| Method | Description |
|---|---|
list() |
List all cloud tokens |
get(string $uuid) |
Get cloud token by UUID |
create(string $provider, string $token, string $name) |
Create a cloud token |
update(string $uuid, ?string $name) |
Update a cloud token |
delete(string $uuid) |
Delete a cloud token |
validate(string $uuid) |
Validate a cloud token |
GitHub Apps
$coolify->gitHubApps()
| Method | Description |
|---|---|
list() |
List all GitHub Apps |
create(...) |
Register a new GitHub App |
update(int $githubAppId, ...) |
Update a GitHub App |
delete(int $githubAppId) |
Delete a GitHub App |
loadRepositories(int $githubAppId) |
Load repositories from a GitHub App |
loadBranches(int $githubAppId, string $owner, string $repo) |
Load branches for a repository |
Hetzner
$coolify->hetzner()
| Method | Description |
|---|---|
locations(?string $cloudProviderTokenUuid) |
Get available Hetzner locations |
serverTypes(?string $cloudProviderTokenUuid) |
Get available server types |
images(?string $cloudProviderTokenUuid) |
Get available images |
sshKeys(?string $cloudProviderTokenUuid) |
Get SSH keys |
createServer(...) |
Create a Hetzner server |
Resources
$coolify->resources()
| Method | Description |
|---|---|
list() |
List all resources (applications, databases, services) |
Data Transfer Objects
The SDK provides readonly DTO classes in the Coolify\Data namespace for typed access to API responses. Each class has a static fromArray() factory method that maps snake_case API keys to camelCase properties.
| Class | Description |
|---|---|
ApplicationData |
Application details (git config, build pack, health checks, limits, etc.) |
ApplicationDeploymentQueueData |
Deployment queue entry with status, logs, commit info |
EnvironmentData |
Project environment (id, name, project association) |
EnvironmentVariableData |
Environment variable with preview/literal/multiline flags |
PrivateKeyData |
SSH private key metadata |
ProjectData |
Project with UUID, name, description |
ServerData |
Server with IP, proxy config, nested ServerSettingData |
ServerSettingData |
Server settings (build concurrency, sentinel, log drains, etc.) |
ServiceData |
Service with Docker Compose config and metadata |
TeamData |
Team with nested UserData members array |
UserData |
User profile (name, email, 2FA status) |
Usage example:
Server with nested settings:
Error Handling
The SDK uses the AlwaysThrowOnErrors Saloon trait, which means any non-2xx API response automatically throws a Coolify\Exceptions\CoolifyException.
Handling validation errors (422):
Status code mapping:
| Status | Message |
|---|---|
| 400 | Invalid token. |
| 401 | Unauthenticated. |
| 404 | Resource not found. |
| 422 | Validation error. |
| 429 | Rate limit exceeded. Please try again later. |
Architecture
The SDK follows a layered architecture built on top of Saloon v4:
CoolifyConnector— the entry point. Configures base URL, Bearer token authentication, JSON headers, and theAlwaysThrowOnErrorstrait. Returns resource instances.- *`Resource
** — resource classes (extendSaloon\Http\BaseResource`) that group related API operations and provide a fluent, typed interface. - *`Request`** — individual Saloon request classes (one per API endpoint) that define the HTTP method, endpoint path, query parameters, and JSON body.
CoolifyResponse— extends Saloon'sResponseto throwCoolifyExceptionon failure.CoolifyException— extends Saloon'sRequestExceptionwith human-readable status messages and structured validation error access.Coolify\Data\*— readonly DTO classes for typed response deserialization.
License
This package is open-sourced software licensed under the MIT license.