The Hostinger CLI lets you manage Hostinger services from your terminal, including VPS, web hosting, DNS, and billing. Install it with Homebrew or a release archive, sign in through the browser or with an API token, and run commands such as hostinger vps virtual-machines list or hostinger hosting cdn purge-cache.
Step 1 – Download & install the CLI
macOS and Linux (recommended) install with Homebrew:
brew install hostinger/tap/hostinger
This also installs bash, zsh, and fish shell completions automatically. Upgrade later with:
brew upgrade hostinger
Windows, or without Homebrew: download the archive for your platform from the releases page and put the hostinger binary on your PATH. Each archive also bundles the shell completion files.
Verify the installation:
hostinger version
If this returns a version number, the CLI is installed correctly.
Step 2 – Authenticate with your API token
You have two ways to authenticate, depending on how you plan to use the CLI.
Option A – Browser sign-in (default, no token needed)
Just run any command. If you’re not authenticated yet, the CLI opens a browser window for you to sign in, then caches and automatically refreshes your credentials. This is the fastest way to get started interactively.
Option B – API token (recommended for CI/CD and scripts)
- Generate a token in Hostinger dashboard → API.
- Provide it to the CLI either through an environment variable or a config file:
Environment variable (current session only):
export HOSTINGER_API_TOKEN=<paste_your_token_here>
Config file (persistent): create ~/.hostinger.yaml with:
api_token: <your API token>
Any command will automatically pick up the token from either source.
Note: a configured token always takes precedence over browser sign-in. If commands suddenly fail to authorize after working before, check for a stale api_token in your config file or environment first.
Step 3 – Command structure
Most commands follow a three-level pattern:
hostinger <group> <subgroup> <verb> [args] [flags]
Examples:
hostinger vps virtual-machines list
hostinger vps virtual-machines get <vm_id>
hostinger vps vm start <vm_id> # "vm" is a short alias for "virtual-machines"
hostinger vps vm stop <vm_id>
hostinger dns records list example.com
hostinger billing catalog list
Three top-level commands sit outside this pattern: hostinger up deploys a website, and hostinger link and hostinger unlink save and remove a project’s details. See How to deploy a website with the Hostinger CLI. To share a local project on a temporary URL for 24 hours, run hostinger preview, as described in How to share a local website with Hostinger Preview.
Add --help at any level to see what a group or subgroup contains, e.g.:
hostinger vps --help
hostinger vps firewall --help
Step 4 – Output formats
Results print as a table by default. Use --format to change that:
hostinger vps virtual-machines list --format json | jq
hostinger vps virtual-machines list --format tree
table– human-readable (default)json– for piping into scripts, dashboards, orjqtree– nested data as a tree, useful for exploring a response’s structure
hostinger.Shell completion
Tab-completion is available for bash, zsh, fish, and PowerShell. Homebrew installs the bash/zsh/fish completions automatically. For a manual install, see AUTOCOMPLETE.md in the CLI repository.
Official documentation
- CLI guide – https://docs.hostinger.com/api-reference/cli
- Full command reference (every command, generated from the API spec) – https://github.com/hostinger/api-cli/blob/main/docs/hostinger.md
- Scripting with the CLI (exit codes, passing JSON to flags) – https://docs.hostinger.com/api-reference/cli-scripting
- API reference – https://developers.hostinger.com
You can now automate routine VPS and web hosting tasks, deploy websites, integrate Hostinger operations into CI/CD pipelines, or manage your services faster from your terminal.