#hetzner #hetzner-cloud


Unofficial Rust crate for accessing the Hetzner Cloud API

16 breaking releases

0.17.0 Oct 22, 2023
0.15.0 Jul 23, 2023
0.13.0 Oct 22, 2022
0.12.0 Jul 15, 2022
0.1.0 Jun 4, 2020

#197 in Web programming

Download history 43/week @ 2023-08-10 93/week @ 2023-08-17 158/week @ 2023-08-24 69/week @ 2023-08-31 94/week @ 2023-09-07 23/week @ 2023-09-14 61/week @ 2023-09-21 370/week @ 2023-09-28 207/week @ 2023-10-05 237/week @ 2023-10-12 72/week @ 2023-10-19 253/week @ 2023-10-26 98/week @ 2023-11-02 81/week @ 2023-11-09 240/week @ 2023-11-16 97/week @ 2023-11-23

544 downloads per month


16K SLoC

hcloud for Rust

Crates.io Documentation Build and test

Unofficial Rust crate for accessing the Hetzner Cloud API


The hcloud crate can be used for managing the endpoints provided by the Hetzner Cloud API in your Rust project.

The API client code of this crate has been auto-generated from the Unofficial OpenAPI Description for the Hetzner Cloud API using OpenAPI Generator.

Current state of development

  • supported API endpoints (complete as of October 2023): actions, certificates, datacenters, firewalls, floating_ips, images, isos, load_balancer_types, load_balancers, locations, networks, placement_groups, pricing, primary_ips, server_types, servers, ssh_keys, volumes
  • asynchronous API functions
  • pagination support
  • documentation and tests are still WIP

Selecting TLS implementation

The underlying TLS implementation for reqwest can be selected using Cargo features:

  • default-tls (enabled by default): Provides TLS support to connect over HTTPS.
  • native-tls: Enables TLS functionality provided by native-tls.
  • native-tls-vendored: Enables the vendored feature of native-tls.
  • rustls-tls: Enables TLS functionality provided by rustls.

(Refer to Optional Features in the reqwest documentation.)

Example for using the TLS functionality provided by rustls:

hcloud = { version = "*", default-features = false, features = ["rustls-tls"] }


A very basic example for listing all existing servers:

use hcloud::apis::configuration::Configuration;
use hcloud::apis::servers_api;

// set up basic configuration using API token
let mut configuration = Configuration::new();
configuration.bearer_access_token =

// get list of all existing servers from servers API
let servers = servers_api::list_servers(&configuration, Default::default())

// handle server data
for server in servers {
   println!("{:?}", server);


Licensed under either of

at your option.


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


~309K SLoC