Dokploy API
Manage a Dokploy instance through its privileged HTTP API. Run it like an
operator: discover the live instance, verify the target, make the smallest
necessary request, then prove the resulting state.
Operator Loop
- Establish the target instance and credentials.
Completion:
DOKPLOY_URL points at the intended instance, the token is
available only from env/secret storage, and no secret is printed.
- Verify the live API shape before non-trivial writes.
Completion: the local instance Swagger at
$DOKPLOY_URL/swagger or the
current docs page for the endpoint family has been checked for method,
required fields, enum values, and response shape.
- Discover IDs from the instance instead of trusting names.
Completion: project, environment, application, compose, database, server, or
integration IDs come from a read endpoint such as
project.all, *.one, or
the relevant *.all endpoint; names are used only after uniqueness is clear.
- Classify the operation.
Completion: destructive, interrupting, credential-bearing, infrastructure,
or production operations have explicit user confirmation; read-only and
low-risk idempotent updates may proceed with stated assumptions.
- Execute with a minimal, auditable request.
Completion: the request uses
/api/<resource>.<action>, sends
x-api-key, uses JSON bodies for writes, and avoids logging secrets.
- Verify after every mutation.
Completion: a follow-up read, deployment list, health/status check, logs, or
CI result confirms the new state or captures the failure details.
Defaults
Use these shell variables in examples and scripts:
export DOKPLOY_URL="https://dokploy.example.com"
export DOKPLOY_API_KEY="your-generated-token"
Normalize DOKPLOY_URL without a trailing slash. The API base is
$DOKPLOY_URL/api; the default OpenAPI base in the docs is
http://localhost:3000/api. Tokens are generated from
/settings/profile in the API/CLI section and are sent as x-api-key.
Use this request shape:
curl -fsS "$DOKPLOY_URL/api/project.all" \
-H "accept: application/json" \
-H "x-api-key: $DOKPLOY_API_KEY"
For writes:
curl -fsS -X POST "$DOKPLOY_URL/api/application.deploy" \
-H "accept: application/json" \
-H "content-type: application/json" \
-H "x-api-key: $DOKPLOY_API_KEY" \
-d '{"applicationId":"APPLICATION_ID"}'
Workflows
Inventory
Start most tasks with GET /api/project.all; it returns projects and nested
applications, Compose services, and databases. Use project.one when the
project is known, project.allForPermissions for permission-limited views, and
resource-specific *.one endpoints before changing a single service.
Applications
Create with application.create, inspect with application.one, configure
provider/build/env/domain/ports/mounts through application.save* endpoints,
then start, stop, deploy, redeploy, or reload through the matching action
endpoint. Treat application.deploy, application.redeploy,
application.stop, application.delete, queue cleanup, and env/build-secret
updates as confirmation-gated operations.
For CI/CD, store DOKPLOY_URL, DOKPLOY_API_KEY, and the target resource ID as
CI secrets. Build and push images in CI when production should not build on the
Dokploy host, then trigger Dokploy with application.deploy or
compose.deploy.
Compose
Create with compose.create; pass composeType as docker-compose or stack
and composeFile as a YAML string, not a file upload. Use compose.one before
updates and compose.deploy, compose.redeploy, compose.stop, or
compose.delete for lifecycle actions. Avoid container_name; it can break
Dokploy-managed logs, metrics, and service naming. For Docker Stack, put Traefik
labels under deploy.labels, use prebuilt images, and pass registry auth when
needed.
Databases
Use the resource family for the engine: postgres.*, mysql.*, mariadb.*,
mongo.*, or redis.*. Confirm generated usernames, passwords, external ports,
mounts, and backup settings before exposing or rotating anything. Never print
database passwords returned by inventory calls unless the user explicitly asks
for secret recovery.
Domains, Ports, Mounts, Redirects
Prefer Dokploy domain and port endpoints over hand-edited Traefik labels unless
the service requires custom routing. Verify appName, target resource ID, and
service type before creating domains, ports, redirects, or mounts.
Servers and Cluster
Server creation requires connection details such as ipAddress, port,
username, sshKeyId, and serverType (deploy or build). Treat server,
SSH key, cluster, swarm, registry, security, and Traefik settings changes as
infrastructure operations requiring confirmation and post-change connectivity
checks.
Backups, Rollbacks, Schedules
Backups and volume backups may contain sensitive data; rollbacks and restores
can overwrite running state. Confirm target ID, timestamp/version, and expected
downtime before running backup, restore, rollback, or schedule mutations.
Safety Gates
Ask for confirmation before:
- production deploys, redeploys, rollbacks, restores, or stops
- deletes, queue cleanup, maintenance cleanup, or bulk changes
- database credential, env var, build secret, registry, SSH key, server, swarm,
security, or Traefik changes
- any operation where the target is matched by a non-unique name
Never commit, echo, or include in final answers: API keys, database passwords,
SSH keys, registry credentials, build secrets, env files, or full API responses
that contain secrets. Redact as <redacted> while preserving IDs and names
needed for verification.
Errors
Dokploy errors commonly return code, message, and issues.
UNAUTHORIZED: missing/invalid x-api-key, wrong instance, or expired token.
FORBIDDEN: role, project permission, or API/CLI access not granted.
NOT_FOUND: stale ID, wrong resource family, or wrong instance.
BAD_REQUEST: schema mismatch; re-check Swagger for required fields and enum
values.
If a write returns {} or minimal data, do not assume success. Read the resource
again, check deployment records, or inspect logs/status.
Reference
Read only the branch reference needed for the task:
- Application create, provider setup, build settings, env, deploy, stop, or app
networking: references/APPLICATIONS.md
- Compose services, Compose YAML, Docker Compose vs Swarm stack, or Compose
deploys: references/COMPOSE.md
- Postgres, MySQL, MariaDB, Mongo, Redis, database credentials, database ports,
or database backups: references/DATABASES.md
- Servers, SSH keys, registries, Docker, Swarm, cluster, security, settings, or
Traefik instance changes: references/INFRASTRUCTURE.md
- Deployment history, previews, rollbacks, backups, restores, schedules, status
checks, logs, or CI/CD triggers: references/OPERATIONS.md
Keep exact field decisions tied to the live Swagger because Dokploy versions can
change schemas.
1---2name: dokploy-api3description: Manage Dokploy instances through the HTTP API and Swagger reference. Use when the user mentions Dokploy, Dokploy API, Dokploy Swagger, x-api-key, project.all, application deploys, Compose services, databases, domains, servers, backups, schedules, registries, or CI/CD automation for Dokploy.4---56# Dokploy API78Manage a Dokploy instance through its privileged HTTP API. Run it like an9operator: discover the live instance, verify the target, make the smallest10necessary request, then prove the resulting state.1112## Operator Loop13141. Establish the target instance and credentials.15 Completion: `DOKPLOY_URL` points at the intended instance, the token is16 available only from env/secret storage, and no secret is printed.172. Verify the live API shape before non-trivial writes.18 Completion: the local instance Swagger at `$DOKPLOY_URL/swagger` or the19 current docs page for the endpoint family has been checked for method,20 required fields, enum values, and response shape.213. Discover IDs from the instance instead of trusting names.22 Completion: project, environment, application, compose, database, server, or23 integration IDs come from a read endpoint such as `project.all`, `*.one`, or24 the relevant `*.all` endpoint; names are used only after uniqueness is clear.254. Classify the operation.26 Completion: destructive, interrupting, credential-bearing, infrastructure,27 or production operations have explicit user confirmation; read-only and28 low-risk idempotent updates may proceed with stated assumptions.295. Execute with a minimal, auditable request.30 Completion: the request uses `/api/<resource>.<action>`, sends31 `x-api-key`, uses JSON bodies for writes, and avoids logging secrets.326. Verify after every mutation.33 Completion: a follow-up read, deployment list, health/status check, logs, or34 CI result confirms the new state or captures the failure details.3536## Defaults3738Use these shell variables in examples and scripts:3940```bash41export DOKPLOY_URL="https://dokploy.example.com"42export DOKPLOY_API_KEY="your-generated-token"43```4445Normalize `DOKPLOY_URL` without a trailing slash. The API base is46`$DOKPLOY_URL/api`; the default OpenAPI base in the docs is47`http://localhost:3000/api`. Tokens are generated from48`/settings/profile` in the API/CLI section and are sent as `x-api-key`.4950Use this request shape:5152```bash53curl -fsS "$DOKPLOY_URL/api/project.all" \54 -H "accept: application/json" \55 -H "x-api-key: $DOKPLOY_API_KEY"56```5758For writes:5960```bash61curl -fsS -X POST "$DOKPLOY_URL/api/application.deploy" \62 -H "accept: application/json" \63 -H "content-type: application/json" \64 -H "x-api-key: $DOKPLOY_API_KEY" \65 -d '{"applicationId":"APPLICATION_ID"}'66```6768## Workflows6970### Inventory7172Start most tasks with `GET /api/project.all`; it returns projects and nested73applications, Compose services, and databases. Use `project.one` when the74project is known, `project.allForPermissions` for permission-limited views, and75resource-specific `*.one` endpoints before changing a single service.7677### Applications7879Create with `application.create`, inspect with `application.one`, configure80provider/build/env/domain/ports/mounts through `application.save*` endpoints,81then start, stop, deploy, redeploy, or reload through the matching action82endpoint. Treat `application.deploy`, `application.redeploy`,83`application.stop`, `application.delete`, queue cleanup, and env/build-secret84updates as confirmation-gated operations.8586For CI/CD, store `DOKPLOY_URL`, `DOKPLOY_API_KEY`, and the target resource ID as87CI secrets. Build and push images in CI when production should not build on the88Dokploy host, then trigger Dokploy with `application.deploy` or89`compose.deploy`.9091### Compose9293Create with `compose.create`; pass `composeType` as `docker-compose` or `stack`94and `composeFile` as a YAML string, not a file upload. Use `compose.one` before95updates and `compose.deploy`, `compose.redeploy`, `compose.stop`, or96`compose.delete` for lifecycle actions. Avoid `container_name`; it can break97Dokploy-managed logs, metrics, and service naming. For Docker Stack, put Traefik98labels under `deploy.labels`, use prebuilt images, and pass registry auth when99needed.100101### Databases102103Use the resource family for the engine: `postgres.*`, `mysql.*`, `mariadb.*`,104`mongo.*`, or `redis.*`. Confirm generated usernames, passwords, external ports,105mounts, and backup settings before exposing or rotating anything. Never print106database passwords returned by inventory calls unless the user explicitly asks107for secret recovery.108109### Domains, Ports, Mounts, Redirects110111Prefer Dokploy domain and port endpoints over hand-edited Traefik labels unless112the service requires custom routing. Verify `appName`, target resource ID, and113service type before creating domains, ports, redirects, or mounts.114115### Servers and Cluster116117Server creation requires connection details such as `ipAddress`, `port`,118`username`, `sshKeyId`, and `serverType` (`deploy` or `build`). Treat server,119SSH key, cluster, swarm, registry, security, and Traefik settings changes as120infrastructure operations requiring confirmation and post-change connectivity121checks.122123### Backups, Rollbacks, Schedules124125Backups and volume backups may contain sensitive data; rollbacks and restores126can overwrite running state. Confirm target ID, timestamp/version, and expected127downtime before running backup, restore, rollback, or schedule mutations.128129## Safety Gates130131Ask for confirmation before:132133- production deploys, redeploys, rollbacks, restores, or stops134- deletes, queue cleanup, maintenance cleanup, or bulk changes135- database credential, env var, build secret, registry, SSH key, server, swarm,136 security, or Traefik changes137- any operation where the target is matched by a non-unique name138139Never commit, echo, or include in final answers: API keys, database passwords,140SSH keys, registry credentials, build secrets, env files, or full API responses141that contain secrets. Redact as `<redacted>` while preserving IDs and names142needed for verification.143144## Errors145146Dokploy errors commonly return `code`, `message`, and `issues`.147148- `UNAUTHORIZED`: missing/invalid `x-api-key`, wrong instance, or expired token.149- `FORBIDDEN`: role, project permission, or API/CLI access not granted.150- `NOT_FOUND`: stale ID, wrong resource family, or wrong instance.151- `BAD_REQUEST`: schema mismatch; re-check Swagger for required fields and enum152 values.153154If a write returns `{}` or minimal data, do not assume success. Read the resource155again, check deployment records, or inspect logs/status.156157## Reference158159Read only the branch reference needed for the task:160161- Application create, provider setup, build settings, env, deploy, stop, or app162 networking: [references/APPLICATIONS.md](references/APPLICATIONS.md)163- Compose services, Compose YAML, Docker Compose vs Swarm stack, or Compose164 deploys: [references/COMPOSE.md](references/COMPOSE.md)165- Postgres, MySQL, MariaDB, Mongo, Redis, database credentials, database ports,166 or database backups: [references/DATABASES.md](references/DATABASES.md)167- Servers, SSH keys, registries, Docker, Swarm, cluster, security, settings, or168 Traefik instance changes: [references/INFRASTRUCTURE.md](references/INFRASTRUCTURE.md)169- Deployment history, previews, rollbacks, backups, restores, schedules, status170 checks, logs, or CI/CD triggers: [references/OPERATIONS.md](references/OPERATIONS.md)171172Keep exact field decisions tied to the live Swagger because Dokploy versions can173change schemas.