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).
ssh-keygen -t ed25519and press ENTER.
- It will say, “Enter file in which to save the key (/Users/yourname/.ssh/id_ed25519):”, press
- 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...
- The file named
.pubis 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.pubfile from previous step.
- Create volume (e.g. 10GB, least possible).
- Click Create & Buy now to launch your cloud server.