Docker API
Docker networks and volumes, containerised databases, resource limits and image lookup through the OSS Panel API.
These endpoints are the API behind Docker in the panel's sidebar and the image picker on the Create application screen: Docker networks and volumes, databases that run in their own container, the limits containers may use, and a lookup for images in a registry.
They exist only on a server that runs containers. On any other server every
endpoint here answers 409 ("not a Docker server"; the text follows
Accept-Language).
The Docker application itself (create, container settings, compose file) is on Applications API. Stored registry logins are on Git accounts and registries API.
All paths are relative to https://<your-panel-host>/api. Read
Authentication first. The examples use:
PANEL=https://panel.example.com
TOKEN='1|xcMq8K3vZ2pL…'Permissions
| Key | Title in Roles | Used for |
|---|---|---|
docker | Docker | Networks, volumes, limits and containerised databases. |
application | Applications | Image lookup (the image picker belongs to creating an application). |
registry | Docker Registries | Needed in addition, to look up an image with a stored login (registry_id). |
Reading needs view; every endpoint marked manage needs manage, which implies view.
Endpoint index
| Method | Path | Permission | Limit per minute | Purpose |
|---|---|---|---|---|
GET | /docker/networks | docker | 60 | List networks. |
POST | /docker/networks | docker manage | 20 | Create a network. |
DELETE | /docker/networks/{name} | docker manage | 20 | Remove a network. |
GET | /docker/volumes | docker | 60 | List volumes. |
POST | /docker/volumes | docker manage | 20 | Create a volume. |
DELETE | /docker/volumes/{name} | docker manage | 20 | Remove a volume. |
GET | /docker/limits | docker | 60 | CPU count and default memory limits. |
GET | /docker/databases | docker | 60 | List containerised databases and engines. |
POST | /docker/databases | docker manage | 10 | Create one. |
DELETE | /docker/databases/{dockerDatabase} | docker manage | 20 | Delete one. |
GET | /docker/databases/{dockerDatabase}/credentials | docker manage | 6 | Read its passwords. |
GET | /docker/images/search | application | 60 | Search Docker Hub. |
GET | /docker/images/tags | application | 20 | List an image's tags. |
GET | /docker/images/inspect | application | 20 | Read what an image declares. |
The limits sit on top of the shared budget (see Rate limits) and count that endpoint only, per user.
Networks and volumes
GET /docker/networks and GET /docker/volumes
Return {"networks": [ … ]} and {"volumes": [ … ]}. A network lists the
containers and sites attached to it and whether it is built in; a volume
shows whether it is in_use, by which containers and which sites.
curl "$PANEL/api/docker/networks" \
-H "Authorization: Bearer $TOKEN" -H 'Accept: application/json'POST /docker/networks and POST /docker/volumes
Body {"name": "shop-net"}. The name starts with a letter or digit and
continues with letters, digits, _, . or -, up to 128 characters in all.
Answers 201 with the updated list ({"networks": [ … ]} or
{"volumes": [ … ]}). 422 when the name is invalid or already exists; for a
network, also when the name is one the panel reserves for itself. 500 with a
reference when Docker could not create it.
DELETE /docker/networks/{name} and DELETE /docker/volumes/{name}
Return the updated list. A name that does not exist is 404. These are
refused:
| Status | Why |
|---|---|
422 | The network is built in (Docker's own). |
409 | A container or a site still uses it (the message names them). |
500 | Docker failed to remove it; the body carries a reference. |
Limits
GET /docker/limits
Returns {"limits": {"cpus", "default_memory_limit", "default_db_memory_limit"}}:
how many CPUs the server has, and the memory limits new containers get
(512m unless the administrator changed them). Use it to build a form that
validates cpu_limit and memory_limit the way the panel does.
Containerised databases
A database that runs in its own container, apart from the server's MySQL, MariaDB or PostgreSQL.
GET /docker/databases
Returns {"databases": [ … ], "engines": [ … ]}: the databases that exist
and the engines you can start (postgres, mysql, mariadb, mongodb,
redis, valkey), each with its available versions.
POST /docker/databases
Starts a database container. Answers 201 with {"database": { … }}.
| Field | Rules |
|---|---|
name | Required, up to 63 characters, unique, a valid Docker name. |
engine | Required, one of the engine names from the list. |
version | Required, up to 32 characters: one of the engine's versions. |
docker_network | Optional, an existing network. |
cpu_limit | Optional, up to 16 characters, not above the server's CPUs. |
memory_limit | Optional, up to 20 characters, a Docker memory value. |
A container that did not start answers 422 with message, step and
reference.
GET /docker/databases/{dockerDatabase}/credentials
Returns {"credentials": {"password", "root_password"}}. Limited to 6 calls
per minute, because it returns passwords.
DELETE /docker/databases/{dockerDatabase}
Returns {"message": "…"}; 422 with step and reference when removal
failed.
Image lookup
These three help a client fill in the Docker image field. They need view on Applications, not on Docker.
GET /docker/images/search
| Query | Rules |
|---|---|
q | Required, 2 to 100 characters. |
limit | Optional, 1 to 50. Default 10. |
GET /docker/images/tags
| Query | Rules |
|---|---|
image | Required, up to 255 characters: nginx, ghcr.io/owner/app, … |
registry_id | Optional: a stored registry login to use. Needs view on Docker Registries. |
limit | Optional, 1 to 100. Default 20. |
limit | Optional, 1 to 100. Default 20. |
GET /docker/images/inspect
The same image and registry_id as above. Returns what the image declares
(for example its exposed port and volumes) so the create form can fill them
in.
Both lookups answer 503 with a reason when the registry is unreachable or
is rate limiting you, and 422 for an address the panel refuses to contact.
Common errors
| Status | Message or cause |
|---|---|
403 | Your role does not include management for Docker. |
404 | Unknown network, volume or database. |
409 | Not a Docker server; or the network or volume is in use. |
422 | Validation ({"message", "errors": {"field": ["…"]}}) or a refusal such as a built-in network. |
429 | Over a limit; wait for Retry-After. |
500 | {"message", "reference"}: find the reference in the error log. |
503 | The registry could not be reached or rate limited the panel. |
Related
Git accounts and registries API
Connect Git provider accounts and Docker registry logins, list repositories and branches, and test credentials through the OSS Panel API.
System users and SSH keys API
Create and manage the Linux accounts that own sites, their passwords, shells, sudo and SSH access, and add or remove SSH keys on one or many accounts through the OSS Panel API.