closedvps
Buy Hetzner Cloud servers with every inbound port closed, reachable only over Tailscale, for Claude Code, Codex or anything else.
Safety scan
A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.
Badge for your README
Markdown
[](/listings/tulayha--closedvps)HTML
<a href="/listings/tulayha--closedvps"><img src="/api/listings/tulayha--closedvps/badge.svg" alt="findsafeskills safety rating" /></a>Install
Install instructions from the README
As written by the repo's author. findsafeskills has not verified these steps.
These steps run a script from the network that findsafeskills does not scan.
curl -fsSL https://closedvps.com/install.sh | sh # macOS, Linux
irm https://closedvps.com/install.ps1 | iex # Windows
closedvps create
The first run asks three things: your Hetzner API token (Hetzner Console, your project, Security, API tokens, **Read & Write**), which it offers to keep in your system's password store; what the server is for (just a server, Claude Code, Codex, or both); and, once you've seen the plan and said yes, a Tailscale auth key (login.tailscale.com/admin/settings/keys, one-off). Everything else is a default it shows in the plan: the first type Hetzner sells you in nbg1, fsn1 or hel1 for up to 10 a month, no backups, and your local user name. A few minutes after the purchase it prints the command to log in, `ssh you@vps`.
The server asks for the tag `tag:closedvps` itself, which works once your tailnet policy has the two changes in [Tailscale access](#tailscale-access). Until then it joins untagged, and ClosedVPS says how to fix that.
It also needs an SSH key on your computer (it offers to run `ssh-keygen` when there's none) and Tailscale running there, so you can reach the server.
`closedvps setup` saves your own answers: what servers are for, locations, types, price caps, backups, your user name and alerts. Its last step is optional and worth it if you buy often: a Tailscale OAuth client, so ClosedVPS makes a one-off key for each server itself and checks your policy before buying.
closedvps setup # save your defaults closedvps types # stock and prices, buys nothing closedvps create -n --show-setup # the plan and the exact first-boot setup, buys nothing closedvps create --name web --claude # another server, with Claude Code on it closedvps create --name agents --claude --codex # with Claude Code and Codex closedvps create --count 10 --type cx23:6 # ten servers at up to 6 a month each CLOUDFLARE_TUNNEL_TOKEN=... closedvps create # with a Cloudflare Tunnel for public sites closedvps list # what you have, what it costs, what can reach it closedvps delete vps # gone, with its firewall
Any saved answer can be overridden for one run with a flag (`--location`, `--type`, `--max-price`, `--max-total`, `--backups`, `--claude`, `--codex`); `closedvps create --help` lists them. Claude Code and Codex need 4 GB, so with either ClosedVPS only buys types with 4 GB or more.
`closedvps upgrade` replaces it with the newest release, checked against the release's checksums the way the install scripts check it. Once a day at most, a command you run in a terminal asks closedvps.com whether a newer release is out and says so when it ends. The site counts each ask by version, operating system and country, and keeps nothing else. Runs with `--json` or `--yes` never ask, and `CLOSEDVPS_NO_UPDATE_CHECK=1` turns it off. In Docker, pull the image again.
What was scanned
The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.
.claude-plugin/marketplace.json · Manifest · 14 lines
- {
- "name": "closedvps",
- "description": "Buy Hetzner Cloud servers with every inbound port closed, reachable only over Tailscale, for Claude Code, Codex or anything else.",
- "owner": { "name": "Talha Amjad", "url": "https://github.com/tulayha" },
- "plugins": [
- {
- "name": "closedvps",
- "source": "./",
- "description": "Buy Hetzner Cloud servers with every inbound port closed, waiting and retrying while Hetzner is sold out.",
- "category": "devops",
- "keywords": ["hetzner", "vps", "tailscale", "firewall", "claude-code", "codex", "remote-dev"]
- }
- ]
- }
README.md · README · 272 lines · 2 findings marked
- # ClosedVPS
- [](https://github.com/tulayha/closedvps/actions/workflows/ci.yml)
- [](https://github.com/tulayha/closedvps/releases/latest)
- [](go.mod)
- [](LICENSE)
- ClosedVPS buys Hetzner Cloud servers with a firewall that lets nothing in, and you SSH in over Tailscale. When
- Hetzner is sold out it keeps trying, up to the prices you set, and tells you when it has them. It's a single
- command that runs on your laptop or any machine that stays on, with no account and no server of ours involved.
- ## Quick start
- ```sh
- curl -fsSL https://closedvps.com/install.sh | sh # macOS, Linux
- Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
- Line 15 on GitHub
- ```
- ```powershell
- irm https://closedvps.com/install.ps1 | iex # Windows
- Note: Runs a downloaded PowerShell script (iex / Invoke-Expression)
- Line 19 on GitHub
- ```
- ```sh
- closedvps create
- ```
- The first run asks three things: your Hetzner API token (Hetzner Console, your project, Security, API tokens,
- **Read & Write**), which it offers to keep in your system's password store; what the server is for (just a
- server, Claude Code, Codex, or both); and, once you've seen the plan and said yes, a Tailscale auth key
- (login.tailscale.com/admin/settings/keys, one-off). Everything else is a default it shows in the plan: the
- first type Hetzner sells you in nbg1, fsn1 or hel1 for up to 10 a month, no backups, and your local user
- name. A few minutes after the purchase it prints the command to log in, `ssh you@vps`.
- The server asks for the tag `tag:closedvps` itself, which works once your tailnet policy has the two changes
- in [Tailscale access](#tailscale-access). Until then it joins untagged, and ClosedVPS says how to fix that.
- It also needs an SSH key on your computer (it offers to run `ssh-keygen` when there's none) and Tailscale
- running there, so you can reach the server.
- `closedvps setup` saves your own answers: what servers are for, locations, types, price caps, backups, your
- user name and alerts. Its last step is optional and worth it if you buy often: a Tailscale OAuth client, so
- ClosedVPS makes a one-off key for each server itself and checks your policy before buying.
- ```sh
- closedvps setup # save your defaults
- closedvps types # stock and prices, buys nothing
- closedvps create -n --show-setup # the plan and the exact first-boot setup, buys nothing
- closedvps create --name web --claude # another server, with Claude Code on it
- closedvps create --name agents --claude --codex # with Claude Code and Codex
- closedvps create --count 10 --type cx23:6 # ten servers at up to 6 a month each
- CLOUDFLARE_TUNNEL_TOKEN=... closedvps create # with a Cloudflare Tunnel for public sites
- closedvps list # what you have, what it costs, what can reach it
- closedvps delete vps # gone, with its firewall
- ```
- Any saved answer can be overridden for one run with a flag (`--location`, `--type`, `--max-price`,
- `--max-total`, `--backups`, `--claude`, `--codex`); `closedvps create --help` lists them. Claude Code and
- Codex need 4 GB, so with either ClosedVPS only buys types with 4 GB or more.
- `closedvps upgrade` replaces it with the newest release, checked against the release's checksums the way the
- install scripts check it. Once a day at most, a command you run in a terminal asks closedvps.com whether a
- newer release is out and says so when it ends. The site counts each ask by version, operating system and
- country, and keeps nothing else. Runs with `--json` or `--yes` never ask, and `CLOSEDVPS_NO_UPDATE_CHECK=1`
- turns it off. In Docker, pull the image again.
- ## Prices and several servers
- Every price is per month before VAT, with the IPv4 address included (and backups, when on), in your Hetzner account's
- currency. `--max-price` caps each server. A type can carry its own cap in the list, so `--type cx23:6,cx33:12`
- tries cx23 at up to 6 and then cx33 at up to 12. `--max-total` caps all the servers ClosedVPS made in that
- Hetzner project together, counting the ones already there, and it's checked before every purchase. Prices are
- read again on every check, so a price rise while it waits can't push a purchase over a cap.
- `--count 10` buys ten servers named vps-1 to vps-10, each with its own firewall. Each check it buys as many as
- are in stock and keeps waiting for the rest. A pasted Tailscale key has to be reusable, or only the first
- server joins your tailnet; with a saved OAuth client each server gets its own one-off key. Hetzner limits how many servers an account can have; reaching that stops the run, and the
- servers already bought stay.
- ## Waiting for stock
- Since June 2026 Hetzner often shows the cheaper types as unavailable, and it blocks new accounts and some
- existing ones, chosen at random, from creating servers. Every minute ClosedVPS asks Hetzner which of your
- candidates are in stock and tries them in order. A refusal that waiting can fix means another round. One it
- can't fix, such as a bad token or a full account limit, stops it with Hetzner's own message.
- It keeps the computer from sleeping on idle while it waits, but closing a laptop lid still sleeps it. For waits
- longer than a laptop stays open, run it on a machine that stays on (below).
- `closedvps types` shows Hetzner's in-stock flag, which is the same for everyone. Your account can still be
- refused, and only trying tells.
- ## Alerts
- When it buys a server, when the server answers SSH, and when it stops without buying, this computer shows a
- notification with a sound. That's all, unless you give it links to send the same alerts to:
- | Where | What you give it |
- | --- | --- |
- | ntfy app | `ntfy` in `closedvps setup` makes a private topic, or `https://ntfy.sh/<topic>` |
- | Discord | a channel webhook link (channel settings, Integrations, Webhooks) |
- | Slack | an incoming webhook link |
- | Telegram | `telegram` in `closedvps setup` connects a bot you make with @BotFather |
- | Anything else | any https link, which gets each alert as JSON |
- `closedvps setup` saves them in your system's password store and sends a test message. `CLOSEDVPS_NOTIFY`
- sets them for one run, and `--notify none` turns them off. `--notify <links>` works too, but leaves the links
- in your shell history. The "ready"
- alert comes from the new server itself once it's on your tailnet, so it arrives even when the machine running
- ClosedVPS has no Tailscale.
- ## Running it on a machine that stays on
- `create --yes` runs without a terminal. Give it the secrets as environment variables, and the SSH public key
- as `CLOSEDVPS_SSH_KEY` where there's no key file.
- ```sh
- docker run -d --restart on-failure:3 --name closedvps \
- -e HCLOUD_TOKEN -e TS_OAUTH_CLIENT_ID -e TS_OAUTH_CLIENT_SECRET -e CLOSEDVPS_NOTIFY \
- -e CLOSEDVPS_SSH_KEY="$(cat ~/.ssh/id_ed25519.pub)" \
- ghcr.io/tulayha/closedvps create --yes --user you --type cx23:6
- docker logs -f closedvps
- ```
- A wait can take days, which a pasted `TS_AUTHKEY` may not outlast, so an OAuth client (as above, or saved
- with `closedvps setup` where the machine has a password store) is the better fit here: the key is made at the
- moment of buying. Without a terminal a taken name stops the run, so a restart after a purchase can't buy a
- second server. On a Linux machine without Docker, `systemd-run` keeps it going in the background (with
- `loginctl enable-linger` it also outlives your login):
- ```sh
- systemd-run --user --unit=closedvps -E HCLOUD_TOKEN -E TS_AUTHKEY closedvps create --yes --type cx23:6
- journalctl --user -u closedvps -f
- ```
- The exit code says how it ended, and 3 always means a server is billing; `closedvps create --help` lists the
- codes. `--json` prints one event per line on stdout and moves the text to stderr, for scripts and agents. The
- [skill](skills/closedvps/references/events.md) describes the events.
- ## What it creates
- In your Hetzner project it adds your SSH public key if Hetzner doesn't have it yet, which also stops Hetzner
- from emailing a root password. It creates a firewall named `closedvps-<name>` with no rules, which Hetzner
- treats as "drop all inbound, allow all outbound", and then the server with that firewall attached in the same
- API call. The server is labelled `managed-by=closedvps`, and backups are switched on right after if you chose
- them.
- On first boot, cloud-init on the server:
- - creates your user with your SSH key and passwordless sudo, and limits SSH to keys, to that user, and to no
- root login;
- - lets only root reach Hetzner's metadata service, which keeps serving this setup and its secrets for the
- server's life, so other users and Docker containers can't read them;
- - installs all updates and turns on unattended upgrades, which reboot the server at 04:00 UTC when an update
- needs it;
- - joins your tailnet under the server's name, after that first reboot if the kernel was updated;
- - sets Docker, should you install it later, to publish container ports on 127.0.0.1, on Compose networks too;
- - with `CLOUDFLARE_TUNNEL_TOKEN`, installs cloudflared from Cloudflare's apt repository and runs your tunnel;
- - with `--claude`, installs Claude Code for your user, plus what its sandbox needs. Run `claude` on the
- server to log in.
- - with `--codex`, installs OpenAI's Codex CLI for your user, plus the same sandbox pieces. Run
- `codex login --device-auth` on the server to log in from your laptop's browser, after turning on device
- code login in ChatGPT's security settings.
- ## Public websites
- Create a tunnel in the Cloudflare dashboard (Networking, Tunnels, Create a tunnel), copy the token from the
- install command it shows, and pass it as `CLOUDFLARE_TUNNEL_TOKEN`. Then on the tunnel's Routes tab add a
- published application with the service URL `http://127.0.0.1:<port>`. The tunnel connects outward, so the
- firewall stays closed.
- ## Security model
- Nothing on the internet can reach the server. The Hetzner firewall drops every inbound packet, ping
- included, before it gets there, and `closedvps list` shows whether each server's firewalls still let nothing
- in.
- These stay as they are, and you should know them:
- - The Hetzner token can do anything in its project. ClosedVPS sends it only to `api.hetzner.cloud`. If you let
- it save the token, it goes in the macOS Keychain, Windows Credential Manager or the Linux Secret Service, or
- where none exists, a file only you can read in the ClosedVPS config folder. `closedvps forget` deletes it,
- the alert links and the Tailscale OAuth client.
- A separate Hetzner project for these servers keeps the token away from anything else.
- - The Tailscale auth key, the tunnel token and the alert links reach the server in its cloud-init data.
- Hetzner keeps that for the server's life in its metadata service, which only root on the server can reach.
- A one-off auth key is spent once the server joins; a reusable one for `--count` should expire within a day.
- cloudflared needs the tunnel token on the server anyway.
- - A server that joins untagged can open connections to every device on your tailnet and drops off it after
- 180 days. Each server asks for `tag:closedvps`, which your policy allows once it has the changes in
- [Tailscale access](#tailscale-access), and ClosedVPS warns when a new server has no tag.
- - A saved Tailscale OAuth client can make tagged keys and read your policy and device list. It can't reach
- your devices or change the policy. It's kept like the Hetzner token.
- - Outbound traffic is allowed, and your user has passwordless sudo, as on most cloud images.
- - Alert links can post to your chat, so they're kept like the token. Each server sends its own "ready" alert
- with them and then deletes its copy, though root can still read them from the metadata service. Alerts
- carry server names, types and prices (a plain webhook also gets the public IP), never a token. Anyone who knows an ntfy topic's name can
- read it, so ClosedVPS makes a random one.
- Report vulnerabilities as described in [SECURITY.md](SECURITY.md).
- ## Tailscale access
- A new tailnet lets every device reach every other one, so a server that Claude Code or a bad package takes
- over could reach your laptop. Two changes in the tailnet policy (login.tailscale.com/admin/acls) keep your
- devices able to reach the servers and stop the servers from opening connections to anything:
- ```jsonc
- "tagOwners": { "tag:closedvps": ["autogroup:admin"] },
- "grants": [
- // was "src": ["*"]; tagged servers aren't members, so they can only answer
- {"src": ["autogroup:member"], "dst": ["*"], "ip": ["*"]},
- ],
- ```
- Each server asks for `tag:closedvps` when it joins, so a plain one-off key is enough. Replies to your
- connections still get through, and tagged devices skip key expiry. An older tailnet whose policy has `acls` in place of `grants` changes the
- `src` of its allow-everything rule the same way. A server that's already running gets the tag from the Machines page, its menu, Edit tags.
- [closedvps.com/tailscale](https://closedvps.com/tailscale) explains each step.
- ## If Tailscale stops working
- ```sh
- closedvps open-ssh vps # one rule: TCP 22 from your current public IPv4 only
- ssh you@<the server's public IP> # fix it, e.g. sudo tailscale up
- closedvps close-ssh vps # the rule is gone again
- ```
- `open-ssh` looks up your IP at `ipv4.icanhazip.com`; `--from <ip>` skips that.
- If SSH itself is broken, use Hetzner's web console. A key-only server has no root password, so set one first
- in the Hetzner Console under the server's Rescue tab (Reset root password), then log in as root through the
- console's `>_` button. SSH never allows root, so that password only works there. If the reset fails, the same
- tab can boot a rescue system with your SSH key; run `closedvps open-ssh` first so you can reach it.
- ## Servers you already have
- `closedvps list` shows every server in the Hetzner project, made by ClosedVPS or not, with its price, whether
- the internet can reach it and what's let in, and whether it's on your tailnet. `--json` adds the firewall
- rules. A server with no firewall takes connections on every port it
- listens on, Docker's published ports included. [Closing one by hand](https://closedvps.com/guide#close-a-server-you-already-have)
- puts Tailscale on it before the firewall goes on, so you never lose your way in.
- ## Removing a server
- `closedvps delete vps` deletes the server, its disk and backups, and its `closedvps-vps` firewall, after you
- type its name. It only deletes servers ClosedVPS made, and it says when snapshots are left, since Hetzner keeps
- billing those. Remove the machine from your Tailscale admin too. A firewall left from a stopped run goes the
- same way: `closedvps list` names it, and `closedvps delete <name>` removes it.
- ## For coding agents
- The [skill](skills/closedvps/SKILL.md) covers running ClosedVPS with no prompts. In Claude Code it installs
- as a plugin:
- ```
- /plugin install closedvps --marketplace tulayha/closedvps
- ```
- It adds `/closedvps:create` and `/closedvps:delete`, and asks you to approve every real buy or delete the agent
- runs. Other agents (Codex, Cursor, Gemini CLI and more) can add the skill with:
- ```
- npx skills add tulayha/closedvps
- ```
- ## Development
- [CONTRIBUTING.md](CONTRIBUTING.md) has the checks and how the code is laid out. The install scripts are in
- [install/](install/), and closedvps.com is on the [site branch](https://github.com/tulayha/closedvps/tree/site).
- ## License
- [MIT](LICENSE)
install/install.ps1 · Bundled script · 42 lines · 1 finding marked
- # Installs closedvps from its GitHub release: irm https://closedvps.com/install.ps1 | iex
- Note: Runs a downloaded PowerShell script (iex / Invoke-Expression)
- Line 1 on GitHub
- # $env:CLOSEDVPS_VERSION = "v1.2.3" picks a release (default: latest). The download is checked against the
- # release's checksums.txt. Installs to %LOCALAPPDATA%\Programs\closedvps and adds it to your user PATH.
- & {
- $ErrorActionPreference = 'Stop'
- [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
- $repo = 'tulayha/closedvps'
- $arch = if ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64') { 'arm64' } else { 'amd64' }
- $base = if ($env:CLOSEDVPS_DOWNLOAD_BASE) { $env:CLOSEDVPS_DOWNLOAD_BASE } # CI tests the script against a local build
- elseif ($env:CLOSEDVPS_VERSION) { "https://github.com/$repo/releases/download/$env:CLOSEDVPS_VERSION" }
- else { "https://github.com/$repo/releases/latest/download" }
- $file = "closedvps_windows_$arch.zip"
- $dir = Join-Path $env:LOCALAPPDATA 'Programs\closedvps'
- $tmp = Join-Path ([IO.Path]::GetTempPath()) ("closedvps-" + [guid]::NewGuid())
- New-Item -ItemType Directory -Path $tmp | Out-Null
- try {
- Write-Host "Downloading $file"
- $ProgressPreference = 'SilentlyContinue'
- Invoke-WebRequest -UseBasicParsing -Uri "$base/$file" -OutFile (Join-Path $tmp $file)
- Invoke-WebRequest -UseBasicParsing -Uri "$base/checksums.txt" -OutFile (Join-Path $tmp 'checksums.txt')
- $line = Get-Content (Join-Path $tmp 'checksums.txt') | Where-Object { $_ -match " $([regex]::Escape($file))$" }
- if (-not $line) { throw "$file is not listed in checksums.txt" }
- $want = ($line -split ' ')[0]
- $got = (Get-FileHash -Algorithm SHA256 (Join-Path $tmp $file)).Hash.ToLower()
- if ($got -ne $want) { throw "checksum mismatch for $file; not installing" }
- Expand-Archive -Path (Join-Path $tmp $file) -DestinationPath $tmp -Force
- New-Item -ItemType Directory -Path $dir -Force | Out-Null
- Copy-Item (Join-Path $tmp 'closedvps.exe') (Join-Path $dir 'closedvps.exe') -Force
- } finally {
- Remove-Item -Recurse -Force $tmp -ErrorAction SilentlyContinue
- }
- $userPath = [Environment]::GetEnvironmentVariable('Path', 'User')
- if (($userPath -split ';') -notcontains $dir) {
- [Environment]::SetEnvironmentVariable('Path', (($userPath, $dir) -join ';').Trim(';'), 'User')
- }
- if (($env:Path -split ';') -notcontains $dir) { $env:Path = "$env:Path;$dir" }
- Write-Host "Installed $(& (Join-Path $dir 'closedvps.exe') version) to $dir"
- Write-Host 'Next: closedvps create'
- }
install/install.sh · Bundled script · 66 lines · 2 findings marked
- #!/bin/sh
- # Installs closedvps from its GitHub release: curl -fsSL https://closedvps.com/install.sh | sh
- Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
- Line 2 on GitHub
- # CLOSEDVPS_VERSION=v1.2.3 picks a release (default: latest); CLOSEDVPS_INSTALL_DIR picks the folder
- # (default: ~/.local/bin). The download is checked against the release's checksums.txt.
- set -eu
- main() {
- repo="tulayha/closedvps"
- case "$(uname -s)" in
- Linux) os=linux ;;
- Darwin) os=darwin ;;
- *) fail "this script is for macOS and Linux; on Windows run: irm https://closedvps.com/install.ps1 | iex" ;;
- Note: Runs a downloaded PowerShell script (iex / Invoke-Expression)
- Line 12 on GitHub
- esac
- case "$(uname -m)" in
- x86_64 | amd64) arch=amd64 ;;
- arm64 | aarch64) arch=arm64 ;;
- *) fail "no build for $(uname -m)" ;;
- esac
- if [ -n "${CLOSEDVPS_DOWNLOAD_BASE:-}" ]; then # CI tests the script against a local build
- base="$CLOSEDVPS_DOWNLOAD_BASE"
- elif [ -n "${CLOSEDVPS_VERSION:-}" ]; then
- base="https://github.com/$repo/releases/download/$CLOSEDVPS_VERSION"
- else
- base="https://github.com/$repo/releases/latest/download"
- fi
- dir="${CLOSEDVPS_INSTALL_DIR:-$HOME/.local/bin}"
- file="closedvps_${os}_${arch}.tar.gz"
- tmp="$(mktemp -d)"
- trap 'rm -rf "$tmp"' EXIT
- echo "Downloading $file"
- curl -fsSL -o "$tmp/$file" "$base/$file" || fail "download failed: $base/$file"
- curl -fsSL -o "$tmp/checksums.txt" "$base/checksums.txt" || fail "download failed: $base/checksums.txt"
- want="$(grep " $file\$" "$tmp/checksums.txt" | cut -d' ' -f1)"
- [ -n "$want" ] || fail "$file is not listed in checksums.txt"
- if command -v sha256sum >/dev/null 2>&1; then
- got="$(sha256sum "$tmp/$file" | cut -d' ' -f1)"
- else
- got="$(shasum -a 256 "$tmp/$file" | cut -d' ' -f1)"
- fi
- [ "$got" = "$want" ] || fail "checksum mismatch for $file; not installing"
- tar -xzf "$tmp/$file" -C "$tmp" closedvps
- mkdir -p "$dir"
- mv "$tmp/closedvps" "$dir/closedvps"
- chmod 755 "$dir/closedvps"
- echo "Installed $("$dir/closedvps" version) to $dir/closedvps"
- case ":$PATH:" in
- *":$dir:"*) echo "Next: closedvps create" ;;
- *)
- echo
- echo "$dir is not on your PATH yet. Add it in your shell's startup file, or run it directly:"
- echo " $dir/closedvps create"
- ;;
- esac
- }
- fail() {
- echo "closedvps install: $1" >&2
- exit 1
- }
- main "$@"
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.