vitalygashkov/rucens/amnezia-vps-setup
Claude Code and agent skill by vitalygashkov/rucens
- community
Checking that the SKILL.md file is still in the repository.
Install and verify native AmneziaWG on an Ubuntu/Debian VPS, with separate profiles for the AmneziaWG app or compatible Keenetic/Netcraze routers. Use for a new installation or adding clients to an existing AmneziaWG server.
Install
npx vskill@latest install vitalygashkov/rucens/amnezia-vps-setupSKILL.md
Configure AmneziaWG on a VPS
Deliver a working .conf for each device on the server the user identified. Commands assume Ubuntu/Debian with systemd, root privileges, and Bash. This is a native installation using awg-quick, without Docker or a control panel. The Ubuntu PPA instructions do not apply to Debian. Replace angle-bracket placeholders before running examples, and stop on failed installation or configuration commands.
Collect missing inputs
Do not ask again for information the user has already provided. If missing, ask for:
- VPS IP or hostname, OS, SSH user, and authentication method;
- the apps and devices that will connect;
- the number of independent profiles needed;
- whether to tunnel all traffic or only selected networks;
- whether the VPS has public IPv6;
- a preferred UDP port, if the user has one.
Assume the user's Keenetic or Netcraze supports the classic wireguard asc parameters. Do not ask for the router model, firmware version, or LAN subnet as setup prerequisites. The user is responsible for reporting unsupported hardware or firmware and unusual LAN addressing. Revisit these details only if the user reports a relevant limitation or troubleshooting reveals a concrete compatibility or subnet conflict.
Choose the protocol version
Select the protocol from the stated client types and the defaults below without requiring a router compatibility questionnaire.
- For the official AmneziaWG app, use a current supported version.
- If clients include Keenetic/Netcraze with the
wireguard ascCLI command, default to a compatible AWG 2.x setup withJc Jmin Jmax S1 S2 H1 H2 H3 H4parameters. - Keep router setups on the classic compatible profile unless the user explicitly requests a newer protocol and supplies its compatibility details.
All clients on one server must use compatible protocol parameters. S1, S2, and H1...H4 must match the server. Jc, Jmin, and Jmax may technically differ, but matching values are easier to check and maintain.
Scope and safety
- Before making changes, tell the user which server and services the work will affect.
- Do not put SSH passwords in command arguments, shell history, URLs, or client files.
- Do not print private keys or preshared keys in diagnostic output.
- Do not reuse keys or obfuscation parameters from another server.
- Do not replace the entire existing firewall ruleset.
- Do not enable UFW blindly. Allow SSH first to avoid losing access.
- Do not run
full-upgrade, change the kernel, or reboot the VPS without a need and the user's agreement. - Inspect existing VPNs and Docker networking before changes. Preserve their services, routes, and firewall rules. VLESS on TCP 443 can coexist with AWG on UDP; check actual listeners, interface names, and subnets.
- Do not install a third-party one-click script when official components can do the same job.
- Create a separate key pair for each device. Sharing one profile between active devices causes endpoint changes and unstable connections.
- The client private key must remain only with the user. Delete the temporary client copy from the VPS after delivery.
- After setup, suggest switching to SSH keys and changing the root password if the password was shared in the conversation.
1. Inventory the server
Connect over SSH and collect the initial state without making changes:
Identify and record:
- the VPS's public address;
- the external interface from the default route, such as
ens3; - kernel version;
- architecture;
- an available UDP port;
- the active firewall system;
- whether public IPv6 is available.
If AmneziaWG already exists, inspect its service and configuration without printing keys. When adding clients, reuse its server keys and protocol parameters, allocate unused client addresses, and append peers. Skip installation and server key regeneration; generate fresh client keys and a preshared key for each new peer. Do not overwrite an occupied interface or configuration with the fresh-install template.
Before editing an existing configuration, back it up and retain the path for rollback:
If a change prevents startup, restore with cp -p -- "$backup" "$config", restart the existing service, and check its status. Back up any firewall file separately before editing it.
2. Choose a kernel module or userspace
AmneziaWG can use a kernel module or the official amneziawg-go userspace implementation.
Before installation, check the current official sources:
- AmneziaWG kernel module;
- official `awg` and `awg-quick` tools;
- `amneziawg-go` userspace implementation;
- AmneziaWG parameter constraints;
- official Amnezia self-hosted server instructions.
Prefer the kernel module when the official package explicitly supports the OS version and running kernel. It is faster and uses less CPU.
Use amneziawg-go when:
- DKMS fails to build against the running kernel;
- the VPS does not allow loading modules;
- no compatible package exists for the distribution;
- installing the module would require a questionable kernel downgrade.
3. Install the official package
If the exact Ubuntu version and kernel are supported, follow the official repository's current instructions. A typical installation looks like this:
Check the result:
If DKMS fails, read the build log. Do not reboot hoping the error will disappear. Switch to userspace if the problem is kernel incompatibility.
4. Install the userspace implementation
Select compatible tags from the official repositories and record their exact versions and commit IDs. Check protocol support and the selected tag's go.mod requirements against go version. Do not upgrade to a new protocol merely because its tag is newer. Prefer a compatible official package or release binary when available; otherwise build from source. Do not overwrite an existing source checkout or uninstall shared build dependencies afterward.
For Ubuntu/Debian:
Check the versions and awg-quick fallback:
An Unknown device type message is expected in userspace mode if awg-quick then reports fallback and successfully starts amneziawg-go. An inactive service or missing interface indicates failure; that message alone does not.
5. Choose the port and subnet
Use an available UDP port that the client network and provider permit, for example 585/udp.
Do not use a port that is already occupied:
For a personal server, use a dedicated private subnet, for example:
Check for overlaps with routes and VPNs visible on the VPS and any networks the user has already mentioned. Otherwise assume the home LAN does not overlap; do not request its subnet or require confirmation. Choose another RFC1918 subnet if a known overlap exists.
6. Obfuscation parameters
For the classic nine-parameter router-compatible profile below, use these conservative limits. Verify support against the selected component versions; newer protocol features need matching client support:
Jc: 1 to 128, with a practical range of 4 to 12;Jmin < Jmax;Jmaxmust be below the external path MTU to avoid fragmentation; the small values generated below also fit MTU 1280;S1 <= 1132at MTU 1280;S2 <= 1188at MTU 1280;S1 + 56must not equalS2;H1...H4must be distinct numbers from 5 to 2147483647.
Generate a fresh set for each server. Example Bash generation within these limits:
Do not print these variables alongside keys in a general log. ASC numbers themselves are not secrets, but the completed client profile contains secrets.
7. Client and server keys
Generate keys with the installed awg:
Capture these values in a private shell session without tracing or printing them. After writing the configurations, run unset server_private server_public client_private client_public preshared_key.
For the next device, create a new client key pair and assign a new address, such as 10.8.1.3/32. Keep the server key and obfuscation parameters unchanged.
8. Server configuration
The official awg-quick looks for its configuration here:
Create the directory before writing the file, with umask 077 still active:
Substitute the external interface, port, keys, and ASC parameters. The hooks below are for an unmanaged iptables ruleset with no earlier blocking rules. For UFW or a managed nftables ruleset, omit both hooks and configure forwarding and NAT through that firewall instead. Use one owner for these rules.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/amnezia-vps-setup/SKILL.md
Popularity
- Repository stars
- 53
- Repository forks
- 4
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/vitalygashkov/rucens/amnezia-vps-setup)