Get a Hetzner Cloud API key
Make a Hetzner Cloud account, a separate project and a read & write API key, so the LibrePortal app can create your own encrypted server for you.
On this page
The LibrePortal app can create a server at Hetzner for you, encrypt it and install LibrePortal on it. To do that, it needs an API key from your Hetzner account: a long password that lets an app do what you would otherwise click on Hetzner's website.
This guide takes about ten minutes. Hetzner changes its website now and then, so a button may have moved a little, but the steps stay the same.
What it costs#
Hetzner Cloud charges by the hour, and stops charging the moment a server is deleted. A small server costs about a penny or two an hour, so trying things out costs very little. There is no monthly fee for the account itself. Check Hetzner's price list for current prices.
1. Make an account#
- Go to console.hetzner.cloud and choose Register.
- Enter your email address and a strong password, then confirm your email.
- Add your address and a payment method (card or PayPal).
- Hetzner sometimes asks for a photo of your ID before your account is opened. That is normal for them and usually takes a few minutes, occasionally a day.
Tip: turn on two-step sign-in for your Hetzner account (under your account settings). Anyone who gets into this account can create and delete servers.
2. Make a separate project#
A project is a folder for servers. Keeping LibrePortal's servers in their own project means the key can never touch anything else you have at Hetzner.
- In the Cloud Console, choose + New project.
- Give it a name, for example LibrePortal. If you are only trying things out, call it LibrePortal tests.
- Choose Add project, then open it.
3. Create the API key#
- Inside the project, open Security in the menu on the left.
- Choose the API tokens tab.
- Choose Generate API token.
- Description: something you will recognise, for example LibrePortal app.
- Permissions: choose Read & Write. The app needs Write to create, encrypt and delete servers. A Read-only key will not work.
- Choose Generate API token.
- Copy the key now. Hetzner shows it only once. If you lose it, delete it and make a new one.
4. Give it to LibrePortal#
Paste the key where the app asks for it, under + New server, then Hetzner.
- The app uses the key only while it sets up your server, then forgets it.
- The key only works inside the project you made, so your other Hetzner servers, if you have any, are out of its reach.
Keeping it safe#
- Treat the key like a password: never post it, email it or paste it into a chat.
- If you think someone else has seen it, go back to Security → API tokens and delete it. It stops working at once. Make a new one if you need it again.
- When you are finished with LibrePortal at Hetzner, delete the key, and delete the project if it is empty.
Something went wrong?#
- "Unauthorized" or "invalid token": the key was copied with a missing character, or it was deleted. Make a new one.
- "Forbidden": the key is Read-only. Make a new one with Read & Write.
- "Limit reached": new Hetzner accounts can only run a few servers at first. Delete servers you no longer need, or ask Hetzner to raise the limit (Account → Limits).