Django Hetzner Hosting

How to Connect a Hetzner Cloud Server to Local IDE via SSH

Posted: September 23, 2026 | Updated: September 23, 2026
Share: Twitter LinkedIn

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:


InformationWhere to Find in Hetzner ConsoleExample Value
Server NameProject Dashboard $\rightarrow$ Servers listmy-cloud-server
IPv4 AddressServer details header next to the server name203.0.113.10
Operating SystemServer details overview panelUbuntu 24.04 LTS
SSH PortDefault is always 22 (unless custom configured)22
Default UserStandard administrative user for cloud serversroot

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:

# Check if you already have an ED25519 key pair
Get-ChildItem $env:USERPROFILE\.ssh\id_ed25519*

# If not present, generate a new key pair:
ssh-keygen -t ed25519 -C "[email protected]"

To display your public key:

Get-Content $env:USERPROFILE\.ssh\id_ed25519.pub

Step B: Add Your SSH Key to Hetzner Cloud Console

  1. In the Hetzner Cloud Console, navigate to Security in the left sidebar $\rightarrow$ SSH Keys.
  2. Click Add SSH Key.
  3. Paste the contents of your id_ed25519.pub file.
  4. 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:


  1. In the server dashboard, click the Rescue tab.
  2. Select linux64 and choose your SSH Key (MyWorkstation) from the dropdown.
  3. Click Enable rescue & power cycle.
  4. Once rebooted into the temporary rescue environment, open your local terminal and connect.
ssh -o StrictHostKeyChecking=no root@<YOUR_SERVER_IP>

  1. Mount your server's primary disk partition and copy the authorized keys:
mount /dev/sda1 /mnt
cat /root/.ssh/authorized_keys >> /mnt/root/.ssh/authorized_keys
sort -u /mnt/root/.ssh/authorized_keys -o /mnt/root/.ssh/authorized_keys
chmod 600 /mnt/root/.ssh/authorized_keys
chmod 700 /mnt/root/.ssh
umount /mnt
reboot

  1. 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:

Host hetzner-server
HostName <YOUR_SERVER_IP>
User root
IdentityFile ~/.ssh/id_ed25519

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

  1. In Antigravity IDE, press Ctrl + Shift + X to open the Extensions view.
  2. Search for Remote - SSH (by Microsoft).
  3. Click Install.


Step C: Connect and Open Your Website Project

  1. Press F1 or Ctrl + Shift + P to open the Command Palette.
  2. Type and select: Remote-SSH: Connect to Host...
  3. Select hetzner-server (from your .ssh/config).
  4. A new Antigravity IDE window will open and connect to your remote server.
  5. In the new window, click File $\rightarrow$ Open Folder...
  6. 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:


  1. AI Pair Programming: The Antigravity agent can browse, inspect, refactor, and edit files directly across your remote repository.
  2. Integrated Remote Terminal: Press Ctrl + ` to open a shell session running directly on the server.
  3. Reloading Application Daemons: After modifying code or configuration files, reload your web/application services
# Check service status
systemctl status gunicorn

# Restart application daemon
systemctl restart gunicorn

# Reload reverse proxy
systemctl reload nginx

6. Troubleshooting Common Pitfalls

1. Connection timed out on Port 22 (Fail2ban)

  1. Cause: Repeated failed password attempts trigger automated intrusion prevention (fail2ban), temporarily blocking your IP via firewall rules.
  2. Solution: Wait 10 minutes for the ban to expire, or access the Hetzner Web Console (>_ Console) and run:
fail2ban-client unban <YOUR_LOCAL_PUBLIC_IP>

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

ssh-keygen -R <YOUR_SERVER_IP>

3. Special Characters Mangled in Hetzner Web VNC Console

  1. Cause: Browser-based VNC streams transmit graphical scancodes rather than text, often dropping Shift combinations (&& becomes 77, > becomes ., ~ becomes `).
  2. 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")

  1. Cause: While a server is rebooting or in Rescue Mode, web server daemons (Nginx, Gunicorn, Docker) are offline.
  2. Solution: Once the server reboots back into the normal OS, confirm services are active.
systemctl is-active nginx gunicorn