AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Headscale Backup

skill-magnus919-agent-skills-headscale-backup · by magnus919

Backup, restore, and migrate Headscale installations — SQLite database,

No reviews yet
0 installs
30 views
0.0% view→install

Install

$ agentstack add skill-magnus919-agent-skills-headscale-backup

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-magnus919-agent-skills-headscale-backup)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
2mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Headscale Backup? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

headscale-backup

Overview

Headscale state is stored in SQLite (its database), config.yaml, policy.json, and TLS certificates. Regular backups are critical before upgrades, as database corruption or misconfiguration can result in complete loss of node registration and routing state. This skill provides three scripts covering the full lifecycle: backup, restore, and migration.

Backup Contents

A complete backup tarball includes:

  • SQLite DB — Full node state, users, routes, pre-auth keys, API keys
  • config.yaml — Headscale server configuration
  • policy.json — ACL policy file (if present)
  • Certs and keys — TLS certificate, private key, and node private key (/var/lib/headscale/)
  • DERP map — DERP configuration file (if customized)

Backup Methods

  • sqlite3 .backup (recommended) — Safe for live databases; uses SQLite online backup API. This is what hs-backup.sh uses.
  • File copy (cp) — Requires stopping headscale first to avoid WAL corruption.

Restore

  1. Stop headscale service
  2. Restore files from backup tarball
  3. Start headscale service
  4. Verify with a health check or headscale nodes list

Migration

  1. Backup on source host (or use an existing backup)
  2. rsync or scp the backup tarball to the target host
  3. Set up headscale on the target (same version)
  4. Restore from backup on target
  5. Update DNS to point to the new server
  6. Verify clients reconnect

Version Compatibility

Source and target headscale versions should match exactly. Restoring a database from a different headscale version may cause schema migration failures or data corruption. Check versions with headscale version before migrating.

Automated Backups (Cron)

Set up a daily cron job:

0 2 * * * /path/to/hs-backup.sh --auto --output-dir /backups/headscale/

Gotchas

  • SQLite WAL mode: sqlite3 .backup is safe; cp of the database file while headscale is running will produce a corrupt copy.
  • Version mismatch: Restoring to a different headscale version may break schema migrations.
  • Node keys: If node keys change, all nodes must re-authenticate.
  • API keys: API keys are stored hashed in the database; restoring a DB backup does not recover the original key secrets — regenerate them with headscale apikeys create.
  • Pre-auth keys: Pre-auth keys are restored along with the database, but if they've expired they won't work.

Environment

  • HEADSCALE_URL — Headscale server URL
  • HEADSCALE_API_KEY — API key for health checks and validation

Trigger Conditions

  • "backup headscale"
  • "restore headscale"
  • "migrate headscale"
  • "headscale backup"

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.