DevelopersCommand-line tool

Command-line tool

hostwolf is one small program for Hostwolf Apps and Hostwolf game servers. It talks to the same REST API as the SDK, so anything it does you can also script yourself.

Install#

macOS and Linux

curl -fsSL https://hostwolf.net/dl/cli/install.sh | sh

The script picks the build for your system, checks its SHA-256 and puts hostwolf in /usr/local/bin, or in ~/.local/bin when that is not writable. Set HOSTWOLF_INSTALL_DIR to choose another directory.

Windows

In PowerShell:

irm https://hostwolf.net/dl/cli/install.ps1 | iex

The script checks the SHA-256, installs hostwolf.exe into %LOCALAPPDATA%\Hostwolf\bin and adds that directory to your user PATH. Open a new terminal afterwards.

Manual download

Every build and its checksum are at hostwolf.net/dl/cli/latest.json: macOS (Apple silicon and Intel), Linux (x86-64 and ARM64) and Windows (x86-64). Download the file for your system, compare it with SHA256SUMS, make it executable and put it on your PATH.

Check it works:

hostwolf version

hostwolf update replaces the program with the newest version after checking its checksum. The CLI also checks once a day and tells you when a new version is out.

Sign in#

hostwolf login

login asks for two tokens; press Enter to skip the one you don't need:

  • Hostwolf Apps: create an API token in the console under Keys & Tokens → API tokens. Logs, variable values and connection strings need a token with read:sensitive; changes need write, deploys deploy.
  • Hostwolf games: create an API key in the game panel.

Each token is checked, then saved in your user config directory (credentials.json, readable only by you). The CLI never prints a token. hostwolf whoami shows which accounts you are signed in to, and hostwolf logout forgets the tokens.

In CI, skip login: set HOSTWOLF_APPS_TOKEN (and HOSTWOLF_GAMES_TOKEN for game servers) as secrets, or pass --token.

Deploy and follow an app#

Apps, servers and databases can be named by uuid or by name.

hostwolf apps list
hostwolf apps deploy my-app --follow       # streams the build log; exits 1 if the deploy fails
hostwolf apps logs my-app --follow         # container logs, new lines as they come
hostwolf apps restart my-app
hostwolf apps stop my-app
hostwolf apps start my-app                 # bring a stopped app back from its last build, no rebuild
hostwolf apps rollback my-app              # images you can go back to
hostwolf apps rollback my-app 3f2a9c1

Variables and domains#

hostwolf apps env my-app                               # KEY=value, one per line
hostwolf apps env set my-app NODE_ENV=production [email protected]
hostwolf apps env unset my-app OLD_FLAG
hostwolf apps domains add my-app shop.example.com      # prints the DNS records to add
hostwolf apps restart my-app                           # apply the changes

@file reads a value from a file, so secrets stay out of your shell history. Variables that are only shown once are listed as hidden, never with their value.

Domains go through the Hostwolf edge by default (see Custom domains):

hostwolf apps domains add my-app www.shop.com            # the TXT record to add first, then TYPE NAME VALUE REQUIRED
hostwolf apps domains add my-app api.shop.com --no-edge  # served directly from the server
hostwolf apps domains status my-app                      # DOMAIN EDGE STATUS ROUTING TLS
hostwolf apps domains status my-app www.shop.com --refresh
hostwolf apps domains check my-app www.shop.com           # looks for the TXT record, DNS and certificate again now
hostwolf apps domains purge my-app www.shop.com          # once a minute per domain
hostwolf apps domains edge my-app www.shop.com off       # on|off; prints the new DNS records
hostwolf apps domains remove my-app www.shop.com --confirm
  • add prints the DNS records to add at your DNS provider. For a root domain such as shop.com it adds a note: your DNS provider must support CNAME flattening (ALIAS/ANAME) at the root; otherwise add www.shop.com and redirect the root to it.
  • status lists every domain, or one domain with its DNS records. --refresh checks DNS and the certificate again now.
  • purge exits 1 when the domain's cache was purged less than a minute ago.
  • --json prints the API's answer as it is.

