> For the complete documentation index, see [llms.txt](https://docs.hostinger.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hostinger.com/api-reference/cli.md).

# Hostinger CLI

[`hostinger`](https://github.com/hostinger/api-cli) is the official command-line client for the Hostinger API. It's generated from the same OpenAPI specification as the [API reference](/api-reference/overview.md), so it tracks the API as endpoints are added.

## Install

On macOS and Linux, install with Homebrew:

```bash
brew install hostinger/tap/hostinger
```

Upgrade later with `brew upgrade hostinger`.

On Windows, or without Homebrew, download the archive for your platform from the [releases page](https://github.com/hostinger/api-cli/releases) and put the `hostinger` binary on your `PATH`. Each archive also bundles the shell completion files.

Confirm the install:

```bash
hostinger version
```

## Authenticate

You don't need to generate a token first. Run any command without one and the CLI opens a browser sign-in, then caches and refreshes those credentials for you.

To authenticate with a token instead — in CI, for example — set `HOSTINGER_API_TOKEN`, or add `api_token` to `$HOME/.hostinger.yaml`:

```yaml
api_token: <your API token>
```

Generate tokens in [hPanel → API](https://hpanel.hostinger.com/api). See [Security & Access](/account/security.md) for how tokens are managed.

> **Note:** A configured token takes precedence over browser sign-in. If commands suddenly fail to authorize, check for a stale `api_token` in your config file or environment before anything else.

## Run commands

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

```bash
hostinger hosting websites list
hostinger dns records list example.com
hostinger vps virtual-machines list
```

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

```bash
hostinger vps --help
hostinger vps firewall --help
```

Shell completion is available for bash, zsh, fish, and PowerShell — Homebrew installs the bash, zsh, and fish ones for you. To set them up manually, see [AUTOCOMPLETE.md](https://github.com/hostinger/api-cli/blob/main/AUTOCOMPLETE.md) in the CLI repository.

## 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

Results print as a table by default. Use `--format json` to pipe them into other tools, or `--format tree` to see nested data as a tree:

```bash
hostinger hosting websites list --format json | jq
```

For exit codes, passing JSON to flags, and the commands worth being careful with, see [Scripting with the CLI](/api-reference/cli-scripting.md).

## Full command reference

Every command is documented in the CLI repository. Start from the [command index](https://github.com/hostinger/api-cli/blob/main/docs/hostinger.md), which links through to each group and on to the individual verbs.

***

*Last updated: August 5, 2026*
