Skip to content

The command-line client (hddeploy)

hddeploy is a program for the terminal that does everything the REST API can: deploy stacks, change variables, upload websites, read logs. It is made for scripts and CI pipelines (GitHub Actions, GitLab, Azure DevOps) and for anyone who prefers typing over clicking. It works with your ordinary API token and has the same permissions and the same audit trail as the portal.

One file, no installer or runtime. Download the file for your system, make it executable and put it on your path.

System Download
Windows (x64) hddeploy-windows-amd64.exe
Linux (x64) hddeploy-linux-amd64
Linux (arm64) hddeploy-linux-arm64
macOS (Apple silicon) hddeploy-darwin-arm64
macOS (Intel) hddeploy-darwin-amd64
Checksums SHA256SUMS with the signature SHA256SUMS.sig, version in VERSION
Terminal window
# Linux / macOS
curl -fsSL https://help.hddeploy3000.nl/downloads/hddeploy-linux-amd64 -o /usr/local/bin/hddeploy
chmod +x /usr/local/bin/hddeploy
hddeploy version

On Windows the file is signed by HD Services. Rename it to hddeploy.exe and put it in a folder on PATH. On macOS a file from the browser is quarantined; xattr -d com.apple.quarantine hddeploy releases it once.

hddeploy version shows which version you have. When a newer release exists, every command says so in one line on standard error, and hddeploy update installs it: the file for your system is downloaded, checked against the checksums signed with the HD Services release key, and swapped in; the previous copy stays next to it as hddeploy.prev (rename it back to roll back). hddeploy update --check only reports.

The check runs once a day and never delays a command. It is off in CI pipelines (when the variable CI is set), with -q, and with HDDEPLOY_NO_UPDATE_CHECK=1; a pipeline pins a version by downloading it itself, as in the example below.

Create a token on the Integrations page of your portal and sign in once:

Terminal window
hddeploy login yourserver.hddeploy3000.nl

The token is prompted for (typed invisibly), verified and stored as a context named after your server (yourserver). If you manage several servers, sign in for each; hddeploy context list shows them, hddeploy context use NAME switches. The file lives at ~/.config/hddeploy/config.json (Windows: %APPDATA%\hddeploy\config.json) and is readable by you only. hddeploy logout forgets a context; the token itself is revoked on the Integrations page.

In a pipeline nothing is stored. Two variables are enough:

Variable Meaning
HDDEPLOY_SERVER the server, for example yourserver.hddeploy3000.nl
HDDEPLOY_TOKEN the API token (as a pipeline secret)
HDDEPLOY_CONTEXT optional: a stored context instead of the current one
HDDEPLOY_CONFIG optional: a different configuration file
HDDEPLOY_NO_UPDATE_CHECK optional: 1 switches off the daily check for a newer release

The flags --server, --token and --context override the variables, the variables override the file.

Every command is one API call, plus what a script needs around it:

  • --wait on stack deploy, stack stop, stack pull, backup run and stack revision restore --deploy follows the job, prints its output as it grows and ends with exit code 3 when the job fails. Without --wait you get the job id; hddeploy job wait ID follows it later.
  • Writes read the revision first. stack compose set, stack env set and stack settings set fetch the current revision number and send it along, so a concurrent change is noticed. To work strictly from a revision you read earlier, pass --revision N; if the stack changed in the meantime the answer is exit code 4 (read again and retry).
  • Folders are packed locally. site upload NAME ./folder and stack source upload NAME ./folder build a tar.gz themselves (regular files only; symbolic links are skipped; --exclude PATTERN leaves files out, .git is always left out of source trees). An existing .tar.gz or .zip file is sent as it is.
  • -o json prints the API’s answer unchanged, so jq works on the fields of the OpenAPI document. -q prints identifiers only (stack names, job ids, revision numbers).
  • Deleting asks for confirmation. stack delete NAME asks you to type the name, or takes --yes in a script.
  • hddeploy api METHOD PATH calls any endpoint directly, for whatever has no command of its own (yet): hddeploy api GET /stacks/shop/revisions.

hddeploy help lists them, hddeploy stack env set -h shows one command’s flags.

