YAML-driven CLI for managing Dokploy projects through the Dokploy API.
Use it locally or in CI to inspect projects, create/update applications, attach domains, deploy compose stacks, provision databases, and trigger redeploys without relying on the Terraform provider.
- Inspect all Dokploy projects with
project.all. - Apply a declarative YAML config.
- Manage projects, environments, applications, compose stacks, databases, domains, backups, and volume backups.
- Trigger app or compose redeploys.
- Keep a small local
dokploy-state.jsonfile for resource IDs. - Use colored terminal output with a raw JSON option for scripts.
- Accept either a Dokploy root URL or
/apiURL.
- Node.js 18 or newer
- A running Dokploy instance
- A Dokploy API key
The API key is read only from DOKPLOY_API_KEY. Do not put it in YAML config.
Global install:
npm install -g @lishugupta652/dokploy
dokploy --helpOne-off use with npm:
npx @lishugupta652/dokploy --help
npx @lishugupta652/dokploy projects --host https://your-dokploy.example.comLocal project install:
npm install @lishugupta652/dokploy
npx dokploy --help
npm exec dokploy -- --helpexport DOKPLOY_API_KEY=your-api-key
export DOKPLOY_HOST=https://your-dokploy.example.comDOKPLOY_HOST is optional when host is set in dokploy.yaml.
Both forms work:
https://your-dokploy.example.com
https://your-dokploy.example.com/apiThe CLI normalizes root hosts to /api.
- Check your API connection:
dokploy projects --host https://your-dokploy.example.com --summary- Create a starter config:
dokploy init-
Edit
dokploy.yaml. -
Preview the changes:
dokploy apply -f dokploy.yaml --dry-run- Apply the config:
dokploy apply -f dokploy.yaml- Check status:
dokploy status -f dokploy.yamldokploy projects --host https://your-dokploy.example.com
dokploy projects --summary --host https://your-dokploy.example.com
dokploy projects --json --host https://your-dokploy.example.com
dokploy init
dokploy init --output dokploy.yaml --force
dokploy apply -f dokploy.yaml
dokploy apply -f dokploy.yaml --dry-run
dokploy apply -f dokploy.yaml --state .dokploy-state.json
dokploy deploy frontend -f dokploy.yaml
dokploy status -f dokploy.yaml
dokploy destroy frontend -f dokploy.yaml
dokploy destroy -f dokploy.yaml
dokploy destroy -f dokploy.yaml --delete-volumeshost: https://your-dokploy.example.com
project:
name: My App
description: Deployed via dokploy
environment:
name: production
applications:
- name: frontend
source: github
github:
id: your-github-provider-id
owner: your-org
repository: your-repo
branch: main
buildPath: /
triggerType: push
build:
type: dockerfile
dockerfile: Dockerfile
contextPath: .
env:
NODE_ENV: production
VITE_BACKEND_URL: https://api.example.com
domains:
- host: app.example.com
port: 80
path: /
https: true
certificate: letsencrypt
deploy: true
databases:
- name: app-db
type: postgres
version: "16"
databaseName: app
databaseUser: app
password: change-me
deploy: trueMore examples are in examples/.
hostcan be the Dokploy root URL or/apiURL.environmentis optional. If omitted, the CLI uses the first environment returned by Dokploy for the project.applications[].deploy: truetriggers a deploy after configuration.buildArgs,buildSecrets, andcreateEnvFileare supported for applications.- Database creation requires a password because the Dokploy API requires one.
- State is written next to the config as
dokploy-state.jsonunlessstateFileor--stateis provided.
Human-readable output:
dokploy projects --host https://your-dokploy.example.comShort table only:
dokploy projects --summary --host https://your-dokploy.example.comRaw JSON for scripts:
dokploy projects --json --host https://your-dokploy.example.comzsh: command not found: dokploy
You probably installed the package locally. Use:
npx dokploy --helpor install globally:
npm install -g @lishugupta652/dokployDokploy API /project.all failed with HTTP 404 and the response is HTML
The request hit the Dokploy web UI instead of the API. Use a recent package version and pass either:
dokploy projects --host https://your-dokploy.example.com
dokploy projects --host https://your-dokploy.example.com/apiDOKPLOY_API_KEY is required
Set the API key before running commands:
export DOKPLOY_API_KEY=your-api-keynpm install
npm run check
npm run build
npm run dev -- projects --host https://your-dokploy.example.com --summaryUsing pnpm is fine if you switch the lockfile:
rm package-lock.json
pnpm install
pnpm run check
pnpm run buildThe package name is @lishugupta652/dokploy; the binary is dokploy.
Safe dry-run:
./scripts/publish.sh npmPublish:
./scripts/publish.sh npm --publishIf the current package version is already on npm, the publish script bumps patch automatically before publishing. Override the bump when needed:
./scripts/publish.sh npm --publish --bump patch
./scripts/publish.sh npm --publish --bump minor
./scripts/publish.sh npm --publish --bump major
./scripts/publish.sh npm --publish --bump nonePublish to GitHub Packages:
npm login --scope=@lishugupta652 --auth-type=legacy --registry=https://npm.pkg.github.com
./scripts/publish.sh npm --registry github --publishShortcut scripts:
npm run publish:npm
npm run publish:githubpnpm flow:
./scripts/publish.sh pnpm
./scripts/publish.sh pnpm --publishPublishing generates CHANGELOG.md from git commits since the latest tag. Conventional Commit messages are grouped into sections such as Features, Fixes, Breaking Changes, and Chores.
Direct npm publish --access public is also protected by prepublishOnly: it checks whether the current version already exists in the selected registry and bumps patch when needed before building and generating the changelog.
This package can also be published to GitHub Packages.
GitHub Packages requires a personal access token (classic) for local publishing. The token needs write:packages to publish and read:packages to install. Use GITHUB_TOKEN in GitHub Actions when publishing from the repository workflow.
Login locally:
npm login --scope=@lishugupta652 --auth-type=legacy --registry=https://npm.pkg.github.comUse your GitHub username as the username and the token as the password.
Publish:
./scripts/publish.sh npm --registry github --publishGitHub Packages publishes new packages as private by default. Change visibility or access from GitHub after the first publish when you want the package to be public.
Install from GitHub Packages by adding this to an .npmrc file:
@lishugupta652:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}Then install:
NODE_AUTH_TOKEN=your-github-token npm install @lishugupta652/dokploySee .npmrc.github.example for the registry mapping template.
Install hooks:
npm run hooks:installThe commit-msg hook enforces Conventional Commits and bumps package.json plus package-lock.json from the commit message:
feat: add project listing # minor
fix(projects): normalize host # patch
perf: improve status lookup # patch
feat!: change config schema # major
docs: update usage # no version bump
Use SKIP_DOKPLOY_VERSION_BUMP=1 to keep commit validation but skip version changes. Use SKIP_DOKPLOY_COMMIT_CHECK=1 only when you intentionally need to bypass the hook.