Guide
WireGuard one-command install script (beta)
Last updated: 1 December 2026
This free script turns a fresh Ubuntu or Debian server into your own WireGuard VPN and shows a QR code for your phone. It is new (beta): use it on a fresh server, read it first, and tell us if something fails.
Instant VPS from $7.99 a month
- Sign up with an email address, a password and any nickname: no ID, no phone number.
- Pay with Monero, Bitcoin, Litecoin, USDT, USDC, SOL or TRX, or by card through MoonPay. Monero is the most private way to pay; USDT or USDC on Solana confirm in seconds, and we add no transfer fee on them.
- Orders are processed automatically and delivered in about 10 minutes.
- New VPS orders have a 24-hour guarantee (see the terms for what is covered).
See Instant VPS plansHow ordering worksWhat you need
A server with Ubuntu 22.04 or 24.04, or Debian 12 or 13, and root access. It works on any provider; use it lawfully and within your provider's rules.
Install
Download it, compare the checksum, read it, then run it:
wget https://phantomvps.com/blog/wireguard.sh
sha256sum wireguard.sh
less wireguard.sh
sudo bash wireguard.sh
The SHA-256 of the current version is e7fca35617e007990902c028938aba1b3778e14e865714971dac9bb6c602e269. At the end, open the WireGuard app on your phone and scan the code.
What it changes
- Installs wireguard, qrencode and iptables
- Writes the server settings and client files, readable by root only
- Turns on IPv4 forwarding
- Opens its UDP port in ufw only if ufw is already on; it does not touch SSH
- No telemetry
Add or remove devices
Give every device its own client:
sudo bash wireguard.sh add laptop
sudo bash wireguard.sh list
sudo bash wireguard.sh remove laptop
Good to know
- If your provider has a firewall panel, allow UDP port 51820 there.
- Clients send IPv6 into the tunnel too, so it does not leak around the VPN; the tunnel itself carries IPv4.
- After
ufw reload, restart with systemctl restart wg-quick@wg0.
Questions and answers
Is it tested?
It is a beta. Please report problems to support@phantomvps.com.
Does it work on other providers?
Yes, on any server with a supported system and root access.
Does it collect anything?
No. It only downloads packages from your distribution.
How do I change the port?
Run it with WG_PORT set, for example: sudo WG_PORT=443 bash wireguard.sh
Ready to try it? Instant VPS from $7.99 a month
- Pick a plan: Instant 1-2, $7.99 a month or all Instant VPS plans.
- Sign up with an email address, a password and any nickname: no ID, no phone number.
- Pay with Monero, Bitcoin, Litecoin, USDT, USDC, SOL or TRX, or by card through MoonPay. Monero is the most private way to pay; USDT or USDC on Solana confirm in seconds, and we add no transfer fee on them.
- Orders are processed automatically and delivered in about 10 minutes.
- New VPS orders have a 24-hour guarantee (see the terms for what is covered).
- Before you pay you can ping our test IPs and read the live status page.
- Support is available 24/7 via email and our client ticket portal.
See Instant VPS plansHow ordering works