Servers and prices#

hostwolf apps servers                         # your servers with size, city and price
hostwolf apps servers get my-server           # addresses, private address, price
hostwolf apps servers regions --size m        # every city, its key and its exact hardware, cheapest first
hostwolf apps servers regions --size s --kind vps  # the machines of a plain VPS
hostwolf apps servers create --size m --city nuremberg
hostwolf apps servers upgrade my-server --size l
hostwolf apps servers upgrade my-server --size l --confirm
hostwolf apps servers upgrade my-server --size l --mode replace --confirm
hostwolf apps servers upgrade my-vps --size l --confirm --acknowledge-restart
hostwolf apps servers restart my-server --confirm  # also works for a copy added by autoscaling, once per 10 minutes
hostwolf apps servers delete my-server        # shows what would be deleted
hostwolf apps servers delete my-server --confirm
hostwolf apps spend                           # this month so far, plus account credit if your team pays from credit
hostwolf apps team                            # team name and account credit balance
hostwolf apps team rename --name "Acme Shop"  # rename the team (or --description)
hostwolf apps team members                    # members and roles
hostwolf apps team members role 42 admin --yes
hostwolf apps team invitations invite [email protected] --role member --yes
hostwolf apps team invitations revoke INVITATION --yes
hostwolf apps team tokens                     # API tokens (never their secrets)
hostwolf apps team tokens revoke 5 --yes
hostwolf apps billing alerts set --threshold 25 --channels email,slack --yes   # where spend alerts go

servers regions lists each city with its CITY name, city KEY (such as nuremberg or new-york-new-jersey) and the exact HARDWARE of that size there: vCPUs, RAM and disk in GiB, as the operating system shows them. The machine behind a size differs from city to city, and a plain VPS can differ from an app server in the same city (--kind vps). servers, servers get, servers create and servers upgrade print the hardware of the server or quote too. --city takes either, and so does --cities for autoscaling.

The CLI never buys anything. servers create shows the price and prints a console link with the order already filled in; you pay there (--open opens it in your browser).

servers delete without --confirm shows the server's name, hostname, kind, size, city and monthly price and sends nothing. With --confirm it deletes the server right away: billing stops, its apps are removed and its volumes are kept for 7 days. A database server that still holds databases also needs --delete-databases, and a VPS that has snapshots needs --keep-snapshots or --delete-snapshots.

Anything that raises your bill or deletes data first shows what it would do (for an upgrade: the new monthly price, the difference and the expected downtime) and stops with exit code 3. Run it again with --confirm to go ahead.

servers upgrade changes a server's size, larger or smaller (an app server can be made smaller when its used disk fits). The quote shows how the change will run: your apps stay online, or the server restarts briefly. --mode auto|replace|in_place picks the way for an app server (see resizing a server): replace never restarts, in_place restarts briefly. A change that restarts the server needs your acknowledgement: on a terminal the command asks, and in scripts --confirm needs --acknowledge-restart (or --mode in_place), otherwise it stops with an error that names the flag and changes nothing. Refusals such as a smaller size that does not fit the used disk, or a size that is not available, are explained in plain words.

servers get shows the server's public IP and IPv6 address and, once it has joined your private network, its Private IP and Private hostname.

Private network#

Your team's servers are joined in an encrypted private network, across cities (see Private network). It is on by default and costs nothing.

hostwolf apps private-network                 # on or off, the range and every server's private address
hostwolf apps private-network on
hostwolf apps private-network off             # shows what changes; --confirm to go ahead
hostwolf apps private-network off --confirm
Private network:  on
Network:          100.64.100.0/24

NAME   KIND  PRIVATE IP    PRIVATE HOSTNAME                  STATUS
web-1  app   100.64.100.3  s1a2b3c.private.app.hostwolf.net  ready
box    vps   -             -                                 joining

