Deploy simple Node.js website or app on VPS (Hetzner)
The article is a work in progress π§
1. Generate SSH keys
Generating SSH key is recommended and it will be used to log in to your VPS automatically without password.
- Open Terminal (PowerShell on Windows).
- Type
ssh-keygen -t ed25519
and press ENTER. - It will say, βEnter file in which to save the key (/Users/yourname/.ssh/id_ed25519):β, press
ENTER
. - When it says
Enter passphrase (empty for no passphrase):
press ENTER. - When it says,
Enter same passphrase again:
press ENTER. - You will need this file when creating VPS server:
Your public key has been saved in
...id_ed25519.pub
. - The file named
id_ed25519
without.pub
is your private key and should be always kept private!
2. Get a VPS server
- Sign up Hetzner account.
- Log in to Hetzner Cloud.
- Click + New Project, give it a name and go to this new project.
- Click Add Server.
- Choose Location (the closest will be default).
- Choose Ubuntu image.
- Choose cheapest Shared vCPU for now.
- In Networking section, keep Public IPv4, but deselect Public IPv6.
- In SSH Keys section upload your public SSH key, the
id_ed25519.pub
file from previous step. - Create volume (e.g. 10GB, least possible).
- Click Create & Buy now to launch your cloud server.