https://github.com/ente/portainer-php-api
PHP API client to interact with the Portainer API
https://github.com/ente/portainer-php-api
Last synced: 5 months ago
JSON representation
PHP API client to interact with the Portainer API
- Host: GitHub
- URL: https://github.com/ente/portainer-php-api
- Owner: Ente
- Created: 2024-11-20T18:39:52.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-02-16T18:07:37.000Z (10 months ago)
- Last Synced: 2025-07-20T16:27:47.562Z (5 months ago)
- Language: PHP
- Homepage:
- Size: 13.7 KB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Portainer PHP API
Portainer PHP API client
For the full API documentation implemented, please take a look at [https://app.swaggerhub.com/apis/portainer/portainer-ce/2.21.4#/](https://app.swaggerhub.com/apis/portainer/portainer-ce/2.21.4#/)
## Supported endpoint groups
- Auth
- Backup
- CustomTemplates
- Docker
- Endpoints
- LDAP
- Motd
- Gitops
- Registries
## Installation
Download the package using composer:
```bash
composer require ente/portainer-php-api
```
Then configure .env file with the following variables:
- API_URL (e.g. `localhost:9443`)
- USERNAME
- PASSWORD
- IGNORE_SSL (currently all requests are made with `verify` set to `false`)
## Usage
```php
require_once __DIR__ . "/vendor/autoload.php";
use Portainer\Portainer;
$portainer = new Portainer(__DIR__, ".env", "username", "password", "https://yourhost:9443");
echo var_dump($portainer->customTemplates()->list()); // array containing custom templates
```