Command Does
login, logout, context list|use|current Signing in and contexts
whoami, overview Who you are and which scopes the token carries; the server summary
template list, template get NAME The templates you may use, with their fields; get also shows the recommended memory (Recommended minimum memory) and key-set fields as (generated: key set supabase)
stack list, stack get NAME Stacks and one stack (state, revision, domains, settings, source, access list)
stack create NAME --template T --set KEY=VALUE... Create a stack from a template (--values file.json, --repo URL for git, --deploy --wait); generated secrets are shown once; a warning (server below the recommended memory) goes to stderr as Warning:
stack delete NAME --yes Delete a stack your organisation created itself
stack deploy|stop|pull NAME [--wait] Deploy, stop, pull images
stack autoupdate NAME on|off Nightly update on or off
stack compose get|set|validate NAME [-f file] Read, replace (new revision) or check the compose file without saving
stack env get|set|replace NAME Read the variables, set them by key (KEY=VALUE...) or replace the whole .env
stack settings list|set NAME The template settings; --regenerate KEY makes a new secret
stack revision list|get|restore NAME [ID] Inspect and restore revisions (--deploy --wait)
stack source get|set|check|pin|unpin|upload NAME The git source or an uploaded source tree (upload NAME ./folder --deploy --wait)
stack source files|cat NAME [PATH] Read the uploaded source tree: files NAME [--prefix DIR/], cat NAME Dockerfile [--out FILE]
stack source write NAME FILE... [--to PATH] Write single files into the uploaded source tree (the rest stays; --delete PATH, --deploy --wait)
stack source versions|restore NAME [ID] List the kept previous versions of the source tree and put one back (--deploy --wait)
stack access get|setup|delete|enable|disable|add|remove NAME [CIDR] The access list in front of the stack’s websites; setup NAME [CIDR] --deploy creates it, delete removes it again
stack webhook create|revoke NAME The deploy webhook (token shown once)
container list|start|stop|restart|logs ID Containers; logs --tail N
job list|get|wait ID Jobs
site list|get|create|check|restore NAME Sites; create makes an upload-only site, restore NAME VERSION puts a previous version back
site upload NAME ./folder [--merge] Replace the content (or add to it with --merge); the previous version is archived
site files NAME, site cat NAME PATH [--out file] Read files
site draft get|write|publish|discard NAME Put single files in a draft (write NAME file... --base ./folder, --to path, --delete path, --publish) and publish it
backup list|files|run NAME [--wait]|add [NAME] --stack S --engine E --service X Backups (add creates a daily backup; stack get S -o json lists services, images and volumes)
alert list [--history], alert channel list|add|remove, alert test Alerts and channels (channel add email address, channel add webhook url, channel add chatbridge STACK)
cert list|request|upload|delete Certificates
registry list|add|remove Registry logins (the secret is prompted for or read from --secret-stdin)
variable list|get|set|remove|history|restore Global variables: set NAME=VALUE, set NAME --hidden (the flag only), set NAME --value-stdin --hidden for a secret, set NAME=VALUE --plain to make a hidden variable visible again with a new value (--plain alone is refused); hidden values are never returned
sso status|enable|disable, sso user list|add|set|password|remove, sso app list|add|remove Single sign-on: enable, users (user add NAME --name ... --groups staff: the generated password comes once), applications (app add NAME --redirect URL: issuer, client id and secret once)
stack sso NAME [--mode off|login|two_factor] [--group g] [--public /path] [--no-deploy] Show or change a stack’s login requirement (deploys right away by default)
user list|add|set|remove Portal users with a Microsoft account (user add EMAIL --name ... [--manage], user set EMAIL --disable, user remove EMAIL); for a token with users.manage
sso entra [--mode tenant|groups|emails] [--group ID]... [--email ADDRESS]... The Microsoft sign-in for applications: show the setting, or set who of the organisation may open the stacks; stack sso NAME --mode entra puts a stack behind it
resources [now] Server resources now: processor, memory, swap, load, pressure, network, disks, what HDDeploy itself uses, the active alerts and the containers using the most
resources history CHART [--range 24h] [--container NAME] [--points N] One chart’s history (cpu, memory, swap, load, pressure, network, disk-io, filesystems, container-cpu, container-memory, container) as a table of time, average and maximum
resources containers [--range 1h] [--sort cpu|memory|net|name] Use per container (average and maximum)
resources rule list|metrics|add|set|remove|reset Alert rules: add --metric memory-available --below 10 --for 10m [--severity critical] [--disabled] (-q prints only the id), set ID --above 95 --for 20m or --disabled/--enable, remove ID (a built-in rule is switched off), reset ID (technicians); rule metrics lists the metrics
stack template-update NAME [--diff] [--apply] [--set KEY=VALUE] Compare a stack with its template’s current version; --apply takes it as a new revision (deploy afterwards)
printer list, printer test TARGET The printers and print targets with their state; print a test page on a print target (uses paper). Print targets are changed in the portal, with api or by an assistant
smb list|set|test|files|mount|unmount|remove SMB shares: set ID --label T --host 10.1.2.3 --share NAME [--folder P] [--user 'DOMAIN\name'] --password-stdin [--writable] (the password from standard input, never as an argument), test ID (exit 1 when it fails), files ID [FOLDER], mount STACK SHARE SERVICE PATH [--writable], unmount STACK SERVICE PATH (both apply at the next deploy), remove ID
dns list|bind|unbind DNS records the server makes for itself: list (the allowlist HD Services set and the records made), bind HOST (a name on the allowlist that a stack or login page uses; never over an existing record), unbind HOST --yes (only such a record)
image update REPOSITORY [--wait] Technicians: pull and redeploy every stack that runs the image now (one row per stack: queued, pinned, stopped, …; a stopped stack stays stopped); --wait follows the jobs, exit 3 when one fails
template autoupdate NAME on|off [--dry-run] Technicians: the nightly update on or off for every stack created from template NAME (one row per stack, with compose edited when its compose file changed since); --dry-run shows what would change
api METHOD PATH [--data JSON|@file], openapi Any endpoint directly; the OpenAPI document
update [--check] Install the latest release (or only report whether there is one)
Code Meaning
0 Success
1 The server refused (the API’s message is in the output) or was unreachable
2 Wrong usage: unknown command, missing argument, no token
3 The job awaited with --wait failed
4 Stale revision (412) or the name is taken (409): read again and retry

