Controlling Hetzner with CLI
Simple wrapper scripts
- tags
- hetzner
- cloud
- cli
Contents
Install the cli
|
|
Go into your https://console.hetzner.cloud/ and get an API key.
Creating a server
Then create a context for your script to use, for example:
|
|
Then we can see if its in use:
|
|
|
|
List servers:
|
|
|
|
Nothing there! Lets create one. First we need to select an image, and we can see if they have any debian-12 images:
|
|
|
|
Looks good. We can also list out server types using
|
|
And we will chose cx11
which has 1 core
, 2GB of ram
, and 20GB
of storage.
Finally we'll want to add a ssh key
to the server so we can log in.
If you haven't done so already, configure yours into the cloud
console.
You can list them out using
|
|
|
|
So lets do it:
|
|
Lets run this and we get:
|
|
And, in this case, you should be able to log on to the machine using
|
|
Deleting a server
We can remove the server that we created using
|
|
Server 33932970 deleted
Previously
Next