# hcloud-upload-image
Quickly upload any raw disk images into your Hetzner Cloud projects!
## About The [Hetzner Cloud API](https://docs.hetzner.cloud/) does not support uploading disk images directly and only provides a limited set of default images. The only option for custom disk images is to take a snapshot of an existing server’s root disk. These snapshots can then be used to create new servers. To create a completely custom disk image, users need to follow these steps: 1. Create a server with the correct server type 2. Enable the rescue system for the server 3. Boot the server 4. Download the disk image from within the rescue system 5. Write the disk image to the server’s root disk 6. Shut down the server 7. Take a snapshot of the server’s root disk 8. Delete the server This is a frustratingly long process. Many users have automated it with [Packer](https://www.packer.io/) and [`packer-plugin-hcloud`](https://github.com/hetznercloud/packer-plugin-hcloud/), but Packer introduces additional complexity that can be difficult to manage. This repository provides a simple CLI tool and Go library to streamline the process. ## Getting Started ### CLI #### Binary We provide pre-built `deb`, `rpm` and `apk` packages. Alternatively we also provide the binaries directly. Check out the [GitHub release artifacts](https://github.com/apricote/hcloud-upload-image/releases/latest) for all of these files and archives. #### Arch Linux You can get [`hcloud-upload-image-bin`](https://aur.archlinux.org/packages/hcloud-upload-image-bin) from the AUR. Use your preferred wrapper to install: ```shell yay -S hcloud-upload-image-bin ``` #### `go install` If you already have a recent Go toolchain installed, you can build & install the binary from source: ```shell go install github.com/apricote/hcloud-upload-image@latest ``` #### Docker There is a docker image published at `ghcr.io/apricote/hcloud-upload-image`. ```shell docker run --rm -e HCLOUD_TOKEN="