A server's status is joining, ready, error or off. off without --confirm sends nothing and exits with code 3: turning the network off removes every private address and private hostname, and apps that connect to your other servers or databases over the private network lose those connections. Only team owners and admins can turn it on or off.

VPS snapshots and backups#

Snapshots and automatic backups hold a VPS's own disk, not its storage volumes (see VPS snapshots and backups). A VPS is named by its uuid, name or hostname.

hostwolf apps vps snapshots                                  # every snapshot of your team, also kept ones
hostwolf apps vps snapshots list my-vps
hostwolf apps vps snapshots create my-vps --name "before upgrade" --confirm
hostwolf apps vps snapshots restore my-vps "before upgrade"  # shows what is replaced; --confirm to go ahead
hostwolf apps vps snapshots delete snap_01J… --confirm
hostwolf apps vps snapshots new-vps "before upgrade" --size m   # order link for a new VPS, never buys

hostwolf apps vps backups my-vps                             # on or off, extra monthly price, the backups
hostwolf apps vps backups on my-vps                          # shows the extra monthly price; --confirm to go ahead
hostwolf apps vps backups off my-vps --confirm               # deletes the existing backups
hostwolf apps vps backups restore my-vps bk_0123456789abcdef0123 --confirm
  • A snapshot costs $0.0619 per GB stored a month, on every VPS; list shows that rate and each snapshot's price. At most 10 per VPS.
  • restore replaces the VPS's whole disk and keeps its IP addresses. Without --confirm it shows the VPS, the snapshot and what is lost, sends nothing and exits with code 3. The same goes for delete, backups off and backups restore.
  • new-vps prints the console link that opens the order form in the snapshot's city (--open opens it). You pay there; the CLI never buys.
  • Automatic backups cost 20% of the VPS's own monthly price. backups on without --confirm prints the exact extra monthly price and exits with code 3. A backup is taken every day and the last 2 are kept. Backups run on their own; to keep a copy right now, take a snapshot (snapshots create).
  • hostwolf apps servers delete my-vps --confirm asks you to add --keep-snapshots (they stay billed) or --delete-snapshots when the VPS has snapshots.

VPS rescue mode and browser console#

Rescue mode restarts a VPS into a separate rescue system so you can repair it; its own disk is kept (see VPS rescue mode and browser console). Only team owners and admins can switch it.

hostwolf apps vps                                            # your VPS, with status and rescue mode
hostwolf apps vps get my-vps                                 # rescue mode and console page
hostwolf apps vps rescue on my-vps                           # asks first; prints the sign-in
hostwolf apps vps rescue off my-vps --yes                    # boots the VPS's own disk again
hostwolf apps vps console my-vps --open                      # the browser console page
  • rescue on and rescue off ask you to type yes first. In scripts, or with --json, add --yes; without it nothing is sent and the command exits with code 3.
  • rescue on prints the sign-in: SSH as root@<ip> with your SSH key, or the browser console link. There is no root password; in rescue mode the browser console needs no sign-in.
  • Follow the switch with hostwolf apps vps get my-vps: rescue mode goes from starting to on (and from stopping to off) in about a minute. While it is on, rebuild, resize, restores and every power action, reboot included, are refused; leave rescue mode first.
  • console prints the link to the VPS's page in the console, where the browser console opens (--open opens it). On every VPS it is a terminal in your browser, on our own site. It works only in the browser.
  • hostwolf apps servers get shows the same fields for a VPS, and hostwolf apps servers list marks a VPS in rescue mode.

Databases and volumes#

