How to Connect a Hetzner Cloud Server to Local IDE via SSH
This guide covers how to gather your server details from the Hetzner Cloud Console, configure secure SSH keys, resolve common authentication pitfalls, and set up remote project development inside Antigravity IDE.
1. Gathering Server Information from Hetzner
Before connecting, retrieve the following details from your Hetzner Cloud Console:
| Information | Where to Find in Hetzner Console | Example Value |
| Server Name | Project Dashboard $\rightarrow$ Servers list | my-cloud-server |
| IPv4 Address | Server details header next to the server name | 203.0.113.10 |
| Operating System | Server details overview panel | Ubuntu 24.04 LTS |
| SSH Port | Default is always 22 (unless custom configured) | 22 |
| Default User | Standard administrative user for cloud servers | root |
NOTE
Account Password vs. Server Password:
The password used to log into the Hetzner web dashboard is not your server's root password. When a server is created without an SSH key, Hetzner sends a separate, randomly generated root password via email.
2. Preparing SSH Authentication (Recommended Practice)
Modern cloud operating systems (such as Ubuntu 24.04 LTS) disable password logins for root over SSH by default (PermitRootLogin prohibit-password). Relying on password authentication frequently triggers Permission denied (publickey,password).
Using an ED25519 SSH Key Pair provides seamless, passwordless, and significantly more secure access.
Step A: Verify or Generate Local SSH Keys (Windows)
Open PowerShell on your local machine:
To display your public key:
Step B: Add Your SSH Key to Hetzner Cloud Console
- In the Hetzner Cloud Console, navigate to Security in the left sidebar $\rightarrow$ SSH Keys.
- Click Add SSH Key.
- Paste the contents of your id_ed25519.pub file.
- Give it a descriptive name (e.g., MyWorkstation) and save.
3. Injecting the SSH Key Without Data Loss (Rescue Mode)
If your server was originally created without an SSH key and password login is blocked, you can inject your key safely into your disk without deleting any existing files or databases:
- In the server dashboard, click the Rescue tab.
- Select linux64 and choose your SSH Key (MyWorkstation) from the dropdown.
- Click Enable rescue & power cycle.
- Once rebooted into the temporary rescue environment, open your local terminal and connect.
- Mount your server's primary disk partition and copy the authorized keys:
- The server will reboot back into your normal operating system with your SSH key permanently installed.
4. Configuring SSH in Antigravity IDE
Step A: Configure Your Local SSH Host Alias
Open or create your local SSH configuration file:
Windows Path: C:\Users\<YourUser>\.ssh\config
Add the following configuration block:
TIP
With this configuration, running ssh hetzner-server in PowerShell connects automatically without needing to remember IP addresses or key locations.
Step B: Install the Remote - SSH Extension in Antigravity
- In Antigravity IDE, press Ctrl + Shift + X to open the Extensions view.
- Search for Remote - SSH (by Microsoft).
- Click Install.
Step C: Connect and Open Your Website Project
- Press F1 or Ctrl + Shift + P to open the Command Palette.
- Type and select: Remote-SSH: Connect to Host...
- Select hetzner-server (from your .ssh/config).
- A new Antigravity IDE window will open and connect to your remote server.
- In the new window, click File $\rightarrow$ Open Folder...
- Type the path to your project (e.g., /var/www/my-website) and click OK.
5. Developing & Managing Your Site in Antigravity
Once your remote project directory is open inside Antigravity:
- AI Pair Programming: The Antigravity agent can browse, inspect, refactor, and edit files directly across your remote repository.
- Integrated Remote Terminal: Press Ctrl + ` to open a shell session running directly on the server.
- Reloading Application Daemons: After modifying code or configuration files, reload your web/application services
6. Troubleshooting Common Pitfalls
1. Connection timed out on Port 22 (Fail2ban)
- Cause: Repeated failed password attempts trigger automated intrusion prevention (fail2ban), temporarily blocking your IP via firewall rules.
- Solution: Wait 10 minutes for the ban to expire, or access the Hetzner Web Console (>_ Console) and run:
2. WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED
Cause: Switching between the temporary Rescue RAM system and the primary operating system changes the server's SSH host key fingerprint.
Solution: Clear the old cached host fingerprint on your local machine
3. Special Characters Mangled in Hetzner Web VNC Console
- Cause: Browser-based VNC streams transmit graphical scancodes rather than text, often dropping Shift combinations (&& becomes 77, > becomes ., ~ becomes `).
- Solution: Avoid typing complex keys or base64 strings in the Web Console. Use Hetzner Rescue Mode with an attached SSH key for safe configuration.
4. Reverse Proxy Error 521 ("Web server is down")
- Cause: While a server is rebooting or in Rescue Mode, web server daemons (Nginx, Gunicorn, Docker) are offline.
- Solution: Once the server reboots back into the normal OS, confirm services are active.