Skip to main content

Hetzner Scripts

Download

Download Hetzner Scripts — zip containing the script and README.

Scripts for managing and checking Hetzner Cloud projects.

Scripts

check-hetzner-project.sh

Check the status and resources of a Hetzner Cloud project.

Usage:

# Using environment variable (recommended)
export HCLOUD_TOKEN=your-api-key
./check-hetzner-project.sh

# Or pass API key as argument
./check-hetzner-project.sh your-api-key

# Or source from project .env file
cd ../../../
source .env
export HCLOUD_TOKEN=$HETZNER_TWENTYCRM_API_KEY
cd scripts/resources/hetzner
./check-hetzner-project.sh

What it does:

  • Lists all servers with status, IPs, and specifications
  • Shows firewall configurations and rules
  • Lists volumes
  • Displays traffic usage statistics
  • Generates a JSON summary saved to hetzner-project-status.json

Output:

  • Console output with color-coded status information
  • JSON file: hetzner-project-status.json with complete project status

Requirements:

  • hcloud CLI installed and in PATH
  • Valid Hetzner Cloud API key (read-only or full access)
  • jq for JSON processing
  • bc for calculations (usually pre-installed)

Example output:

=== Hetzner Cloud Project Status Check ===

Fetching project information...
Found 1 server(s)

=== SERVERS ===
twenty-crm-prod-2 (110355570): running | IP: 49.13.82.194 | Type: cpx31 | Location: fsn1

=== SERVER DETAILS ===
Server: twenty-crm-prod-2 (ID: 110355570)
Status: running
IPv4: 49.13.82.194
...