hostwolf apps databases create --engine postgres --server my-server --wait
hostwolf apps databases attach my-db my-app          # saves DATABASE_URL on the app
hostwolf apps databases connection my-db             # password hidden; --show-password to print it
hostwolf apps databases get my-db                    # includes the private hostname when it has one
hostwolf apps databases backups my-db                # restore points
hostwolf apps databases restore my-db --point <id> --server my-server
hostwolf apps databases create --engine postgres --server my-server --extensions vector,postgis   # Postgres 17 by default
hostwolf apps databases extensions my-db --extensions citext,pg_trgm   # older databases: add --confirm-restart for vector/postgis
hostwolf apps databases upgrade my-db                # Postgres 16 to 17: shows the quote, free; add --confirm --wait to run it
hostwolf apps databases move my-db --to-server db-1      # shows the price and the plan; add --confirm to move
hostwolf apps databases move my-db --to-server db-1 --storage growable --grow-max-gb 100 --confirm

hostwolf apps volumes create my-server --size 50 --backups   # shows the price
hostwolf apps volumes create my-server --size 50 --backups --confirm
hostwolf apps volumes list                           # PRICE says "pending" until a new volume is ready
hostwolf apps autoscaling set my-app --enable --max 3 --cap 40 --confirm

databases move shows the price and the plan and changes nothing until you add --confirm. --to-server takes a database server id (see databases catalog) or the uuid or name of an app server. --storage growable --grow-max-gb N moves onto storage that grows automatically; --storage disk moves back onto the server's disk. The connection URL does not change, but at the switch expect about 3 to 5 seconds of connection errors, so have your clients retry connection errors for about 5 seconds. A move to the server the database already lives on is refused (move_target_same: "The database already lives on this server. Choose another server."), and a move back to the server it just left is refused for 15 minutes (move_target_busy: "try again after HH:MM UTC"). With a read-only token the quotes work, while add-storage, storage-limit and move --confirm answer 403. Refusals are printed in the API's words with "nothing was changed". When the quote says writes pause while the data is copied, accept that with --confirm --paused.

databases attach prints what the engine's clients still need for the certificate check (for example PGSSLROOTCERT for psql, Django and Rails); see the client recipes. Using a volume in an app is an API call: Use a volume in an app.

Copies of an app on other servers#

Run the same app on more than one of your app servers, for example in two cities (see Multi-server). Adding a copy uses a server you already have and costs nothing by itself.

hostwolf apps copies my-app                          # the servers it runs on: the first server and the copies
hostwolf apps copies add my-app my-chicago-server    # then deploy to start the copy
hostwolf apps deploy my-app --follow
hostwolf apps copies remove my-app my-chicago-server # asks first; --yes skips the question
  • The server has to be one of your app servers. A VPS or a database server is refused.
  • The first server of an app (where it was created) cannot be removed. Removing a copy stops it there; the server and its data stay.

Workers and scheduled jobs#

Background workers, the release command and scheduled jobs of an app (see Workers and scheduled jobs). Workers and jobs are named by name or uuid. They cost nothing extra.

hostwolf apps workers my-app                       # workers, release command and start command
hostwolf apps workers get my-app worker
hostwolf apps workers create my-app --name worker --command "php artisan queue:work" --deploy
hostwolf apps workers create my-app --name mailer --command "node mailer.js" --server other-server --copies 2
hostwolf apps workers update my-app worker --copies 3 --deploy
hostwolf apps workers deploy my-app worker --follow   # only this worker
hostwolf apps workers release my-app "php artisan migrate --force"
hostwolf apps workers release my-app --clear
hostwolf apps workers delete my-app worker --confirm

hostwolf apps jobs my-app                          # every job of the app and its workers, with the last run
hostwolf apps jobs create my-app --name cleanup --schedule "0 3 * * *" --command "php artisan cleanup" --timezone Europe/Berlin
hostwolf apps jobs create my-app --name report --schedule hourly --command "node report.js" --worker worker
hostwolf apps jobs update my-app cleanup --schedule "30 2 * * *" --timeout 900
hostwolf apps jobs disable my-app cleanup          # enable switches it back on
hostwolf apps jobs run my-app cleanup --wait       # prints the output; exit 1 if it fails
hostwolf apps jobs logs my-app cleanup --limit 10  # newest runs with status, duration and output
hostwolf apps jobs delete my-app cleanup --confirm
NAME    COMMAND                 COPIES  SERVER  CITY       STATUS   LAST DEPLOY
worker  php artisan queue:work  2       web-1   Frankfurt  running  finished …

