Claude Code That Never Sleeps

DevOps is a pain in the ass. So I built a free Claude Code plugin to deploy your own personal dev server on Hetzner for ~$5/month. SSH in from anywhere, on any device.

Born from a tweet and too many hours tinkering

terminal

Why I Built This

The Hard Way

Configure UFW firewall rules

Set up fail2ban jails

Harden SSH configuration

Disable root login

Set up key-only authentication

Install and configure dependencies

Enable automatic security updates

Hope you didn't miss anything

The Easy Way

One command

Under 5 minutes

Claude Code pre-installed

Ready to code

What This Plugin Does

A simple Claude Code plugin to help you set up your own server. No DevOps experience required.

Security Hardening
UFW firewall blocks all traffic except SSH. fail2ban bans attackers after 5 failed attempts. SSH allows key-only authentication with root disabled.
Cost Transparency
See exactly what you'll pay before provisioning. Starting at €3.79/month (~$4 USD). Hourly billing means you only pay for what you use.
Claude Code Pre-installed
SSH in and run 'claude'. That's it. No installation, no configuration, no PATH issues. Just start coding.
One Command Deploy
Run /provision my-server and you're done. Server creation, security hardening, and tool installation all automated.
GitHub Ready
Set up GitHub CLI and SSH keys in minutes. Push code, create PRs, and integrate with Vercel for automatic deployments.
Production Capable
Open ports for web apps, set up Caddy for automatic HTTPS, and run production workloads with pm2 process management.

Complete Setup Guide

Install the free Claude Code plugin and deploy your own VPS in under 10 minutes. Includes automated firewall, fail2ban, and SSH key configuration.

Prerequisites

Before you begin, make sure you have:

  • Claude Max subscription – Required to use Claude Code
  • Claude Code installed – The CLI tool (install from claude.ai/download)
  • Credit/debit card – Hetzner requires payment info (starting at ~$5/month)
  • Basic terminal knowledge – Ability to run commands in Terminal/Command Prompt
  • 10 minutes – That's all it takes from start to finish

What You'll Accomplish

By the end of this tutorial, you'll have:

  • A running VPS (Virtual Private Server) on Hetzner Cloud
  • Production-ready security (UFW firewall, fail2ban, SSH keys only)
  • Claude Code pre-installed and ready to use
  • A 24/7 development environment accessible from anywhere
  • Total cost: ~$5/month + your existing Claude Max subscription
1

Create a Hetzner Account