Errors and progress go to standard error, results to standard output. A -o json result is therefore always clean.

Terminal window
# Deploy a stack after a new image and wait for the result
hddeploy stack deploy shop --wait
# Change a variable and deploy
hddeploy stack env set shop PHP_MEMORY_LIMIT=512M
hddeploy stack deploy shop --wait
# Publish a static website from the build folder
hddeploy site upload landing ./dist
# Upload source code for a stack built here, and build it
hddeploy stack source upload portal ./ --deploy --wait
# Create a stack from the nginx template, upload content, deploy
hddeploy stack create landing --template nginx --set SITE_DOMAIN=landing.example.com
hddeploy site upload landing ./dist
hddeploy stack deploy landing --wait
# Check a compose file before saving it
hddeploy stack compose validate shop -f docker-compose.yml
# Something broke: back to the previous revision and deploy
hddeploy stack revision list shop
hddeploy stack revision restore shop 41 --deploy --wait
# How busy is the server, and which containers used the most memory this week?
hddeploy resources
hddeploy resources containers --range 7d --sort memory
# Get an alert yourself when memory runs low
hddeploy resources rule add --metric memory-available --below 10 --for 10m
# For scripts: names only, or the full JSON answer
hddeploy -q stack list
hddeploy -o json stack get shop | jq .revision
jobs:
deploy:
runs-on: ubuntu-latest
env:
HDDEPLOY_SERVER: yourserver.hddeploy3000.nl
HDDEPLOY_TOKEN: ${{ secrets.HDDEPLOY_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Install hddeploy
run: |
curl -fsSL https://help.hddeploy3000.nl/downloads/hddeploy-linux-amd64 -o /usr/local/bin/hddeploy
chmod +x /usr/local/bin/hddeploy
- name: Deploy
run: hddeploy stack deploy shop --wait

Replace the last step with hddeploy site upload landing ./dist for a static website, or with hddeploy stack source upload portal ./ --deploy --wait for a stack built from your code. The token is an ordinary API token with only the scopes the pipeline needs (for example stacks.read, stacks.deploy, jobs.read).

If a pipeline only needs to deploy, a deploy webhook is simpler still: one URL, one token that can do nothing else. If you work with an AI assistant, the MCP server is the way. The command-line client sits in between: everything the API can do, for people and scripts.