Release command:      php artisan migrate --force
Start command (web):  default (detected by the build, or the image's own command)
  • workers create takes --name, --command, --server (uuid, name or hostname of another of your app servers; default: the app's server), --copies (1-10, default 1) and --deploy. At most 10 workers per app.
  • A new or changed worker runs after its next deploy: add --deploy, or run workers deploy (--follow streams the build log, --wait waits without it). After that, workers are deployed after each deploy of the web app.
  • For Dockerfile and image apps the command replaces the image's CMD; use sh -c '…' for shell features.
  • workers release <app> shows the release command; with a command it sets it, and --clear removes it.
  • jobs create takes --name, --command (at most 2000 characters), --schedule (a cron expression with 5 fields, or hourly, daily, weekly, monthly, yearly), --timezone (IANA, default UTC), --timeout (seconds, default 300, at most 36000), --worker and --disabled.
  • --worker picks the worker a job runs in. A job name that is used in both the web app and a worker needs --worker on get, update, enable, disable, run, logs and delete.
  • workers delete and jobs delete need --confirm. Without it they send nothing and exit with code 3.

File storage#

S3-compatible buckets, Small, Big and older buckets on your own servers (see File storage (S3)). Buckets are named by id or name, servers and apps by uuid or name. The CLI creates, resizes and deletes Small and Big buckets, manages their keys and shows usage. Anything that costs money first shows what it would do and points to the pricing page, and needs --confirm.

hostwolf apps storage                          # your storage overview: endpoints, region, room left on your own servers
hostwolf apps storage buckets                  # every bucket of your team
hostwolf apps storage buckets create --tier small --size-gb 5 --name uploads   # shows what it would do; add --confirm
hostwolf apps storage buckets create --tier big --name media --confirm
hostwolf apps storage buckets size uploads --size-gb 50 --confirm            # change a Small size
hostwolf apps storage buckets resize uploads --to big --confirm               # Small to Big
hostwolf apps storage buckets resize uploads --to small --size-gb 50 --confirm
hostwolf apps storage buckets resize-status uploads                          # phase: copy, hold, soak
hostwolf apps storage buckets undo-resize uploads --confirm                  # within 6 hours
hostwolf apps storage usage                                                   # this month, an estimate
hostwolf apps storage buckets create --server my-server --name uploads --quota-gb 10   # a bucket on your own server
hostwolf apps storage buckets get uploads      # endpoint, private endpoint, region, size, status
hostwolf apps storage buckets update uploads --public-read --cors-origin https://shop.example.com
hostwolf apps storage buckets update uploads --public-read=false --clear-cors
hostwolf apps storage buckets delete uploads --confirm

hostwolf apps storage keys list uploads
hostwolf apps storage keys create --bucket uploads --name "web app" --permission read-only
hostwolf apps storage keys rotate stk_6a5f…
hostwolf apps storage keys delete stk_6a5f… --confirm

hostwolf apps storage backups list uploads     # restore points
hostwolf apps storage backups run uploads      # one now
hostwolf apps storage backups restore uploads --point pt_20261018T033611Z_f4ee18 --to new --name uploads-copy
hostwolf apps storage backups restore uploads --point pt_20261018T033611Z_f4ee18 --to same --confirm

hostwolf apps storage connect uploads --app my-app   # saves S3_ENDPOINT, S3_BUCKET, … on the app
  • buckets create --tier, buckets size, buckets resize and buckets undo-resize change what you are billed. Without --confirm they show the bucket and the size, point to the pricing page (the CLI does not quote a price) and send nothing (exit code 3). Refusals (no payment method or credit, limit reached, name taken, stopped account, files that do not fit, a running resize) are printed in the API's words with "nothing was changed". Retry with --idempotency-key so one change never runs twice.
  • A resize can be undone for 6 hours, and the bucket cannot be deleted during that time. usage is an estimate; the invoice is the authority.
  • keys create and keys rotate print the secret once, with a warning. Store it then: it is never shown again.
  • buckets delete, keys delete (revoke) and backups restore --to same need --confirm. Without it they send nothing and exit with code 3. Deleting a Small or Big bucket removes its files for good and is refused while it is being resized or for 6 hours after a resize; a bucket on your own server keeps a final copy for 7 days.
  • A new, rotated or revoked key applies within about 10 seconds; a new key can answer InvalidAccessKeyId until then.
  • --quota-gb is required on an app server (at least 1). On a storage server it is optional, and 0 means no limit.
  • --cors-origin (repeat it for more origins) sets one CORS rule for those origins, with the methods GET, PUT, POST, DELETE and HEAD and any header; it replaces the existing rules. --clear-cors removes them. For finer rules use the API.
  • backups restore --to new needs --name, and takes --server and --quota-gb for the new bucket. --to same makes the bucket exactly like the point, after a safety copy.
  • connect uses the private endpoint when every server the app runs on is on your private network (--private=false for the public one). It never replaces variables the app already has unless you add --overwrite; --env-key-prefix S3_MEDIA_ saves them under other names. Redeploy the app afterwards.
  • Clients must use path-style addressing (forcePathStyle: true, addressing_style = path); the endpoint of Small and Big buckets is https://s3.app.hostwolf.net.

Slices#

Small container machines by the hour; see Slices for sizes, prices and limits. Creating one shows the price first and only goes ahead with --confirm.

hostwolf apps slices sizes
hostwolf apps slices create --size small --image python312 --name build-box --confirm
hostwolf apps slices exec build-box -- python3 --version
hostwolf apps slices files put build-box /workspace/app.py ./app.py
hostwolf apps slices logs build-box --follow
hostwolf apps slices volumes create --name data --size-gb 10 --confirm
hostwolf apps slices volumes grow data --size-gib 25 --confirm   # bigger only, up to 500 GiB
hostwolf apps slices delete build-box --confirm

Files can only be read and written under /workspace. Slices have no outbound network access.

Game servers#

The same program runs your game servers; see the game docs:

hostwolf games servers
hostwolf games servers restart my-server
hostwolf games servers command my-server say Back in 5 minutes

Scripts and CI#

  • --json prints the API's JSON instead of a table, for jq and scripts.
  • Messages and progress go to standard error; standard output only carries results.
  • Exit codes: 0 done, 1 failed, 2 wrong usage, 3 needs --confirm, 4 not signed in or not allowed, 5 not found, 6 the region has no room for the order (nothing was ordered or charged; the message lists the regions with room).
  • --help works on every command, e.g. hostwolf apps servers upgrade --help.
# GitHub Actions: deploy on every push to main
- run: curl -fsSL https://hostwolf.net/dl/cli/install.sh | sh
- run: hostwolf apps deploy my-app --follow
  env:
    HOSTWOLF_APPS_TOKEN: ${{ secrets.HOSTWOLF_APPS_TOKEN }}
VariableWhat it does
HOSTWOLF_APPS_TOKENHostwolf Apps token (instead of login)
HOSTWOLF_GAMES_TOKENGame panel API key (instead of login)
HOSTWOLF_CONFIG_DIRWhere credentials.json is kept
HOSTWOLF_LANGUAGELanguage of API messages: en, de, fr, es or fi
HOSTWOLF_NO_UPDATE_CHECKSet to 1 to skip the daily update check
Stuck, or missing an endpoint? Tell us at app.hostwolf.net/contact or [email protected].