Hostinger
by @rexlunae
Manage Hostinger account via API — VPS administration (start/stop/restart, snapshots, backups, firewall, Docker), DNS zone management, domain portfolio, website hosting, and billing. Use when asked to deploy, publish, manage servers, configure DNS, or control any Hostinger service.
clawhub install hostinger📖 About This Skill
name: hostinger description: Manage Hostinger account via API — VPS administration (start/stop/restart, snapshots, backups, firewall, Docker), DNS zone management, domain portfolio, website hosting, and billing. Use when asked to deploy, publish, manage servers, configure DNS, or control any Hostinger service.
Hostinger API Skill
Control Hostinger services programmatically: VPS instances, DNS records, domains, websites, hosting.
Authentication
API token required. Get one from: https://hpanel.hostinger.com/profile/api
Store in ~/.config/hostinger/token (just the token, no newline):
mkdir -p ~/.config/hostinger
echo -n "YOUR_API_TOKEN" > ~/.config/hostinger/token
chmod 600 ~/.config/hostinger/token
Quick Reference
VPS Operations
# List all VPS instances
python3 scripts/hostinger.py vps listGet VPS details
python3 scripts/hostinger.py vps get Start/stop/restart VPS
python3 scripts/hostinger.py vps start
python3 scripts/hostinger.py vps stop
python3 scripts/hostinger.py vps restart Create/restore snapshots
python3 scripts/hostinger.py vps snapshot-create
python3 scripts/hostinger.py vps snapshot-restore View backups
python3 scripts/hostinger.py vps backups
DNS Management
# Get DNS records for domain
python3 scripts/hostinger.py dns get Update DNS records (JSON file with records array)
python3 scripts/hostinger.py dns update Reset DNS to defaults
python3 scripts/hostinger.py dns reset DNS snapshots
python3 scripts/hostinger.py dns snapshots
python3 scripts/hostinger.py dns snapshot-restore
Domain Portfolio
# List all domains
python3 scripts/hostinger.py domains listGet domain details
python3 scripts/hostinger.py domains get Update nameservers
python3 scripts/hostinger.py domains nameservers ns1.example.com ns2.example.comCheck availability
python3 scripts/hostinger.py domains check example.com example.org
Hosting/Websites
# List websites
python3 scripts/hostinger.py hosting websitesList datacenters
python3 scripts/hostinger.py hosting datacenters
Billing
# View subscriptions
python3 scripts/hostinger.py billing subscriptionsView payment methods
python3 scripts/hostinger.py billing payment-methodsView catalog
python3 scripts/hostinger.py billing catalog
DNS Record Format
When updating DNS records, provide a JSON file:
{
"records": [
{"type": "A", "name": "@", "value": "1.2.3.4", "ttl": 300},
{"type": "A", "name": "www", "value": "1.2.3.4", "ttl": 300},
{"type": "MX", "name": "@", "value": "mail.example.com", "priority": 10, "ttl": 300},
{"type": "TXT", "name": "@", "value": "v=spf1 include:_spf.google.com ~all", "ttl": 300}
]
}
VPS Docker Management
For VPS with Docker OS templates:
# List Docker projects
python3 scripts/hostinger.py docker list Deploy from docker-compose.yml URL
python3 scripts/hostinger.py docker deploy --url Or from local file
python3 scripts/hostinger.py docker deploy --file Start/stop/restart project
python3 scripts/hostinger.py docker start
python3 scripts/hostinger.py docker stop
python3 scripts/hostinger.py docker restart View logs
python3 scripts/hostinger.py docker logs Delete project
python3 scripts/hostinger.py docker down
VPS Firewall
# List firewalls
python3 scripts/hostinger.py firewall listCreate firewall
python3 scripts/hostinger.py firewall create Add rule
python3 scripts/hostinger.py firewall add-rule --protocol tcp --port 443 --source 0.0.0.0/0Activate on VM
python3 scripts/hostinger.py firewall activate
Direct API Access
For operations not covered by the script, use curl:
TOKEN=$(cat ~/.config/hostinger/token)
curl -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
https://developers.hostinger.com/api/vps/v1/virtual-machines
API Documentation
Common Workflows
Deploy a Website
1. Get VPS ID: python3 scripts/hostinger.py vps list
2. Update DNS to point to VPS: python3 scripts/hostinger.py dns update domain.com records.json
3. SSH to VPS and deploy, OR use Docker: python3 scripts/hostinger.py docker deploy
Secure a VPS
1. Create firewall: python3 scripts/hostinger.py firewall create "web-server"
2. Add rules for SSH, HTTP, HTTPS
3. Activate: python3 scripts/hostinger.py firewall activate
Backup Before Changes
1. Create snapshot: python3 scripts/hostinger.py vps snapshot-create
2. Make changes
3. If needed, restore: python3 scripts/hostinger.py vps snapshot-restore