Skip to main content

Official Hetzner Cloud python library

Project description

Hetzner Cloud Python

Official Hetzner Cloud python library.

The library's documentation is available at, the public API documentation is available at


Install the hcloud library:

pip install hcloud

For more installation details, please see the installation docs.

Here is an example that creates a server and list them:

from hcloud import Client
from hcloud.images import Image
from hcloud.server_types import ServerType

client = Client(token="{YOUR_API_TOKEN}")  # Please paste your API token here

# Create a server named my-server
response = client.servers.create(
server = response.server
print(f"{} {} {server.status=}")
print(f"root password: {response.root_password}")

# List your servers
servers = client.servers.get_all()
for server in servers:
    print(f"{} {} {server.status=}")

For more details, please see the API reference.

You can find some more examples under the examples/ directory.

Supported Python versions

We support python versions until end-of-life.


First, create a virtual environment and activate it:

make venv
source venv/bin/activate

You may setup pre-commit to run before you commit changes, this removes the need to run it manually afterwards:

pre-commit install

You can then run different tasks defined in the Makefile, below are the most important ones:

Build the documentation and open it in your browser:

make docs

Lint the code:

make lint

Run tests using the current python3 version:

make test

You may also run the tests for multiple python3 versions using tox:

tox .


The MIT License (MIT). Please see License File for more information.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hcloud-1.35.0.tar.gz (116.3 kB view hashes)

Uploaded Source

Built Distribution

hcloud-1.35.0-py3-none-any.whl (85.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page