For the complete documentation index, see llms.txt. This page is also available as Markdown.

Hostinger CLI

Install and use the hostinger command-line client — Homebrew and binary downloads, shell completion, browser sign-in or API token authentication, command structure, prompts, and output formats.

hostinger is the official command-line client for the Hostinger API. It's generated from the same OpenAPI specification as the API reference, so it tracks the API as endpoints are added.

Install

On macOS and Linux, install with Homebrew:

brew install hostinger/tap/hostinger

Upgrade later with brew upgrade hostinger. Homebrew also installs shell completion for bash, zsh, and fish, and the man pages (man hostinger).

On 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 completion files and man pages.

Confirm the install:

hostinger version

Set up shell completion

Completion fills in commands, flags, and flag values with a fixed set of choices. It also completes the IDs and names of your own resources: hostinger vps virtual-machines start <TAB> lists your virtual machines with their hostnames, and hostinger dns records list <TAB> lists your domains. Those suggestions are fetched from the API with your current credentials and never open a browser sign-in.

If you didn't install with Homebrew, install the completion script for your shell:

hostinger completion install        # detects the shell from $SHELL
hostinger completion install zsh    # or name it: bash, zsh, fish, powershell

The command prints any one-time step your shell still needs, such as adding a directory to fpath in zsh. Run it again after upgrading so new commands complete. For a manual setup, see AUTOCOMPLETE.md in the CLI repository.

Authenticate

Sign in through the browser:

You don't have to do this first — any command run without credentials opens the same sign-in. The CLI caches those credentials and refreshes them for you. hostinger auth logout signs out and removes them.

To authenticate with a token instead — in CI, for example — set HOSTINGER_API_TOKEN, or store it in the config file:

Leaving out the value makes the CLI ask for it without echoing, so the token stays out of your shell history. Generate tokens in hPanel → API. See Security & Access for how tokens are managed.

Check which credentials are in use:

Note: A configured token takes precedence over browser sign-in. If commands suddenly fail to authorize, run hostinger auth status — it shows whether a token is set and where it comes from (the environment or the config file).

Settings

Settings live in $HOME/.hostinger.yaml. Manage them with hostinger config:

Command
What it does

hostinger config list

Shows every setting and its current value. Tokens are masked.

hostinger config set <key> [value]

Writes a setting to the config file.

hostinger config get <key>

Prints the value in effect, including one set through the environment.

hostinger config unset <key>

Removes a setting from the config file.

hostinger config path

Prints the config file location.

The settings are api_token, api_url, format (the default output format), and no_input (true turns off all prompts). Each can also be set through an environment variable, which overrides the file — for example HOSTINGER_FORMAT=json.

Run commands

Commands follow the pattern hostinger <group> <subgroup> <verb>:

Add --help at any level to see what a group or subgroup contains:

A command's help lists its required flags in a separate section above the optional ones, and ends with examples. For flags that take JSON, it also shows the shape of the value — see Passing JSON to flags.

If you mistype a command, the CLI suggests the closest match:

Prompts and confirmations

In a terminal, the CLI asks for anything required that you left out. Run hostinger vps virtual-machines get without an ID and it lists your virtual machines to pick from. Leave out a required flag and it asks for that too, listing the allowed values where there's a fixed set.

Commands that delete, stop, restart, restore, reset, uninstall, deactivate, or purchase ask before running:

Pass --yes (or -y) to skip the question. Pass --no-input, or set no_input to true, to turn prompting off entirely — missing values then fail straight away.

To see exactly what a command would send without running it, add --dry-run. The CLI prints the request as an equivalent curl command and sends nothing:

Waiting for VPS actions

VPS power and maintenance commands — start, stop, restart, recreate, backup and snapshot restores, and others — return as soon as the action is queued. Add --wait to block until it finishes:

The CLI reports each state change and exits with an error if the action fails. --wait-timeout sets how long to wait (default 10m).

What you can manage

The CLI covers the whole Public API, grouped by product area. Use this to find the right group, then --help your way down to the verb.

Group
What it covers

hosting

Websites and the hosting environment — databases, PHP versions and extensions, cron jobs, cache, subdomains, and Node.js builds.

vps

Virtual machines and everything around them — power actions, backups and snapshots, firewall, Docker, SSH keys, recovery mode, PTR records, OS templates, malware scanning.

mail

Mailboxes, forwarders, aliases, auto-replies, catch-alls, access logs, and webhooks.

wordpress

Installations, plugins, themes, one-click login links, maintenance mode, LiteSpeed and object caching, and AI tools.

domains

Availability checks, registration, transfers, forwarding, WHOIS contact profiles, and ownership verification.

dns

Zone records and zone snapshots, including validation and restore.

agency-hosting

Agency plan websites and their per-site resources — provisioning, databases, cron jobs, cache, files, Node.js builds, and WordPress.

ecommerce

Stores, physical and digital products, payment methods, shipping, and sales channels.

reach

Email marketing — contacts, segments, and sending profiles.

billing

Catalog lookups, purchase orders, payment methods, subscriptions, and auto-renewal.

horizons

Hostinger Horizons websites.

Output formats

In a terminal, results print as a table. When the output is piped or redirected, the CLI prints JSON instead, so it's ready for other tools. Choose a format explicitly with --format (or -o): table, json, yaml, or tree for nested data. To change the default, run hostinger config set format json.

Filter results with --jq, which takes a jq expression — no separate jq install needed:

List commands that return results in pages take --all to fetch every page in one go.

For exit codes, error output, passing JSON to flags, and the commands worth being careful with, see Scripting with the CLI.

Full command reference

Every command is documented in the CLI repository. Start from the command index, which links through to each group and on to the individual verbs. The same reference is available offline with man hostinger and hostinger <command> --help.


Last updated: October 21, 2026

Last updated

Was this helpful?