DevelopersCommand-line tool
Command-line tool
hostwolf is one small program for Hostwolf game servers and Hostwolf Apps. 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 games
Paste an API key from the panel's Account → API page. The key is checked, then saved in your user config directory (credentials.json, readable only by you). The CLI never prints it. If the key has an IP allow-list, add the address you run the CLI from.
hostwolf login without games also asks for a Hostwolf Apps token; press Enter to skip it. hostwolf whoami shows which accounts you are signed in to, and hostwolf logout forgets the keys.
In scripts and CI, skip login and set HOSTWOLF_GAMES_TOKEN, or pass --token.
Servers, power and console#
Name a server by the 8-character id from its panel URL, its uuid or its name.
hostwolf games servers # id, name, game, region, SFTP address
hostwolf games servers status my-server # state, CPU, memory, disk, network
hostwolf games servers restart my-server --wait # waits until it is running again
hostwolf games servers stop my-server
hostwolf games servers command my-server say Restart in 5 minutes
power <server> start|stop|restart|kill does the same as the short forms. Put -- before a console command that starts with a dash.
Files#
hostwolf games files my-server /plugins
hostwolf games files upload my-server LuckPerms.jar --dir /plugins
hostwolf games files download my-server /server.properties
hostwolf games files download my-server /logs/latest.log -o - | tail -50
Uploads and downloads go straight to the machine your server runs on.
Backups#
hostwolf games backups my-server
hostwolf games backups create my-server --name before-update --wait
hostwolf games backups restore my-server <backup-id> --confirm
A restore overwrites the server's files, so it needs --confirm; --truncate deletes every file first.
Databases#
hostwolf games databases create my-server luckperms
hostwolf games databases my-server --show-password
hostwolf games databases delete my-server <database-id> --confirm
The first database on a server starts its database service, which takes about 40 seconds; the CLI waits for it. Passwords are only printed with --show-password.
Plans and ordering#
hostwolf games store games
hostwolf games store plans list --region falkenstein --game paper
hostwolf games store buy --game paper --size 4g --region falkenstein --open
hostwolf games store orders
The CLI never buys anything. store buy shows the price and prints a store link with your choices filled in; you review and pay in the browser.
Hostwolf Apps#
The same program deploys and runs apps on Hostwolf Apps:
hostwolf apps deploy my-app --follow
hostwolf apps logs my-app --follow
hostwolf apps servers regions --size m # every city and its key, cheapest first
hostwolf apps servers create --size m --city nuremberg # prints an order link, never buys
hostwolf apps servers delete my-server --confirm
hostwolf apps servers get my-server # includes the private IP and private hostname
hostwolf apps private-network # your team's private network and each server's private address
hostwolf apps private-network on
hostwolf apps private-network off --confirm
hostwolf apps vps snapshots create my-vps --name "before upgrade"
hostwolf apps vps snapshots restore my-vps "before upgrade" --confirm
hostwolf apps vps backups on my-vps # shows the extra monthly price; --confirm to go ahead
hostwolf apps vps rescue on my-vps # asks first; prints the SSH sign-in and the browser console link
hostwolf apps vps rescue off my-vps --yes
hostwolf apps vps console my-vps --open # the VPS page where the browser console opens
hostwolf apps domains add my-app www.shop.com # prints the DNS record to add (CNAME to edge.app.hostwolf.net)
hostwolf apps domains status my-app --refresh
hostwolf apps domains purge my-app www.shop.com
hostwolf apps storage # S3 file storage: servers that can hold buckets, endpoints, region
hostwolf apps storage buckets create --server my-server --name uploads --quota-gb 10
hostwolf apps storage keys create --bucket uploads --name "web app" # the secret is shown once
hostwolf apps storage connect uploads --app my-app # saves S3_ENDPOINT, S3_BUCKET, … on the app
hostwolf apps copies add my-app my-chicago-server # run a copy of the app on another of your app servers
hostwolf apps workers create my-app --name worker --command "php artisan queue:work" --deploy
hostwolf apps workers release my-app "php artisan migrate --force"
hostwolf apps jobs create my-app --name cleanup --schedule "0 3 * * *" --command "php artisan cleanup" --timezone Europe/Berlin
hostwolf apps jobs run my-app cleanup --wait # prints the output; exit 1 if it fails
apps servers regions lists each city with its CITY name and city KEY (such as nuremberg or new-york-new-jersey); --city takes either.
apps servers delete without --confirm only shows what would be deleted. With it, the server is deleted right away; a database server that still holds databases also needs --delete-databases, and a VPS that has snapshots needs --keep-snapshots or --delete-snapshots.
apps vps snapshots and apps vps backups take snapshots and automatic daily backups of a VPS's own disk, list them, restore one (the VPS keeps its IP addresses) and delete them; see VPS snapshots and backups. A snapshot costs $0.0619 per GB stored a month on every VPS, and automatic backups 20% of the VPS's own monthly price. A backup is taken every day and the last 2 are kept; to keep a copy right now, take a snapshot. Restoring, deleting and turning backups off need --confirm, and backups on shows the extra monthly price first.
apps vps rescue on restarts a VPS into a separate rescue system so you can repair it; its own disk is kept. It prints the sign-in: SSH as root@<ip> with your SSH key, or the browser console link. There is no root password, and in rescue mode the browser console needs no sign-in. While rescue mode is on, every power action, reboot included, is refused. apps vps rescue off boots the VPS's own disk again. Both ask first; add --yes in scripts. apps vps get shows the rescue mode as it goes from starting to on. apps vps console prints the link to the VPS's page in the console, where the browser console opens: a terminal in your browser on every VPS, on our own site (--open opens it); see VPS rescue mode and browser console.
apps domains add puts a custom domain on the Hostwolf edge: it prints the one DNS record to add (a CNAME to edge.app.hostwolf.net), and the domain then gets an automatic TLS certificate, caching of static files that follows your app's Cache-Control headers, DDoS protection and, when the app runs in several cities, the nearest city for each visitor. apps domains status shows each domain's state (--refresh checks again now), apps domains purge clears a domain's edge cache (once a minute per domain), and apps domains edge <app> <domain> off serves the domain directly from the server instead; see Custom domains.
apps storage manages S3-compatible file storage on Hostwolf Apps: buckets (list, get, create, update, delete), keys (list, create, rotate, delete), backups (list, run, restore) and connect. Buckets on an app server are free and use its disk; storage servers are ordered in the console. Key secrets are printed once with a warning. buckets delete, keys delete and backups restore --to same need --confirm. Clients must use path-style addressing; see the CLI reference.
apps copies (list, add, remove) runs the same app on more than one of your app servers, for example in two cities. Adding a copy uses a server you already have and costs nothing by itself; deploy afterwards to start it. copies remove asks first (--yes skips the question) and the first server of an app cannot be removed.
apps workers (list, get, create, update, deploy, delete, release) runs background workers next to an app: same code and variables, their own command, 1 to 10 copies, on the app's server or another of your app servers, deployed after each deploy of the web app. release sets the command that runs once on every deploy before the new version starts. apps jobs (list, get, create, update, enable, disable, run, logs, delete) runs scheduled jobs in the app or one of its workers (--worker), on a cron schedule in a timezone of your choice. Deleting needs --confirm. Workers and jobs cost nothing extra; see workers and scheduled jobs.
Your app servers, database servers and VPS on Hostwolf Apps are joined in an encrypted private network. apps servers get shows a server's Private IP and Private hostname once it has joined. apps private-network off needs --confirm, because apps that connect over the private network lose those connections; on costs nothing.
Scripts and CI#
--jsonprints the API's JSON instead of a table, forjqand scripts.- Messages and progress go to standard error; standard output only carries results.
- Exit codes:
0done,1failed,2wrong usage,3needs--confirm,4not signed in or not allowed,5not found. --helpworks on every command, e.g.hostwolf games backups restore --help.
# Nightly backup from cron, kept out of rotation
HOSTWOLF_GAMES_TOKEN=ptlc_your_key hostwolf games backups create my-server --name nightly --lock --wait
| Variable | What it does |
|---|---|
HOSTWOLF_GAMES_TOKEN | Game panel API key (instead of login) |
HOSTWOLF_APPS_TOKEN | Hostwolf Apps token (instead of login) |
HOSTWOLF_CONFIG_DIR | Where credentials.json is kept |
HOSTWOLF_NO_UPDATE_CHECK | Set to 1 to skip the daily update check |