{"id":13702620,"url":"https://github.com/jonamat/hetzner-rescaler","last_synced_at":"2026-01-17T07:38:44.909Z","repository":{"id":64307630,"uuid":"428463897","full_name":"jonamat/hetzner-rescaler","owner":"jonamat","description":"Lightweight CLI tool to programmatically rescale your Hetzner virtual server daily to optimize your budget spending","archived":false,"fork":false,"pushed_at":"2022-02-01T07:07:43.000Z","size":53,"stargazers_count":60,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-30T18:46:34.769Z","etag":null,"topics":["hetzner","hetzner-api","hetzner-cloud","hetzner-robot-api"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonamat.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-16T00:22:31.000Z","updated_at":"2024-12-05T15:29:37.000Z","dependencies_parsed_at":"2023-01-15T11:00:46.909Z","dependency_job_id":null,"html_url":"https://github.com/jonamat/hetzner-rescaler","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/jonamat/hetzner-rescaler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonamat%2Fhetzner-rescaler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonamat%2Fhetzner-rescaler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonamat%2Fhetzner-rescaler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonamat%2Fhetzner-rescaler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonamat","download_url":"https://codeload.github.com/jonamat/hetzner-rescaler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonamat%2Fhetzner-rescaler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28504356,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T06:57:29.758Z","status":"ssl_error","status_checked_at":"2026-01-17T06:56:03.931Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hetzner","hetzner-api","hetzner-cloud","hetzner-robot-api"],"created_at":"2024-08-02T21:00:39.363Z","updated_at":"2026-01-17T07:38:44.885Z","avatar_url":"https://github.com/jonamat.png","language":"Go","funding_links":[],"categories":["Tools"],"sub_categories":["Rust"],"readme":"# Hetzner rescaler\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/jonamat/hetzner-rescaler/releases\"\u003e\n    \u003cimg alt=\"Release\" src=\"https://img.shields.io/github/v/release/jonamat/hetzner-rescaler\" /\u003e\n  \u003c/a\u003e\n  \n  \u003ca href=\"https://hub.docker.com/repository/docker/jonamat/hetzner-rescaler\"\u003e\n    \u003cimg alt=\"Docker Image Size (tag)\" src=\"https://img.shields.io/docker/image-size/jonamat/hetzner-rescaler/latest\" /\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://github.com/jonamat/hetzner-rescaler/blob/master/go.mod\"\u003e\n    \u003cimg alt=\"GitHub go.mod Go version\" src=\"https://img.shields.io/github/go-mod/go-version/jonamat/hetzner-rescaler\" /\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://github.com/jonamat/hetzner-rescaler/actions\"\u003e\n    \u003cimg alt=\"GitHub Workflow Status\" src=\"https://github.com/jonamat/hetzner-rescaler/actions/workflows/push.yml/badge.svg\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nLightweight CLI tool to programmatically rescale your Hetzner virtual server daily to optimize your budget spending, scaling to a cheaper machine when you don't need or need few resources, and scaling to a more performant one when you know the load will be higher.\n\n## Usage \nFirst, you need to generate an [Hetzner API Token](https://docs.hetzner.cloud/#getting-started).\u003cbr\u003e \n\nNext you need to create your configuration file or export the required environment variables for the tool.\u003cbr\u003e\nThe `config` command helps you generate a valid configuration, warning you if there are any logic errors and validating your input.\n```sh\nhetzner-rescaler config\n``` \n\nKeep in mind if env vars are defined, they will take priority.\u003cbr\u003e\nAfter setting the configuration, you can start the tool by running\n```sh\nhetzner-rescaler start\n```\n\n### Use with environmental variables\nExport these env vars to override or completely bypass the generated configuration:\n| Variable           | Description                                                                  |\n| ------------------ | ---------------------------------------------------------------------------- |\n| `HCLOUD_TOKEN`     | A valid [Hetzner API Token](https://docs.hetzner.cloud/#getting-started)\u003cbr\u003e |\n| `SERVER_ID`        | The ID of the target server\u003cbr\u003e                                              |\n| `BASE_SERVER_NAME` | The code of the cheap server type\u003cbr\u003e                                        |\n| `TOP_SERVER_NAME`  | The code of the high performance server type\u003cbr\u003e                             |\n| `HOUR_START`       | 24h format, colon separated hour when the server should be upgraded\u003cbr\u003e      |\n| `HOUR_STOP`        | 24h format, colon separated hour when the server should be downgraded\u003cbr\u003e    |\n| `TZ`               | If defined, change the timezone of the timer\u003cbr\u003e                             |\n\n### Use with Docker\nPull the image from dockerhub\n```sh\ndocker pull jonamat/hetzner-rescaler\n```\n\n**Opt A:** Create a config file inside the container \u0026 start immediately *beta* \n```sh\ndocker run -ti jonamat/hetzner-rescaler hetzner-rescaler plug\n```\n\n**Opt B:** Mounting a configuration file \n```sh\ndocker run -v ~/.hetzner-rescaler.yaml:/.hetzner-rescaler.yaml jonamat/hetzner-rescaler\n```\n\n**Opt C:** Passing config as env vars \n```sh\ndocker run \\\n-e HCLOUD_TOKEN=abc123 \\\n-e SERVER_ID=4567 \\\n-e BASE_SERVER_NAME=cpx11 \\\n-e TOP_SERVER_NAME=cpx21 \\\n-e HOUR_START=09:00 \\\n-e HOUR_STOP=20:00 \\\njonamat/hetzner-rescaler\n```\n\nYou can also pass a partial configuration file and define the missing vars as env vars (useful eg to hide the API key) \n\n### Use with compose/swarm stacks\n```yml\nversion: '3.7'\n\nservices:\n  hetzner-rescaler:\n    image: jonamat/hetzner-rescaler\n\n    // Provide the env vars\n    environment:\n      HCLOUD_TOKEN: abc123\n      SERVER_ID: 4567\n      BASE_SERVER_NAME: cpx11\n      TOP_SERVER_NAME: cpx21\n      HOUR_START: \"09:00\"\n      HOUR_STOP: \"20:00\"\n    \n    // ...or mount the config file\n    volumes:\n      - /var/hetzner/config-file.yaml:/.hetzner-rescaler.yaml\n```\n\n## The configuration file\nThe default path for the config file is `~/.hetzner-rescaler.yaml`.\u003cbr\u003e\nYou can provide (and create) a custom config path passing the `--config /custom/path/config.yml` flag.\u003cbr\u003e\n\nConfig yaml file example\n```yaml\nhcloud_token: abc123\nserver_id: 15393230\nbase_server_name: cx11\ntop_server_name: cx21\nhour_start: \"09:00\"\nhour_stop: \"20:00\"\n```\n\n## Commands\n```\nUsage:\n  hetzner-rescaler [command]\n\nAvailable Commands:\n  config      Create the configuration file\n  help        Help about any command\n  plug        Configure and start immediately\n  start       Start rescale timers\n  try         Try a complete rescale cycle\n\nFlags:\n      --config string   config file (default is $HOME/.hetzner-rescaler.yaml)\n  -h, --help            help for hetzner-rescaler\n\nUse \"hetzner-rescaler [command] --help\" for more information about a command.\n```\n\n## Use cases\nThis tool was developed for a my specific use case: I use an Hetzner server for remote development, using the [Remote SSH extension](https://code.visualstudio.com/docs/remote/ssh) to simplify my cross-device development workflow. This machine also serve some personal services, which require very little resources but cannot be stopped for a long time.\u003cbr\u003e\nIt could be useful for all servers running applications related to a company's opening hours, such as booking, delivery or management software.\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonamat%2Fhetzner-rescaler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonamat%2Fhetzner-rescaler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonamat%2Fhetzner-rescaler/lists"}