Hetzner Cloud offers some of the best price-to-performance ratios in the industry. Their servers are reliable, fast, and incredibly affordable.

  1. Go to console.hetzner.cloud
  2. Click "Register" in the top right
  3. Enter your email and create a password
  4. Verify your email address
  5. Add payment information (you won't be charged until you provision a server)

Why Hetzner? European data centers with excellent connectivity, transparent pricing, and servers starting under $5/month.

2

Create a Project

Projects help you organize your resources. You might have separate projects for development, staging, and production.

  1. Once logged in, click "+ New Project"
  2. Name it something like "claude-servers" or "dev-environment"
  3. Click "Add project"
  4. Click into your new project to open it

All your servers, SSH keys, and other resources will live inside this project.

3

Generate an API Token

The API token lets the hcloud CLI manage your servers. Keep it secret—anyone with this token can create or destroy your servers.

  1. In your project, go to Security → API Tokens
  2. Click "Generate API Token"
  3. Name it "claude-code-cli" (or whatever you prefer)
  4. Select "Read & Write" permissions
  5. Click "Generate API Token"
  6. IMPORTANT: Copy the token immediately. You won't be able to see it again!

Store this token somewhere safe. You'll need it in the next step.

4

Install the hcloud CLI

The hcloud CLI is how you'll interact with Hetzner's API. It's fast, well-documented, and makes server management a breeze.

macOS:

bash
brew install hcloud

Linux:

bash
curl -fsSL https://github.com/hetznercloud/cli/releases/latest/download/hcloud-linux-amd64.tar.gz | tar xz
sudo mv hcloud /usr/local/bin/

Windows:

Download from: github.com/hetznercloud/cli/releases
Then add to your PATH

5

Configure Authentication

When prompted, paste the API token you copied in Step 3.

bash
hcloud context create claude-servers

Verify it works:

bash
hcloud server list

You should see an empty list (no errors). If you get "unauthorized", double-check your token.

6

Check Your SSH Key

SSH keys are how you'll securely connect to your server. No passwords—just cryptographic keys.

Check if you already have one:

bash
ls ~/.ssh/id_ed25519.pub || ls ~/.ssh/id_rsa.pub

If you see a file path, you're good. If not, generate a new key:

bash
ssh-keygen -t ed25519 -C "your@email.com"

Press Enter to accept the default location. You can add a passphrase for extra security or leave it empty.

7

Install the Plugin

This is the easy part. Open Claude Code in your terminal and install the plugin from the marketplace:

bash
claude

Once Claude Code is running, type:

bash
/plugin marketplace add The-Resonance/claude-code-hetzner-vps

Then install it:

bash
/plugin install claude-code-hetzner-vps

That's it! The plugin is now active and you can use the /provision, /status, /destroy, and /cost-estimate commands.

8

Provision Your Server

Inside Claude Code, check the cost first:

bash
/cost-estimate cx22

You'll see:

text
  Type: cx22
  Specs: 2 vCPU (shared), 4 GB RAM, 40 GB NVMe
  Monthly: €4.49 (~$4.85 USD)
  Hourly: ~€0.0061/hour

Now provision (still inside Claude Code):

bash
/provision my-dev-server cx22 nbg1

The plugin automatically creates the server, configures UFW firewall, installs fail2ban, hardens SSH, disables root login, and installs Claude Code. The entire process takes under 5 minutes.

You'll see the server IP address when provisioning completes.

9

Connect via SSH

IMPORTANT: Wait about 2 minutes after provisioning. The server needs time to run cloud-init, which installs all the security tools and Claude Code.

Then connect:

bash
ssh claude@YOUR_SERVER_IP

Replace YOUR_SERVER_IP with the IP address from the previous step.

You'll see a welcome message confirming all security features are active:

text
══════════════════════════════════════════════════════════════
  Server provisioned by claude-code-hetzner-vps
  A free tool by Pete Sena
  https://labs.theresonance.studio

  Security features enabled:
    ✓ UFW firewall (port 22 only)
    ✓ fail2ban intrusion prevention
    ✓ SSH key-only authentication
    ✓ Root login disabled
    ✓ Automatic security updates

  Claude Code is ready. Run: claude
══════════════════════════════════════════════════════════════
10

Start Using Claude Code

bash
claude

That's it. You're now running Claude Code on your own secure VPS.

You can now:

  • Work on long-running tasks without tying up your laptop
  • Run multiple projects in parallel
  • Keep your development environment consistent
  • Access your dev server from anywhere

Need Help?

If you run into any issues, check the GitHub repository for troubleshooting tips or open an issue.

Set Up GitHub for Deployments

Install GitHub CLI
bash
sudo apt install gh -y
Authenticate
bash
gh auth login

Select:

  • GitHub.com
  • HTTPS
  • Yes (authenticate with browser)
  • Login with a one-time code
Set Up SSH Key for Git

# Generate a key for this server

bash
ssh-keygen -t ed25519 -C "my-hetzner-server"

IMPORTANT: Add the required scope first

bash
gh auth refresh -h github.com -s admin:public_key

# Add the key to your GitHub account

bash
gh ssh-key add ~/.ssh/id_ed25519.pub --title "hetzner-dev-server"

# Test the connection

bash
ssh -T git@github.com

You should see:

text
Hi username! You've successfully authenticated, but GitHub does not provide shell access.
Clone and Work
bash
git clone git@github.com:username/your-repo.git
cd your-repo
claude

Now you can commit, push, and create PRs. If your repo is connected to Vercel, pushes trigger automatic deployments.

Deploy Web Applications

Choose your deployment mode

Development Mode
Quick access for testing and development

# Open port 3000

bash
sudo ufw allow 3000/tcp

# Run Next.js bound to all interfaces

bash
npm run dev -- -H 0.0.0.0

Access at: http://YOUR_SERVER_IP:3000

Common Issues & Fixes

Things we learned the hard way so you don't have to

cx22 not available in US locations

Cause:

Shared CPU types are limited to European data centers

Solution:

Use nbg1 (Nuremberg), fsn1 (Falkenstein), or hel1 (Helsinki)

SSH Permission denied (publickey)

Cause:

Running SSH from the wrong machine

Solution:

Run the ssh command from your LOCAL computer, not from another server

gh ssh-key add returns 404 error

Cause:

Missing admin:public_key API scope

Solution:

Run: gh auth refresh -h github.com -s admin:public_key

gh auth refresh -h github.com -s admin:public_key
Can't access web app in browser

Cause:

Firewall blocking the port

Solution:

Run: sudo ufw allow 3000/tcp (or 80/443 for production)

sudo ufw allow 3000/tcp
Next.js only accessible on localhost

Cause:

Dev server bound to 127.0.0.1 by default

Solution:

Run: npm run dev -- -H 0.0.0.0

npm run dev -- -H 0.0.0.0
'claude' command not found

Cause:

Cloud-init still running

Solution:

Wait 2 minutes after provisioning. Check status: sudo cloud-init status

sudo cloud-init status

Frequently Asked Questions

Everything you need to know before getting started