Edgaras profile

Edgaras Benediktavičius

Product designer and web developer

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.

  1. Open Terminal (PowerShell on Windows).
  2. Type ssh-keygen -t ed25519 and press ENTER.
  3. It will say, “Enter file in which to save the key (/Users/yourname/.ssh/id_ed25519):”, press ENTER.
  4. When it says Enter passphrase (empty for no passphrase): press ENTER.
  5. When it says, Enter same passphrase again: press ENTER.
  6. You will need this file when creating VPS server: Your public key has been saved in ... id_ed25519.pub.
  7. The file named id_ed25519 without .pub is your private key and should be always kept private!

2. Get a VPS server

  1. Sign up Hetzner account.
  2. Log in to Hetzner Cloud.
  3. Click + New Project, give it a name and go to this new project.
  4. Click Add Server.
  5. Choose Location (the closest will be default).
  6. Choose Ubuntu image.
  7. Choose cheapest Shared vCPU for now.
  8. In Networking section, keep Public IPv4, but deselect Public IPv6.
  9. In SSH Keys section upload your public SSH key, the id_ed25519.pub file from previous step.
  10. Create volume (e.g. 10GB, least possible).
  11. Click Create & Buy now to launch your cloud server.