Install WireGuard VPN
di VPS Linux

VPN termudah dan tercepat yang bisa kamu jalankan sendiri di VPS.

± 20 menit baca SufaNet
Install WireGuard VPN di VPS Linux

Pendahuluan

WireGuard adalah protokol VPN modern yang dirilis tahun 2020 dan langsung masuk ke Linux kernel. Filosofinya sederhana: kode lebih sedikit = attack surface lebih kecil = lebih aman.

OpenVPN punya ~70.000 baris kode. WireGuard hanya ~4.000 baris. Hasilnya: setup lebih cepat, koneksi lebih stabil, dan throughput lebih tinggi.

WireGuard vs OpenVPN

Aspek WireGuard OpenVPN
Kecepatan⚡ Sangat cepat🐢 Lebih lambat
Setup✅ Simpel⚠️ Kompleks
Latensi✅ Rendah⚠️ Lebih tinggi
Baris Kode~4.000~70.000
ProtokolUDP onlyUDP & TCP

Install WireGuard di VPS

sudo apt update && sudo apt upgrade -y
sudo apt install wireguard -y

# Generate key pair untuk server
wg genkey | sudo tee /etc/wireguard/private.key
sudo chmod 600 /etc/wireguard/private.key
sudo cat /etc/wireguard/private.key | wg pubkey | sudo tee /etc/wireguard/public.key

# Tampilkan key untuk disalin
cat /etc/wireguard/private.key
cat /etc/wireguard/public.key

Konfigurasi Server WireGuard

Buat file konfigurasi:

sudo nano /etc/wireguard/wg0.conf
[Interface]
PrivateKey = ISI_PRIVATE_KEY_SERVER_KAMU
Address = 10.0.0.1/24
ListenPort = 51820
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE

Aktifkan IP forwarding:

echo "net.ipv4.ip_forward=1" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p

Buka port di firewall dan jalankan WireGuard:

sudo ufw allow 51820/udp
sudo systemctl enable wg-quick@wg0
sudo systemctl start wg-quick@wg0

Tambah Client ke Server

Generate key untuk client:

wg genkey | tee client_private.key | wg pubkey > client_public.key
cat client_private.key
cat client_public.key

Tambahkan peer client di /etc/wireguard/wg0.conf server:

[Peer]
PublicKey = ISI_PUBLIC_KEY_CLIENT
AllowedIPs = 10.0.0.2/32

Reload WireGuard tanpa disconnect client lain:

sudo wg syncconf wg0 <(sudo wg-quick strip wg0)

Koneksi dari Client Linux

Buat file config di client:

[Interface]
PrivateKey = ISI_CLIENT_PRIVATE_KEY
Address = 10.0.0.2/32
DNS = 1.1.1.1

[Peer]
PublicKey = ISI_SERVER_PUBLIC_KEY
Endpoint = IP_VPS_KAMU:51820
AllowedIPs = 0.0.0.0/0
PersistentKeepalive = 25
sudo wg-quick up /path/to/client.conf

Koneksi dari Windows

Download WireGuard for Windows dari wireguard.com/install. Import file .conf di atas melalui menu "Add Tunnel". Klik Activate.

Koneksi dari Android / iOS

Install WireGuard dari Play Store / App Store. Buat QR code dari config file:

sudo apt install qrencode -y
qrencode -t ansiutf8 < /path/to/client.conf

Scan QR code dari aplikasi WireGuard di smartphone.

Kenapa VPS SufaNet Cocok untuk WireGuard?

  • IP dedicated — tidak tercampur VPN pengguna lain
  • Bandwidth besar untuk tunneling traffic
  • VPS Singapore — latency rendah dari Indonesia
  • KVM — akses penuh ke networking stack

VPN pribadi lebih aman dari VPN komersial

Tidak ada pihak ketiga yang menyimpan log aktivitas kamu. Kontrol penuh di tangan sendiri.

🚀 Lihat VPS Singapore SufaNet

FAQ

WireGuard bisa dipakai untuk akses database privat?

Ya, ini salah satu use case terbaik. Akses database VPS melalui WireGuard tunnel tanpa expose port database ke publik.

Berapa banyak client yang bisa ditambahkan?

Secara teknis tidak ada batas keras, tapi performa bergantung pada bandwidth dan resource VPS.

WireGuard vs OpenVPN untuk akses remote kerja?

WireGuard lebih direkomendasikan. Setup lebih cepat, koneksi lebih stabil, dan latensi lebih rendah.

Kesimpulan

WireGuard adalah revolusi di dunia VPN. Protokol yang clean, cepat, dan aman — dengan setup yang bisa selesai dalam 15 menit.

Jalankan VPN pribadi di VPS kamu dan tidak perlu lagi bergantung pada layanan VPN yang kamu tidak tahu siapa yang mengoperasikannya.