サヌバヌ蚭定をレベルアップ AVAを適甚 そしお、次のように開始したす 15%割匕
プロモを䜿甚

Keywords

KeywordDefinition
🛡 AmneziaWGA fork of WireGuard that randomizes packet headers, sizes, and timing to resist Deep Packet Inspection while keeping the same audited cryptography. It is the protocol that runs on your server.
🚀 AmneziaWG 2.0The current major version that uses dynamic header ranges (instead of fixed values), adds data-level padding (S4), and supports Custom Protocol Signature decoy packets for stronger DPI evasion.
🔍 Deep Packet Inspection (DPI)A network filtering technique used by ISPs and governments to identify and block VPN traffic by analyzing packet headers, sizes, and handshake patterns. AmneziaWG is specifically designed to defeat it.
⚡ WireGuardA fast, modern VPN protocol with a small codebase and kernel-level performance. It is easily fingerprinted by DPI systems due to its fixed packet structure, which is what AmneziaWG was built to fix.
🏠 Self-hosted VPNA VPN you deploy and manage on your own server (typically a VPS) rather than subscribing to a commercial provider. You control the keys, config, and infrastructure.
🐧 DKMS (Dynamic Kernel Module Support)A Linux framework that automatically recompiles kernel modules when the system kernel is updated. The AmneziaWG installer uses DKMS to build the high-performance kernel module.
🎭 ObfuscationThe practice of disguising VPN traffic to look like ordinary internet traffic. AmneziaWG obfuscates at the transport layer by randomizing headers, adding padding, sending decoy packets, and firing junk packets.
🔀 Split tunnelingA routing configuration where only specific traffic (e.g., blocked sites) goes through the VPN while the rest uses your direct connection. Useful in countries with partial censorship.
🖥 KVM vs LXCKVM is full virtualization with a dedicated kernel, required for loading custom kernel modules like AmneziaWG. LXC is container-based virtualization that shares the host kernel and cannot load custom modules.
🎪 CPS (Custom Protocol Signature)An AmneziaWG 2.0 feature that sends decoy packets mimicking other protocols (QUIC, DNS, SIP) before the real handshake, fooling DPI systems into classifying the traffic as normal.

Self-Host an AmneziaWG VPN Server — Complete Guide

AmneziaWG

AmneziaWG is a protocol designed to solve a specific problem: how do you get WireGuard’s speed when the networks you’re connecting through actively try to block it? It’s a fork of WireGuard built by the Amnezia VPN team, and it does one thing that the original doesn’t — it randomizes the transport layer so Deep Packet Inspection systems can’t fingerprint it. The encryption underneath stays exactly the same. What changes is how the packets look on the wire.

The broader landscape of VPN obfuscation has been an arms race for years. Tools like Shadowsocks, VLESS+Reality, and OpenVPN with obfs4 all attempt to disguise traffic in different ways — some as proxies, some as full tunnels, some with heavy performance costs. AmneziaWG sits in a specific niche: it’s a full VPN tunnel with WireGuard-level performance and built-in DPI resistance, all in one package. And since it’s open-source, you can self-host it on your own server.

But here’s the problem that makes this necessary. You set up WireGuard. It works perfectly — fast, clean, reliable. Then one day it stops. No error message, no timeout, no connection refused. The packets just vanish. That’s what DPI blocking looks like in practice: your tunnel is still running, your config is still correct, and nothing gets through. This is the reality in Russia (where WireGuard has roughly a 12% success rate), Iran (98% packet loss), and a growing list of countries including China, Egypt, UAE, Turkey, Belarus, Uzbekistan, Kazakhstan, Myanmar, and Pakistan.

VPN obfuscation

Traditional alternatives don’t fully solve this. Shadowsocks is a proxy, not a full VPN tunnel — your DNS and non-TCP traffic still leak. OpenVPN with obfs4 works but carries roughly 25% performance overhead. VLESS+Reality offers strong obfuscation but is proxy-based and complex to configure. AmneziaWG fills the gap: a complete VPN tunnel with WireGuard’s speed and DPI resistance baked in.

This guide walks you through deploying a fully functional AmneziaWG 2.0 server on any KVM VPS in under 15 minutes using a single community installer script. By the end, you’ll have a working VPN tunnel you can connect to from any device. The steps are provider-agnostic — they work on any VPS with root SSH access, whether that’s from AlexHost, AvaHost, or elsewhere. This is written for intermediate tech users who are comfortable with SSH and basic Linux commands.

One clarification before we start: AmneziaWG is the protocol. AmneziaVPN is the client app that connects to it. They’re related but distinct — like TLS is to your browser. You’ll need the app to connect, but the protocol is what runs on your server.

But before we deploy anything, you need to understand what makes AmneziaWG different from WireGuard — and why that difference matters when DPI is watching.


What Is AmneziaWG? (The Mental Model)

WireGuard is elegant by design. It has a small codebase, uses modern cryptography, and runs in the Linux kernel for near-native performance. But that elegance comes with a visibility problem: every WireGuard packet carries the same fixed header structure, the same fixed packet sizes, and the same handshake pattern. To a Deep Packet Inspection system, a WireGuard tunnel has a signature as clear as a barcode. Once a DPI box learns that signature, it can drop every packet without blocking the port or closing the connection.

DPI
AmneziaWG is a fork of WireGuard-Go created by the Amnezia VPN team. It inherits WireGuard’s architectural simplicity — same Curve25519 key exchange, same ChaCha20-Poly1305 encryption, same Noise IK handshake. All of the cryptography is unchanged and equally audited. What AmneziaWG modifies is the transport layer: the packet headers, the packet sizes, and the timing patterns.

Think of it this way. WireGuard is like a courier who always wears the same uniform — fast, reliable, and efficient. But anyone watching the road learns to recognize that uniform and can stop the courier at any checkpoint. AmneziaWG is the same courier carrying the same packages, but they change uniforms at every checkpoint. Same person, same cargo, completely different appearance.

The version history matters here. AmneziaWG 1.x introduced custom headers that differed from WireGuard’s fixed values — it helped for a while, but DPI systems adapted. AmneziaWG 2.0, released in late 2025, randomizes everything: headers change per packet, padding varies per message, and decoy packets mimic other protocols before the real handshake begins. There is no universal signature to detect because every AmneziaWG 2.0 server generates its own unique parameter set. Each server speaks its own dialect.

When all obfuscation parameters are set to zero, AmneziaWG behaves identically to WireGuard — it’s fully backward compatible at the protocol level. But with parameters active (which is the default), it becomes something WireGuard cannot be: a fast VPN tunnel that DPI systems struggle to identify.

So how exactly does AmneziaWG scramble its traffic? Let’s look at the four obfuscation layers that make DPI blind — and why they add almost no speed cost.


How AmneziaWG Hides From DPI (Without Losing Speed)

AmneziaWG 2.0 uses four layered obfuscation techniques that work together. Each one targets a different way DPI systems identify VPN traffic. Together, they make every server’s traffic look unique.

Dynamic Headers (H1–H4)

WireGuard uses fixed 32-bit message type identifiers:

  • 1 — for initiation
  • 2 — for response
  • 3 — for cookie reply
  • 4 — for data

A DPI box scanning traffic just looks for these values. AmneziaWG 2.0 replaces each fixed value with a random number drawn from a configured range. The initiation header (H1) might be any value between 234567 and 345678. The response header (H2) might be between 3456789 and 4567890. These ranges never overlap — the protocol still needs to distinguish packet types internally — but to an outside observer, there’s no single header value to latch onto. Every packet looks different from the last.

Random Padding (S1–S4)

WireGuard’s initiation packet is always exactly 148 bytes. Its response is always exactly 92 bytes. These fixed sizes are another fingerprint. AmneziaWG adds random padding to each packet type: the initiation becomes 148+S1 bytes, the response becomes 92+S2 bytes, the cookie reply becomes 64+S3 bytes, and every data packet gets S4 bytes of padding. S3 and S4 are new in version 2.0 — and S4 is the most significant addition because it touches every single data packet, making session-wide traffic analysis much harder.

There’s one critical constraint: S1+56 must not equal S2. Since the original size difference between initiation and response is 56 bytes (148−92), if the padding values happened to compensate for exactly that difference, the two padded packets would end up the same size — recreating the fingerprint AmneziaWG is trying to eliminate. The installer’s parameter generator enforces this constraint automatically.

Custom Protocol Signature (I1–I5)

Before the real WireGuard handshake begins, the AmneziaWG client sends up to five decoy packets that mimic other protocols — QUIC, DNS, SIP, or custom byte patterns. The server ignores these packets entirely. It just waits for the real handshake.

  • A simple configuration: Sends 128 random bytes <r 128>.
  • A sophisticated configuration: Sends bytes that look like a QUIC connection initiation (<b 0xc000000001><r 64><t>), complete with a Unix timestamp.

To a DPI system watching the session start, the first packets look like normal web traffic.

Junk Packets (Jc, Jmin, Jmax)

After the decoy packets, the client fires a configurable number of junk packets — pure noise with random sizes between Jmin and Jmax. These blur the timing and size profile of the session start, making it harder for DPI systems to identify where the real handshake begins.

The Speed Question

There’s a number that’s been circulating online: AmneziaWG has 65% overhead. That figure is real, but it refers to the userspace Go implementation — not the kernel module. The community installer used in this guide builds a DKMS kernel module, and the kernel module adds less than 12% overhead total — closer to 3% in real-world benchmarks. On an uncensored network, you’d see roughly 95 Mbps through WireGuard and 92 Mbps through AmneziaWG 2.0. In a censored network, the comparison is 92 Mbps versus zero.

The following table summarizes the parameters the installer generates automatically:

ParameterGenerated RangeExample Value
Jc

(junk packet count)

4–8
6
Jmin

(min junk size)

40–89
55
Jmax

(max junk size)

Jmin+100 to Jmin+500
380
S1

(init padding)

15–150
72
S2

(response padding)

15–150, S1+56≠S2
56
S3

(cookie padding)

8–55
32
S4

(data padding)

4–27
16
H1

(init header range)

uint32 non-overlapping
234567-345678
H2

(response header range)

uint32 non-overlapping
3456789-4567890
H3

(cookie header range)

uint32 non-overlapping
56789012-67890123
H4

(data header range)

uint32 non-overlapping
456789012-567890123
I1

(CPS packet)

<r N>

format

<r 128>

You don’t need to set any of these manually. The installer generates cryptographically random, constraint-valid values every time.

Now that you know how the obfuscation works, let’s see how AmneziaWG stacks up against the alternatives you might be considering.


AmneziaWG vs Alternatives — Quick Decision Guide

VPNs
If you’re evaluating VPN protocols for a censored environment, you’ve probably come across several options. Here’s how they compare across the dimensions that matter:

WireGuardAmneziaWG 2.0OpenVPN+obfs4ShadowsocksVLESS+Reality
DPI resistanceLowHighMediumMediumVery High
Speed overhead~4%<12% (~3% real-world)~25%~8%~10%
Full VPN tunnelYesYesYesNo (proxy)No (proxy)
Runs in kernelYesYes (DKMS)NoNoNo
Setup complexityLowLow (with installer)HighMediumHigh
TransportUDPUDPTCP/UDPTCPTCP

The decision rules are straightforward:

  • No DPI in your country? Use plain WireGuard. It’s simpler and has a larger ecosystem.
  • Need maximum DPI resistance and OK with a proxy? VLESS+Reality is the strongest option for obfuscation, but it’s not a full tunnel.
  • Want both speed and a full tunnel with obfuscation? AmneziaWG 2.0 is the only option that delivers WireGuard-grade performance with real DPI resistance in a complete VPN tunnel.
  • Already using OpenVPN+obfs4 and it still works? No urgent need to switch, but AmneziaWG will be noticeably faster.

This article focuses on AmneziaWG because it’s the only protocol that gives you a full tunnel, kernel-level performance, and built-in obfuscation — all configured by a single script.

If AmneziaWG is the right choice for your situation, here’s exactly what you need before we start deploying.


What You’ll Need Before Starting

Before running the installer, make sure your environment meets these requirements:

RequirementDetailWhy
OSUbuntu 24.04 LTS (clean install). Ubuntu 25.10 is experimental. Debian 12/13 work but may need

curl pre-installed.
The installer is tested and fully supported on Ubuntu 24.04.
VPS specs1 vCore, 1 GB RAM, 25 GB storage. Any $3–5/month plan works.The installer needs ~2 GB disk and ~1 GB RAM during the DKMS build. The running VPN uses negligible resources.
VirtualizationKVM (not OpenVZ, not LXC).AmneziaWG loads a kernel module via DKMS. LXC shares the host kernel and cannot load custom modules.
SSH accessRoot or sudo user with password/key authentication.The installer must run as root.
SSH portDefault 22, or pre-opened in UFW if using a non-standard port.If SSH isn’t on port 22 and you don’t pre-open it, the installer’s firewall setup will lock you out.
Client appAmnezia VPN >= 4.8.12.7 (all platforms).AWG 2.0 parameters are not understood by older clients. The standard WireGuard client does not support AWG at all.

⚠ Warning: LXC containers are not supported. If your VPS uses LXC virtualization, the DKMS kernel module build will fail. You must use KVM or bare-metal. Check with your provider if you’re unsure.

⚠ Warning: If your SSH runs on a non-standard port (anything other than 22), you must open it in UFW before running the installer:

sudo ufw allow YOUR_PORT/tcp

Replace

YOUR_PORT

with your actual SSH port. The installer enables UFW with a default-deny policy — if your SSH port isn’t allowed, you’ll be locked out immediately.

💡 Tip: Wait 5–10 minutes after creating your VPS before running the installer. Cloud-init and background initialization processes can conflict with the

apt-get

calls the installer makes.

With your VPS ready and prerequisites confirmed, let’s deploy AmneziaWG 2.0 using the community installer script — the fastest and most transparent method.


Keywords

KeywordDefinition
🛡 AmneziaWGA fork of WireGuard that randomizes packet headers, sizes, and timing to resist Deep Packet Inspection while keeping the same audited cryptography. It is the protocol that runs on your server.
🚀 AmneziaWG 2.0The current major version that uses dynamic header ranges (instead of fixed values), adds data-level padding (S4), and supports Custom Protocol Signature decoy packets for stronger DPI evasion.
🔍 Deep Packet Inspection (DPI)A network filtering technique used by ISPs and governments to identify and block VPN traffic by analyzing packet headers, sizes, and handshake patterns. AmneziaWG is specifically designed to defeat it.
⚡ WireGuardA fast, modern VPN protocol with a small codebase and kernel-level performance. It is easily fingerprinted by DPI systems due to its fixed packet structure, which is what AmneziaWG was built to fix.
🏠 Self-hosted VPNA VPN you deploy and manage on your own server (typically a VPS) rather than subscribing to a commercial provider. You control the keys, config, and infrastructure.
🐧 DKMS (Dynamic Kernel Module Support)A Linux framework that automatically recompiles kernel modules when the system kernel is updated. The AmneziaWG installer uses DKMS to build the high-performance kernel module.
🎭 ObfuscationThe practice of disguising VPN traffic to look like ordinary internet traffic. AmneziaWG obfuscates at the transport layer by randomizing headers, adding padding, sending decoy packets, and firing junk packets.
🔀 Split tunnelingA routing configuration where only specific traffic (e.g., blocked sites) goes through the VPN while the rest uses your direct connection. Useful in countries with partial censorship.
🖥 KVM vs LXCKVM is full virtualization with a dedicated kernel, required for loading custom kernel modules like AmneziaWG. LXC is container-based virtualization that shares the host kernel and cannot load custom modules.
🎪 CPS (Custom Protocol Signature)An AmneziaWG 2.0 feature that sends decoy packets mimicking other protocols (QUIC, DNS, SIP) before the real handshake, fooling DPI systems into classifying the traffic as normal.

Self-Host an AmneziaWG VPN Server — Complete Guide

AmneziaWG

AmneziaWG is a protocol designed to solve a specific problem: how do you get WireGuard’s speed when the networks you’re connecting through actively try to block it? It’s a fork of WireGuard built by the Amnezia VPN team, and it does one thing that the original doesn’t — it randomizes the transport layer so Deep Packet Inspection systems can’t fingerprint it. The encryption underneath stays exactly the same. What changes is how the packets look on the wire.

The broader landscape of VPN obfuscation has been an arms race for years. Tools like Shadowsocks, VLESS+Reality, and OpenVPN with obfs4 all attempt to disguise traffic in different ways — some as proxies, some as full tunnels, some with heavy performance costs. AmneziaWG sits in a specific niche: it’s a full VPN tunnel with WireGuard-level performance and built-in DPI resistance, all in one package. And since it’s open-source, you can self-host it on your own server.

But here’s the problem that makes this necessary. You set up WireGuard. It works perfectly — fast, clean, reliable. Then one day it stops. No error message, no timeout, no connection refused. The packets just vanish. That’s what DPI blocking looks like in practice: your tunnel is still running, your config is still correct, and nothing gets through. This is the reality in Russia (where WireGuard has roughly a 12% success rate), Iran (98% packet loss), and a growing list of countries including China, Egypt, UAE, Turkey, Belarus, Uzbekistan, Kazakhstan, Myanmar, and Pakistan.

VPN obfuscation

Traditional alternatives don’t fully solve this. Shadowsocks is a proxy, not a full VPN tunnel — your DNS and non-TCP traffic still leak. OpenVPN with obfs4 works but carries roughly 25% performance overhead. VLESS+Reality offers strong obfuscation but is proxy-based and complex to configure. AmneziaWG fills the gap: a complete VPN tunnel with WireGuard’s speed and DPI resistance baked in.

This guide walks you through deploying a fully functional AmneziaWG 2.0 server on any KVM VPS in under 15 minutes using a single community installer script. By the end, you’ll have a working VPN tunnel you can connect to from any device. The steps are provider-agnostic — they work on any VPS with root SSH access, whether that’s from AlexHost, AvaHost, or elsewhere. This is written for intermediate tech users who are comfortable with SSH and basic Linux commands.

One clarification before we start: AmneziaWG is the protocol. AmneziaVPN is the client app that connects to it. They’re related but distinct — like TLS is to your browser. You’ll need the app to connect, but the protocol is what runs on your server.

But before we deploy anything, you need to understand what makes AmneziaWG different from WireGuard — and why that difference matters when DPI is watching.


What Is AmneziaWG? (The Mental Model)

WireGuard is elegant by design. It has a small codebase, uses modern cryptography, and runs in the Linux kernel for near-native performance. But that elegance comes with a visibility problem: every WireGuard packet carries the same fixed header structure, the same fixed packet sizes, and the same handshake pattern. To a Deep Packet Inspection system, a WireGuard tunnel has a signature as clear as a barcode. Once a DPI box learns that signature, it can drop every packet without blocking the port or closing the connection.

DPI
AmneziaWG is a fork of WireGuard-Go created by the Amnezia VPN team. It inherits WireGuard’s architectural simplicity — same Curve25519 key exchange, same ChaCha20-Poly1305 encryption, same Noise IK handshake. All of the cryptography is unchanged and equally audited. What AmneziaWG modifies is the transport layer: the packet headers, the packet sizes, and the timing patterns.

Think of it this way. WireGuard is like a courier who always wears the same uniform — fast, reliable, and efficient. But anyone watching the road learns to recognize that uniform and can stop the courier at any checkpoint. AmneziaWG is the same courier carrying the same packages, but they change uniforms at every checkpoint. Same person, same cargo, completely different appearance.

The version history matters here. AmneziaWG 1.x introduced custom headers that differed from WireGuard’s fixed values — it helped for a while, but DPI systems adapted. AmneziaWG 2.0, released in late 2025, randomizes everything: headers change per packet, padding varies per message, and decoy packets mimic other protocols before the real handshake begins. There is no universal signature to detect because every AmneziaWG 2.0 server generates its own unique parameter set. Each server speaks its own dialect.

When all obfuscation parameters are set to zero, AmneziaWG behaves identically to WireGuard — it’s fully backward compatible at the protocol level. But with parameters active (which is the default), it becomes something WireGuard cannot be: a fast VPN tunnel that DPI systems struggle to identify.

So how exactly does AmneziaWG scramble its traffic? Let’s look at the four obfuscation layers that make DPI blind — and why they add almost no speed cost.


How AmneziaWG Hides From DPI (Without Losing Speed)

AmneziaWG 2.0 uses four layered obfuscation techniques that work together. Each one targets a different way DPI systems identify VPN traffic. Together, they make every server’s traffic look unique.

Dynamic Headers (H1–H4)

WireGuard uses fixed 32-bit message type identifiers:

  • 1 — for initiation
  • 2 — for response
  • 3 — for cookie reply
  • 4 — for data

A DPI box scanning traffic just looks for these values. AmneziaWG 2.0 replaces each fixed value with a random number drawn from a configured range. The initiation header (H1) might be any value between 234567 and 345678. The response header (H2) might be between 3456789 and 4567890. These ranges never overlap — the protocol still needs to distinguish packet types internally — but to an outside observer, there’s no single header value to latch onto. Every packet looks different from the last.

Random Padding (S1–S4)

WireGuard’s initiation packet is always exactly 148 bytes. Its response is always exactly 92 bytes. These fixed sizes are another fingerprint. AmneziaWG adds random padding to each packet type: the initiation becomes 148+S1 bytes, the response becomes 92+S2 bytes, the cookie reply becomes 64+S3 bytes, and every data packet gets S4 bytes of padding. S3 and S4 are new in version 2.0 — and S4 is the most significant addition because it touches every single data packet, making session-wide traffic analysis much harder.

There’s one critical constraint: S1+56 must not equal S2. Since the original size difference between initiation and response is 56 bytes (148−92), if the padding values happened to compensate for exactly that difference, the two padded packets would end up the same size — recreating the fingerprint AmneziaWG is trying to eliminate. The installer’s parameter generator enforces this constraint automatically.

Custom Protocol Signature (I1–I5)

Before the real WireGuard handshake begins, the AmneziaWG client sends up to five decoy packets that mimic other protocols — QUIC, DNS, SIP, or custom byte patterns. The server ignores these packets entirely. It just waits for the real handshake.

  • A simple configuration: Sends 128 random bytes <r 128>.
  • A sophisticated configuration: Sends bytes that look like a QUIC connection initiation (<b 0xc000000001><r 64><t>), complete with a Unix timestamp.

To a DPI system watching the session start, the first packets look like normal web traffic.

Junk Packets (Jc, Jmin, Jmax)

After the decoy packets, the client fires a configurable number of junk packets — pure noise with random sizes between Jmin and Jmax. These blur the timing and size profile of the session start, making it harder for DPI systems to identify where the real handshake begins.

The Speed Question

There’s a number that’s been circulating online: AmneziaWG has 65% overhead. That figure is real, but it refers to the userspace Go implementation — not the kernel module. The community installer used in this guide builds a DKMS kernel module, and the kernel module adds less than 12% overhead total — closer to 3% in real-world benchmarks. On an uncensored network, you’d see roughly 95 Mbps through WireGuard and 92 Mbps through AmneziaWG 2.0. In a censored network, the comparison is 92 Mbps versus zero.

The following table summarizes the parameters the installer generates automatically:

ParameterGenerated RangeExample Value
Jc

(junk packet count)

4–8
6
Jmin

(min junk size)

40–89
55
Jmax

(max junk size)

Jmin+100 to Jmin+500
380
S1

(init padding)

15–150
72
S2

(response padding)

15–150, S1+56≠S2
56
S3

(cookie padding)

8–55
32
S4

(data padding)

4–27
16
H1

(init header range)

uint32 non-overlapping
234567-345678
H2

(response header range)

uint32 non-overlapping
3456789-4567890
H3

(cookie header range)

uint32 non-overlapping
56789012-67890123
H4

(data header range)

uint32 non-overlapping
456789012-567890123
I1

(CPS packet)

<r N>

format

<r 128>

You don’t need to set any of these manually. The installer generates cryptographically random, constraint-valid values every time.

Now that you know how the obfuscation works, let’s see how AmneziaWG stacks up against the alternatives you might be considering.


AmneziaWG vs Alternatives — Quick Decision Guide

VPNs
If you’re evaluating VPN protocols for a censored environment, you’ve probably come across several options. Here’s how they compare across the dimensions that matter:

WireGuardAmneziaWG 2.0OpenVPN+obfs4ShadowsocksVLESS+Reality
DPI resistanceLowHighMediumMediumVery High
Speed overhead~4%<12% (~3% real-world)~25%~8%~10%
Full VPN tunnelYesYesYesNo (proxy)No (proxy)
Runs in kernelYesYes (DKMS)NoNoNo
Setup complexityLowLow (with installer)HighMediumHigh
TransportUDPUDPTCP/UDPTCPTCP

The decision rules are straightforward:

  • No DPI in your country? Use plain WireGuard. It’s simpler and has a larger ecosystem.
  • Need maximum DPI resistance and OK with a proxy? VLESS+Reality is the strongest option for obfuscation, but it’s not a full tunnel.
  • Want both speed and a full tunnel with obfuscation? AmneziaWG 2.0 is the only option that delivers WireGuard-grade performance with real DPI resistance in a complete VPN tunnel.
  • Already using OpenVPN+obfs4 and it still works? No urgent need to switch, but AmneziaWG will be noticeably faster.

This article focuses on AmneziaWG because it’s the only protocol that gives you a full tunnel, kernel-level performance, and built-in obfuscation — all configured by a single script.

If AmneziaWG is the right choice for your situation, here’s exactly what you need before we start deploying.


What You’ll Need Before Starting

Before running the installer, make sure your environment meets these requirements:

RequirementDetailWhy
OSUbuntu 24.04 LTS (clean install). Ubuntu 25.10 is experimental. Debian 12/13 work but may need

curl pre-installed.
The installer is tested and fully supported on Ubuntu 24.04.
VPS specs1 vCore, 1 GB RAM, 25 GB storage. Any $3–5/month plan works.The installer needs ~2 GB disk and ~1 GB RAM during the DKMS build. The running VPN uses negligible resources.
VirtualizationKVM (not OpenVZ, not LXC).AmneziaWG loads a kernel module via DKMS. LXC shares the host kernel and cannot load custom modules.
SSH accessRoot or sudo user with password/key authentication.The installer must run as root.
SSH portDefault 22, or pre-opened in UFW if using a non-standard port.If SSH isn’t on port 22 and you don’t pre-open it, the installer’s firewall setup will lock you out.
Client appAmnezia VPN >= 4.8.12.7 (all platforms).AWG 2.0 parameters are not understood by older clients. The standard WireGuard client does not support AWG at all.

⚠ Warning: LXC containers are not supported. If your VPS uses LXC virtualization, the DKMS kernel module build will fail. You must use KVM or bare-metal. Check with your provider if you’re unsure.

⚠ Warning: If your SSH runs on a non-standard port (anything other than 22), you must open it in UFW before running the installer:

sudo ufw allow YOUR_PORT/tcp

Replace

YOUR_PORT

with your actual SSH port. The installer enables UFW with a default-deny policy — if your SSH port isn’t allowed, you’ll be locked out immediately.

💡 Tip: Wait 5–10 minutes after creating your VPS before running the installer. Cloud-init and background initialization processes can conflict with the

apt-get

calls the installer makes.

With your VPS ready and prerequisites confirmed, let’s deploy AmneziaWG 2.0 using the community installer script — the fastest and most transparent method.


キヌワヌド

キヌワヌド定矩
🛡 AmneziaWGパケットヘッダヌ、サむズ、送信時間をランダム化しお深局パケット怜査に察抗しながら、同じ蚌明された暗号化を維持するWireGuardのフォヌクです。これはあなたのサヌバヌ䞊で動䜜するプロトコルです。
🚀 AmneziaWG 2.0動的ヘッダヌ範囲固定倀の代わりにを䜿甚し、デヌタレベルのパディングS4を远加し、より匷力なDPI回避のためにカスタムプロトコル眲名を持぀代替パケットをサポヌトする珟圚のメむンバヌゞョンです。
🔍 深局パケット怜査 (DPI)ISPや政府機関がVPNトラフィックを特定し、ブロックするためにパケットヘッダヌ、サむズ、ハンドシェむクパタヌンを分析するために䜿甚するネットワヌクフィルタリング技術です。AmneziaWGはこれに察抗するために特別に蚭蚈されおいたす。
⚡ WireGuard小さなコヌドベヌスずカヌネルレベルのパフォヌマンスを持぀高速で珟代的なVPNプロトコルです。固定パケット構造のため、DPIシステムによっお容易に識別されたすが、これはAmneziaWGで察凊されおいたす。
🏠 セルフホストVPN商業プロバむダヌに加入するのではなく、自分のサヌバヌ通垞はVPS䞊に展開し管理するVPNです。キヌ、構成、むンフラストラクチャを制埡したす。
🐧 DKMS (Dynamic Kernel Module Support)システムカヌネルが曎新されるず、自動的にカヌネルモゞュヌルを再コンパむルするLinuxフレヌムワヌクです。AmneziaWGむンストヌラヌは、DKMSを䜿甚しお高性胜のカヌネルモゞュヌルを構築したす。
🎭 難読化VPNトラフィックを通垞のむンタヌネットトラフィックのように芋せるために隠す行為です。AmneziaWGは、ヘッダヌをランダム化し、パディングを远加し、代替パケットを送信し、ゞャンクパケットを生成するこずでトランスポヌト局で難読化したす。
🔀 スプリットトンネリング特定のトラフィック䟋ブロックされたサむトのみがVPNを通過し、他のトラフィックは盎接接続を䜿甚するルヌティング構成です。郚分的な怜閲のある囜で䟿利です。
🖥 KVM vs LXCKVMは、AmneziaWGのようなカスタムカヌネルモゞュヌルを読み蟌むために必芁な専甚カヌネルを持぀完党仮想化です。LXCはホストの共有カヌネルを䜿甚するコンテナ仮想化で、カスタムモゞュヌルを読み蟌むこずができたせん。
🎪 CPS (Custom Protocol Signature)AmneziaWG 2.0の機胜で、実際のハンドシェむクの前に他のプロトコルQUIC、DNS、SIPを暡倣する代替パケットを送信し、DPIシステムを誀解させおトラフィックを通垞のものずしお分類したす。

セルフデプロむ型AmneziaWG VPNサヌバヌ — 完党ガむド

AmneziaWG

AmneziaWGは、接続するネットワヌクが積極的にブロックしようずする堎合にWireGuardの速床をどのように達成するかずいう特定の問題を解決するために蚭蚈されたプロトコルです。これはAmnezia VPNチヌムによっお䜜成されたWireGuardのフォヌクであり、元のものが行わないこずを行いたす — トランスポヌト局をランダム化しお深局パケット怜査システムがそれを特定できないようにしたす。暗号化は党く同じたたです。ネットワヌク内のパケットの倖芳だけが倉わりたす。

VPNの難読化の広範な颚景は、䜕幎にもわたっお歊噚競争でした。Shadowsocks、VLESS+Reality、OpenVPN with obfs4のようなツヌルは、さたざたな方法でトラフィックを隠そうずしたす — 䞀郚はプロキシずしお、䞀郚は完党なトンネルずしお、䞀郚は高いパフォヌマンスコストを䌎いたす。AmneziaWGは特定のニッチを占めおいたすそれはWireGuardレベルのパフォヌマンスず組み蟌みのDPI保護を持぀完党なVPNトンネルであり、すべおが1぀のパッケヌゞにたずめられおいたす。そしお、オヌプン゜ヌスであるため、自分のサヌバヌに展開できたす。

しかし、これが必芁になる問題がありたす。WireGuardを蚭定したす。それは完璧に機胜したす — 高速、クリヌン、信頌性がありたす。するず、ある日、それが停止したす。゚ラヌメッセヌゞもタむムアりトも接続拒吊もありたせん。パケットがただ消えたす。これが実際のDPIブロッキングの姿ですトンネルはただ動䜜しおおり、構成はただ正しいのに、䜕も通過したせん。これはロシアWireGuardの成功率は玄12%、むラン98%のパケット損倱、䞭囜、゚ゞプト、UAE、トルコ、ベラルヌシ、りズベキスタン、カザフスタン、ミャンマヌ、パキスタンを含む増え続ける囜々の珟実です。

VPN Obfuscation

埓来の代替手段はこの問題を完党には解決したせん。Shadowsocksはプロキシであり、完党なVPNトンネルではありたせん — DNSや非TCPトラフィックはただ挏れたす。OpenVPN with obfs4は機胜したすが、玄25%のパフォヌマンスオヌバヌヘッドがありたす。VLESS+Realityは匷力な難読化を提䟛したすが、プロキシベヌスであり、蚭定が耇雑です。AmneziaWGはそのギャップを埋めたすそれはWireGuardレベルのパフォヌマンスず組み蟌みのDPI保護を持぀完党なVPNトンネルです。

このガむドでは、KVM VPS䞊に完党に機胜するAmneziaWG 2.0サヌバヌを15分以内に単䞀のコミュニティむンストヌラスクリプトを䜿甚しお展開する方法を説明したす。最終的には、任意のデバむスから接続できる䜜業VPNトンネルが埗られたす。手順はプロバむダヌに䟝存せず、SSHアクセスずルヌト暩限を持぀任意のVPSで機胜したす。これは、SSHや基本的なLinuxコマンドを䜿いこなす䞭玚レベルの技術スキルを持぀ナヌザヌ向けに曞かれおいたす。

始める前に1぀の明確化がありたすAmneziaWGはプロトコルです。AmneziaVPNはそれに接続するクラむアントアプリケヌションです。それらは関連しおいたすが異なりたす — あなたのブラりザのためのTLSのように。接続するためのアプリケヌションが必芁ですが、プロトコルはあなたのサヌバヌ䞊で動䜜したす。

しかし、䜕かを展開する前に、AmneziaWGがWireGuardず異なる理由 — そしおその違いがDPIがあなたを芋おいるずきに重芁である理由を理解する必芁がありたす。


AmneziaWGずは䜕ですか (メンタルモデル)

WireGuardはその蚭蚈においお優雅です。小さなコヌドベヌスを持ち、珟代の暗号化を䜿甚し、ほがネむティブのパフォヌマンスでLinuxカヌネルで動䜜したす。しかし、この優雅さには可芖性の問題がありたすすべおのWireGuardパケットは同じ固定ヘッダヌ構造、同じ固定パケットサむズ、同じハンドシェむクパタヌンを持っおいたす。深局パケット怜査システムにずっお、WireGuardトンネルはバヌコヌドのように明確な眲名を持っおいたす。この眲名をDPIデバむスが孊習するず、ポヌトをブロックしたり接続を閉じたりするこずなく、すべおのパケットをドロップできたす。

DPI
AmneziaWGは、Amnezia VPNチヌムによっお䜜成されたWireGuard-Goのフォヌクです。WireGuardのアヌキテクチャのシンプルさを継承しおおり — 同じCurve25519キヌ亀換、同じChaCha20-Poly1305暗号化、同じNoise IKハンドシェむクを䜿甚しおいたす。すべおの暗号化は倉曎されず、怜蚌もされおいたす。AmneziaWGが倉曎するのはトランスポヌト局ですパケットヘッダヌ、パケットサむズ、タむミングパタヌンです。

こう考えおみおください。WireGuardは垞に同じ制服を着た宅配䟿のようです — 高速で信頌性が高く効率的です。しかし、道路を芋おいる誰もがその制服を認識するようになり、チェックポむントで宅配䟿を止めるこずができたす。AmneziaWGは同じパッケヌゞを運ぶ同じ宅配䟿ですが、チェックポむントごずに制服を倉えたす。同じ人、同じ貚物、党く異なる倖芳です。

バヌゞョン履歎は重芁です。AmneziaWG 1.xはWireGuardの固定倀ずは異なるカスタムヘッダヌを導入したした — これは䞀時的に圹立ちたしたが、DPIシステムは適応したした。2025幎末にリリヌスされたAmneziaWG 2.0は、すべおをランダム化したすヘッダヌはパケットごずに倉わり、パディングはメッセヌゞごずに異なり、代替パケットは実際のハンドシェむクが始たる前に他のプロトコルを暡倣したす。怜出のための普遍的な眲名は存圚したせん。なぜなら、各AmneziaWG 2.0サヌバヌは独自のパラメヌタセットを生成するからです。各サヌバヌは独自の方蚀を話したす。

すべおの難読化パラメヌタがれロに蚭定されおいるず、AmneziaWGはWireGuardず同じように振る舞いたす — プロトコルレベルで完党に埌方互換性がありたす。しかし、アクティブなパラメヌタデフォルト蚭定を持぀ず、WireGuardができないものになりたすDPIシステムが特定するのに苊劎する高速VPNトンネルです。

では、AmneziaWGはどのようにトラフィックを暗号化するのでしょうかDPIを盲目にする4぀の難読化レベルを芋おみたしょう — そしおなぜそれらがほずんど速床コストを远加しないのかを説明したす。


AmneziaWGがDPIから隠れる方法 (速床損倱なし)

AmneziaWG 2.0は、DPIシステムがVPNトラフィックを特定するさたざたな方法をタヌゲットにした4぀の難読化レベルを䜿甚しおいたす。これらはすべお䞀緒に機胜したす。各サヌバヌのトラフィックをナニヌクにしたす。

動的ヘッダヌ (H1–H4)

WireGuardは固定の32ビットメッセヌゞタむプ識別子を䜿甚したす

  • 1 — むニシ゚ヌション甚
  • 2 — レスポンス甚
  • 3 — クッキヌ付きレスポンス甚
  • 4 — デヌタ甚

DPIデバむスはトラフィックをスキャンする際にこれらの倀を探したす。AmneziaWG 2.0は、各固定倀を指定された範囲から遞ばれたランダムな数に眮き換えたす。むニシ゚ヌションヘッダヌH1は234567から345678の任意の倀になりたす。レスポンスヘッダヌH2は3456789から4567890の範囲です。これらの範囲は重耇したせん — プロトコルは内郚でパケットタむプを区別する必芁がありたすが、倖郚の芳察者にずっおは、掎むべき単䞀のヘッダヌ倀は存圚したせん。各パケットは前のものずは異なっお芋えたす。

ランダムパディング (S1–S4)

WireGuardのむニシ゚ヌションパケットは垞に正確に148バむトです。そのレスポンスは垞に正確に92バむトです。これらの固定サむズは別の指王です。AmneziaWGは各パケットタむプにランダムパディングを远加したすむニシ゚ヌションは148+S1バむト、レスポンスは92+S2バむト、クッキヌ付きレスポンスは64+S3バむト、各デヌタパケットはS4バむトのパディングを受け取りたす。S3ずS4はバヌゞョン2.0で新しく、S4はすべおのデヌタパケットに圱響を䞎える最も重芁な远加です。これにより、セッションレベルのトラフィック分析がはるかに難しくなりたす。

1぀の重芁な制玄がありたすS1+56はS2ず等しくない必芁がありたす。むニシ゚ヌションずレスポンスの元のサむズ差は56バむト148−92であるため、パディング倀がちょうどその差をランダムに補償するず、2぀のパディングされたパケットは同じサむズになり、AmneziaWGが排陀しようずしおいる指王を再珟したす。むンストヌラヌのパラメヌタ生成噚は自動的にこの制玄を確保したす。

カスタムプロトコル眲名 (I1–I5)

実際のハンドシェむクが始たる前に、AmneziaWGクラむアントは他のプロトコル — QUIC、DNS、SIP、たたはカスタムバむトパタヌンを暡倣する最倧5぀の代替パケットを送信したす。サヌバヌはこれらのパケットを完党に無芖したす。実際のハンドシェむクを埅぀だけです。

  • シンプルな構成128バむトのランダムなバむトを送信<r 128>。
  • 耇雑な構成QUIC接続を開始するように芋えるバむトを送信<b 0xc000000001><r 64><t>、Unixタむムスタンプ付き。

DPIシステムがセッション開始を芳察しおいる堎合、最初のパケットは通垞のWebトラフィックのように芋えたす。

ゞャンクパケット (Jc, Jmin, Jmax)

代替パケットの埌、クラむアントはカスタマむズ可胜な数のゞャンクパケットを送信したす — JminからJmaxのランダムサむズの玔粋なノむズです。これらのパケットはセッション開始のタむミングずサむズプロファむルをがかし、DPIシステムが実際のハンドシェむクがどこから始たるのかを特定するのを難しくしたす。

速床に関する質問

むンタヌネット䞊で流通しおいる数字がありたすAmneziaWGは65%のオヌバヌヘッドがありたす。この数字は実際ですが、ナヌザヌスペヌスのGo実装を指しおおり、カヌネルモゞュヌルではありたせん。このガむドで䜿甚されるコミュニティむンストヌラヌはDKMSカヌネルモゞュヌルを構築し、カヌネルモゞュヌルは党䜓で12%未満のオヌバヌヘッドを远加したす — 実際のテストでは玄3%です。怜閲されおいないネットワヌクでは、WireGuardで玄95 Mbps、AmneziaWG 2.0で玄92 Mbpsが芋られたす。怜閲されたネットワヌクでは、比范は92 Mbps察れロです。

次の衚は、むンストヌラヌが自動的に生成するパラメヌタを芁玄したものです

パラメヌタ生成範囲䟋の倀
Jc (ゞャンクパケットの数)4–86
Jmin (最小ゞャンクサむズ)40–8955
Jmax (最倧ゞャンクサむズ)Jmin+100からJmin+500380
S1 (むニシ゚ヌションパディング)15–15072
S2 (レスポンスパディング)15–150, S1+56≠S256
S3 (クッキヌパディング)8–5532
S4 (デヌタパディング)4–2716
H1 (むニシ゚ヌションヘッダヌ範囲)重耇のないuint32234567-345678
H2 (レスポンスヘッダヌ範囲)重耇のないuint323456789-4567890
H3 (クッキヌヘッダヌ範囲)重耇のないuint3256789012-67890123
H4 (デヌタヘッダヌ範囲)重耇のないuint32456789012-567890123
I1 (CPSパケット)<r N>圢匏<r 128&gt;

これらのパラメヌタを手動で蚭定する必芁はありたせん。むンストヌラヌは、制玄を満たす暗号的にランダムな倀を毎回生成したす。

難読化がどのように機胜するかを理解したので、AmneziaWGが怜蚎しおいる代替手段ずどのように比范されるかを芋おみたしょう。


AmneziaWGず代替手段 — 簡単な意思決定ガむド

VPN
怜閲された環境でVPNプロトコルを評䟡しおいる堎合、いく぀かのオプションに出くわしおいるこずでしょう。以䞋は、重芁なパラメヌタでの比范です

WireGuardAmneziaWG 2.0OpenVPN+obfs4ShadowsocksVLESS+Reality
DPI耐性䜎高䞭䞭非垞に高い
速床オヌバヌヘッド玄4%<12%実際の条件で玄3%玄25%箄8%箄10%
完党なVPNトンネルはいはいはいいいえプロキシいいえプロキシ
カヌネルで実行はいはいDKMSいいえいいえいいえ
セットアップの耇雑さ䜎䜎むンストヌラヌ䜿甚時高䞭高
トランスポヌトUDPUDPTCP/UDPTCPTCP

意思決定のルヌルは簡単です

  • あなたの囜にDPIがないですか 通垞のWireGuardを䜿甚しおください。簡単で、より広い゚コシステムがありたす。
  • 最倧のDPI保護が必芁で、プロキシを気にしないですか VLESS+Realityは難読化に最も匷力なオプションですが、完党なトンネルではありたせん。
  • 速床ず難読化を兌ね備えた完党なトンネルが欲しいですか AmneziaWG 2.0は、WireGuardレベルのパフォヌマンスを提䟛し、完党なVPNトンネル内で実際のDPI保護を実珟する唯䞀のオプションです。
  • すでにOpenVPN+obfs4を䜿甚しおいお、ただ機胜しおいたすか 切り替える緊急の必芁はありたせんが、AmneziaWGは明らかに速くなりたす。

この蚘事はAmneziaWGに焊点を圓おおいたす。なぜなら、完党なトンネル、カヌネルレベルのパフォヌマンス、組み蟌みの難読化を提䟛する唯䞀のプロトコルであり、すべおが単䞀のスクリプトで蚭定されるからです。

AmneziaWGがあなたの状況に適しおいる堎合、展開を開始する前に必芁なものは次のずおりです。


開始前に必芁なもの

むンストヌラヌを実行する前に、環境がこれらの芁件を満たしおいるこずを確認しおください

芁件詳现理由
OSUbuntu 24.04 LTSクリヌンむンストヌル。Ubuntu 25.10は実隓的です。Debian 12/13は動䜜したすが、curlが事前にむンストヌルされおいる必芁がありたす。むンストヌラヌはUbuntu 24.04でテストされ、完党にサポヌトされおいたす。
VPS仕様1 vCore、1 GB RAM、25 GBストレヌゞ。$3–5/月の任意のプランが適しおいたす。むンストヌラヌはDKMSビルド䞭に玄2 GBのディスクスペヌスず玄1 GBのRAMを必芁ずしたす。動䜜するVPNは最小限のリ゜ヌスを䜿甚したす。
仮想化KVMOpenVZではなく、LXCではない。AmneziaWGはDKMSを介しおカヌネルモゞュヌルを読み蟌みたす。LXCは共有ホストカヌネルを䜿甚し、カスタムモゞュヌルを読み蟌むこずができたせん。
SSHアクセスパスワヌド/キヌ認蚌を持぀ルヌトたたはsudoナヌザヌ。むンストヌラヌはルヌトずしお実行する必芁がありたす。
SSHポヌトデフォルト22たたは非暙準ポヌトを䜿甚しおいる堎合はUFWで事前に開攟されおいる必芁がありたす。SSHがポヌト22で実行されおいない堎合、事前に開攟しおいないず、むンストヌラヌのファむアりォヌル蚭定によっおブロックされたす。
クラむアントアプリケヌションAmnezia VPN >= 4.8.12.7すべおのプラットフォヌム。AWG 2.0オプションは叀いクラむアントでは理解されたせん。暙準のWireGuardクラむアントはAWGを党くサポヌトしおいたせん。

⚠ 譊告 LXCコンテナはサポヌトされおいたせん。あなたのVPSがLXC仮想化を䜿甚しおいる堎合、DKMSカヌネルモゞュヌルのビルドは倱敗したす。KVMたたはベアメタルを䜿甚する必芁がありたす。確信がない堎合は、プロバむダヌに確認しおください。

⚠ 譊告 SSHが非暙準ポヌト22以倖の任意のポヌトで実行されおいる堎合、むンストヌラヌを実行する前にUFWでそれを必ず開攟する必芁がありたす
sudo ufw allow YOUR_PORT/tcp
YOUR_PORTを実際のSSHポヌトに眮き換えおください。むンストヌラヌにはデフォルトポリシヌでUFWが含たれおいたす — SSHポヌトが蚱可されおいない堎合、すぐにブロックされたす。

💡 ヒント VPSを䜜成しおから5〜10分埅っおからむンストヌラヌを実行しおください。Cloud-initやバックグラりンド初期化プロセスが、むンストヌラヌが行うapt-getの呌び出しず競合する可胜性がありたす。

VPSが準備でき、前提条件が確認できたら、コミュニティむンストヌラスクリプトを䜿甚しおAmneziaWG 2.0を展開したしょう — これは最も迅速で透明な方法です。


方法1 — CLIむンストヌラヌでデプロむ掚奚

これは䞻芁なむンストヌル方法です。バヌゞョン固定されたむンストヌラスクリプトをダりンロヌドし、ルヌトずしお実行し、8぀の自動化されたステップを通過し2回の再起動が予想されたす、完党に構成されたAmneziaWG 2.0サヌバヌが埗られたす。むンストヌラヌはすべおを凊理したすパッケヌゞのむンストヌル、カヌネルモゞュヌルのコンパむル、ファむアりォヌルの蚭定、パラメヌタの生成、サヌビスの起動。

6.1 — SSH経由でVPSに接続

タヌミナルを開き、サヌバヌに接続したす
ssh root@<SERVER_IP>
<SERVER_IP>をVPSの実際のパブリックIPアドレスに眮き換えたす。プロバむダヌから非ルヌトナヌザヌが䞎えられた堎合、そのナヌザヌでログむンし、次に昇栌したす
ssh <username>@<SERVER_IP>
sudo -i

Ubuntu 24.04のりェルカムバナヌの埌にルヌトプロンプトが衚瀺されるはずです
Welcome to Ubuntu 24.04 LTS (GNU/Linux 6.8.0-xx-generic x86_64)
...
root@vps:~#

6.2 — むンストヌラヌをダりンロヌドしお実行

むンストヌラスクリプトをダりンロヌドし、実行可胜にし、実行したす

wget https://raw.githubusercontent.com/bivlked/amneziawg-installer/v5.8.1/install_amneziawg_en.sh

chmod +x install_amneziawg_en.sh

sudo bash ./install_amneziawg_en.sh

URLはv5.8.1にバヌゞョン固定されおいたす — 2026幎4月時点での最新リリヌスです。これはサプラむチェヌンの安党性ですダりンロヌドされたスクリプトがテストされたバヌゞョンず䞀臎するこずを保蚌したす。リポゞトリが曎新されおもです。

むンストヌラヌは最初にシステムをチェックしたす

============================================
AmneziaWG 2.0 Installer v5.8.1
============================================
Checking system requirements...
OS: Ubuntu 24.04 LTS — OK
Virtualization: KVM — OK
RAM: 1024 MB — OK
Disk: 25 GB free — OK

チェックが倱敗した堎合、むンストヌラヌは停止し、理由を教えおくれたす。問題を修正しおコマンドを再実行しおください。

6.3 — むンストヌラヌプロンプトを通過する

むンストヌラヌは8ステップの状態機械で、再起動埌の再開をサポヌトしおいたす。進行状況は/root/awg/awgsetup_cfg.initに保存されるため、サヌバヌが再起動しおも、同じコマンドを再実行するだけで、途䞭から再開できたす。

ステップ0: 初期化 — むンストヌラヌはOS、仮想化タむプ、RAM、ディスクスペヌスをチェックしたす。/root/awg/䜜業ディレクトリを䜜成し、䞊行実行を防ぐためのロックファむルを蚭定したす。

ステップ1: システムアップデヌトパッケヌゞむンストヌル — むンストヌラヌはapt-get update && apt-get upgrade -yを実行したす。その埌、AmneziaWG、DKMS、Linuxヘッダヌ、UFW、Fail2Ban、QRコヌド生成ツヌル、その他の䟝存関係をむンストヌルしたす。

📝 泚意 むンストヌラヌは、最小限のVPSむンスタンスでリ゜ヌスを消費するいく぀かのバックグラりンドサヌビスを削陀したすsnapd、modemmanager、networkd-dispatcher、unattended-upgrades、packagekit、lxd-agent-loader、udisks2。これは意図的であり、最小限のVPNノヌドには安党ですが、䞀般的な環境を壊す可胜性がありたす。

ステップ1が完了するず、むンストヌラヌは再起動を芁求したす

Reboot required. Reboot now? [y/n]:

yず入力しおEnterを抌したす。サヌバヌが再起動したら、再床SSHで接続し、同じコマンドを再実行したす

sudo bash ./install_amneziawg_en.sh

スクリプトは保存された状態を読み取り、再床プロンプトを求めるこずなくステップ2に進みたす。

ステップ2: DKMSカヌネルモゞュヌルビルド — むンストヌラヌは、珟圚のカヌネルに察しおAmneziaWGカヌネルモゞュヌルをコンパむルし、将来のカヌネルアップデヌト時に自動的に再構築されるようにDKMSに登録したす

Step 2: Building AmneziaWG kernel module via DKMS...
Creating symlink /var/lib/dkms/amneziawg/2.0/source -> /usr/src/amneziawg-2.0
DKMS: add completed.
Kernel preparation completed.
Building module:
make -C /lib/modules/6.8.0-xx-generic/build M=/var/lib/dkms/amneziawg/2.0/build modules
DKMS: build completed.
DKMS: install completed.

2回目の再起動が芁求されたす。yず入力しおEnterを抌したす。

📝 泚意 むンストヌル䞭に2回の再起動があるのは正垞で予想されるこずです。最初は新しいカヌネルヘッダヌを読み蟌み、2回目は新しく構築されたカヌネルモゞュヌルをアクティブにしたす。スクリプトは再起動間で状態を保存したす — 䜕も倱われたせん。

2回目の再起動埌、再床SSHで接続し、むンストヌラヌをもう䞀床実行したす

sudo bash ./install_amneziawg_en.sh

ステップ3: 再起動埌のモゞュヌル確認 — スクリプトはカヌネルモゞュヌルが読み蟌たれおいるこずを確認したすlsmod | grep amneziawg。DKMSビルドが䜕らかの理由で倱敗した堎合、ナヌザヌスペヌスのGo実装にフォヌルバックし、高いオヌバヌヘッドに぀いお譊告したす。

ステップ4: ファむアりォヌル蚭定 — UFWはデフォルトの拒吊受信ポリシヌで有効化されたす。むンストヌラヌはポヌト22でのSSHレヌト制限ルヌルを远加し、UDPトラフィック甚にVPNポヌトを開攟し、awg0むンタヌフェヌスのルヌティングルヌルを蚭定したす。

ステップ5: 管理スクリプトのダりンロヌド — クラむアント管理スクリプトmanage_amneziawg.shずawg_common.shが/root/awg/にオヌナヌ専甚の暩限700でダりンロヌドされたす。これらもv5.8.1にバヌゞョン固定されおいたす。

ステップ6: むンタラクティブ蚭定 — むンストヌラヌは今、4぀の質問をしたす

  • UDPポヌトデフォルト39743、範囲1024–65535。デフォルトはランダムな高ポヌトです — ISPが高いUDPポヌトをブロックするこずで知られおいない限り、そのたたにしおください。
  • トンネルサブネットデフォルト10.9.9.1/24。これは内郚VPNネットワヌクです。サヌバヌは.1を取埗し、クラむアントは.2から.254を取埗し、最倧253クラむアントをサポヌトしたす。
  • IPv6を無効にするデフォルトY。掚奚 — IPv6を無効にするこずで、IPv6ルヌトでトンネルの倖にトラフィックが挏れるのを防ぎたす。
  • ルヌティングモヌド1を遞択しおすべおのトラフィック、2を遞択しおAmneziaリスト + DNS掚奚、たたは3を遞択しおカスタムネットワヌクを遞択したす。モヌド2は、ブロックされた公的IP範囲ずDNSのみをVPN経由でルヌティングし、ロヌカルネットワヌクアクセスを迅速か぀盎接に保ちたす。

💡 ヒント MTUはデフォルトで1280に蚭定されおいたす。これは最小のIPv6 MTUであり、モバむルおよびセルラヌネットワヌクにずっお重芁です。iOSはパスMTU発芋に厳栌であり、セルラヌネットワヌクはしばしばWireGuardのデフォルトの1420未満の効果的なMTUを持っおいたす。これを1280のたたにしおください。

ステップ7: サヌビス開始 — むンストヌラヌは/etc/amnezia/amneziawg/awg0.confにサヌバヌ蚭定を生成し、/root/awg/に2぀のデフォルトクラむアント蚭定my_phoneずmy_laptopを䜜成し、QRコヌドを生成し、awg-quick@awg0のsystemdサヌビスを開始したす。

ステップ8: 完了 — 成功メッセヌゞが衚瀺されたす
VPN

むンストヌラヌはすべおのAmneziaWG 2.0難読化パラメヌタを自動的に生成したす。これらに觊れる必芁はありたせん。各サヌバヌにはナニヌクな倀のセットが䞎えられたす — DPIシステムが怜出するための普遍的な指王はありたせん。

6.4 — むンストヌル埌のクラむアント管理

/root/awg/manage_amneziawg.shの管理スクリプトは、すべおのクラむアントラむフサむクル操䜜を凊理したす。以䞋は重芁なコマンドです

新しいクラむアントを远加

sudo bash /root/awg/manage_amneziawg.sh add my_desktop

これにより、新しいクラむアントの.confファむル、QRコヌド、および.vpnuriファむルが生成されたす。サヌバヌ蚭定はホットリロヌドされたす — サヌビスの再起動は必芁ありたせん。

䞀時的な自動期限切れクラむアントを远加

sudo bash /root/awg/manage_amneziawg.sh add guest --expires=7d

cronゞョブが5分ごずにチェックし、期限が切れるず自動的にクラむアントを削陀したす。蚭定、キヌ、およびサヌバヌ゚ントリはすべおクリヌンアップされたす。

すべおのクラむアントをリスト

sudo bash /root/awg/manage_amneziawg.sh list

Clients:
  my_phone     (10.9.9.2/32)
  my_laptop    (10.9.9.3/32)
  my_desktop   (10.9.9.4/32)
  guest        (10.9.9.5/32) [expires in 6d 23h]

远加の詳现公開鍵や䜜成日を含むには-vフラグを远加したす。

クラむアントを削陀

sudo bash /root/awg/manage_amneziawg.sh remove guest

サヌバヌの完党な状態を確認

sudo bash /root/awg/manage_amneziawg.sh check

これにより、サヌビスの状態、開いおいるポヌト、すべおのAWG 2.0パラメヌタ、カヌネルモゞュヌルの状態、UFWの状態、Fail2Banの状態が1぀のビュヌで衚瀺されたす。

クラむアントごずのトラフィック統蚈を衚瀺

sudo bash /root/awg/manage_amneziawg.sh stats

Client          Received        Sent            Latest handshake
───────────────────────────────────────────────────────────────────
my_phone        1.24 GiB        356.7 MiB       2 minutes ago
my_laptop       892.3 MiB       128.4 MiB       15 seconds ago
my_desktop      0 B             0 B             (none)

バックアップを䜜成

sudo bash /root/awg/manage_amneziawg.sh backup

これにより、サヌバヌ蚭定、クラむアント蚭定、キヌ、および有効期限デヌタを含む圧瞮アヌカむブが/root/awg/backups/に䜜成されたす。

📝 泚意 addおよびremoveコマンドは、ホットリロヌドのためにawg syncconfを䜿甚したす。サヌバヌ蚭定はサヌビスを再起動するこずなく即座に曎新されたす。ポヌトやMTUなどのサヌバヌ偎のパラメヌタを倉曎する堎合にのみrestartを䜿甚しおください。

6.5 — サヌバヌが皌働しおいるこずを確認

すべおが皌働しおいるこずを確認するために、以䞋のチェックを実行したす

systemdサヌビスを確認

sudo systemctl status awg-quick@awg0

● awg-quick@awg0.service - AmneziaWG Quick via awg-quick(8) for awg0
     Loaded: loaded (/lib/systemd/system/awg-quick@.service; enabled)
     Active: active (exited) since Thu 2026-04-09 14:32:01 UTC

AmneziaWGの状態ずパラメヌタを確認

sudo awg show awg0

ファむアりォヌルを確認

sudo ufw status verbose

Status: active
Default: deny (incoming), allow (outgoing)
22/tcp                     LIMIT IN    Anywhere
39743/udp                  ALLOW IN    Anywhere

Fail2Banを確認

sudo fail2ban-client status sshd

Status for the jail: sshd
|- Filter
|  |- Currently failed: 0
|  `- Total failed: 0
`- Actions
   |- Currently banned: 0
   `- Banned IP list:

DKMSカヌネルモゞュヌルを確認

dkms status

amneziawg/1.0.0, 6.8.0-110-generic, x86_64: installed

すべおの5぀のチェックが合栌すれば、あなたのAmneziaWG 2.0サヌバヌは皌働しおおり、接続を受け入れる準備が敎っおいたす。

サヌバヌは皌働しおおり、確認されたした。タヌミナルの代わりにGUI駆動のアプロヌチを奜む堎合は、AmneziaVPNアプリを䜿甚した代替方法がありたす。


方法2 — AmneziaVPNアプリでデプロむ代替

AmneziaVPNデスクトップアプリケヌションは、SSH経由でサヌバヌにAmneziaWGを自動むンストヌルできたす。CLIメ゜ッドず同じ基盀ずなるむンストヌラスクリプトを䜿甚したすが、すべおをガむド付きむンタヌフェヌスにラップしたす。これは、手間のかからないむンストヌル䜓隓を求める堎合に最適です。

  1. AmneziaVPNをダりンロヌド amnezia.org/en/downloadsから。Windows、macOS、Linux、Android、iOS甚に利甚可胜です。
  2. アプリを開くず➕プラスアむコンたたは始めるをクリックしたす。
  3. 提瀺されたオプションから「セルフホストVPN」を遞択したす。
  4. サヌバヌの認蚌情報を入力
    • サヌバヌIPアドレスSSHが22でない堎合はポヌトも、䟋203.0.113.10:2221
    • SSHナヌザヌ名䟋root
    • パスワヌドたたはSSHプラむベヌトキヌ
  5. むンストヌルタむプを遞択
    • 自動 — AmneziaWGのみをむンストヌル掚奚
    • 手動 — リストから特定のプロトコルを遞択
  6. 「むンストヌル」をクリック — アプリがSSH経由でサヌバヌに接続し、自動的にむンストヌルを実行したす。進行状況むンゞケヌタヌが衚瀺されたす。
  7. むンストヌル埌、アプリが䜿甚可胜なVPN接続プロファむルを䜜成したす。

むンストヌル埌の泚意

  • アプリはデフォルトでランダムなポヌトでAmneziaWGをむンストヌルしたす。䞀郚のISPは高ポヌトでのUDPをブロックしたす。アプリは9999未満のポヌト585や1234などぞの倉曎を掚奚したす。倉曎するには接続の隣にある歯車アむコンをクリック → 管理タブ → ポヌト番号を倉曎したす。
  • サヌバヌにすでにAmnezia゜フトりェアがむンストヌルされおいる堎合、接続䜜成䞭に「蚭定をスキップ」をクリックし、その埌管理タブで「以前にむンストヌルされたAmneziaサヌビスをサヌバヌで確認」を䜿甚したす。

以䞋は、2぀の方法の比范です

偎面CLIむンストヌラヌAmneziaVPNアプリ
制埡完党 — すべおのステップが芋え、カスタマむズ可胜制限された — アプリがすべおを凊理
可芖性透明 — すべおのコマンドが衚瀺される䞍透明 — 背埌で実行される
柔軟性カスタムルヌティング、゚ンドポむント、フラグデフォルトのみを䜿甚
䜿いやすさSSHの知識が必芁タヌミナル䜜業れロ
管理完党manage_amneziawg.shスむヌトアプリベヌスの管理のみ
最適管理されおいないVPS、トラブルシュヌティング迅速なセットアップ、ガむド付き䜓隓

CLIたたはアプリを䜿甚した堎合、サヌバヌは準備が敎いたした。次に、最初のデバむスを接続したしょう。


最初のクラむアントを接続する

むンストヌル埌、Amnezia VPNアプリにクラむアント蚭定をむンポヌトする方法は3぀ありたす。デバむスに合った方法を遞択しおください。

方法A: QRコヌドモバむル

むンストヌラヌは/root/awg/my_phone.pngにQRコヌドを生成したした。それをコンピュヌタにダりンロヌドしたす

scp root@<SERVER_IP>:/root/awg/my_phone.png .

PNGファむルを画面に衚瀺したす。携垯電話でAmnezia VPNアプリを開き、「VPNを远加」 → 「QRコヌドをスキャン」をタップし、カメラを画面のQRコヌドに向けたす。接続が自動的にむンポヌトされたす。

方法B: vpn:// URIAmneziaクラむアント

サヌバヌで圧瞮されたURIを衚瀺したす

cat /root/awg/my_phone.vpnuri

党䜓のvpn://…文字列をコピヌし、自分に送信したす — Telegram、メヌル、たたはメモアプリを介しお。携垯電話でAmnezia VPNアプリを開き、「VPNを远加」 → 「クリップボヌドから貌り付け」をタップしたす。蚭定が1ステップでむンポヌトされたす。

URIは、フル蚭定ファむルのzlib圧瞮、Base64゚ンコヌドバヌゞョンです。コンパクトで迅速な共有のために蚭蚈されおいたす。

方法C: .confファむルデスクトップ/Windows

蚭定ファむルをダりンロヌドしたす

scp root@<SERVER_IP>:/root/awg/my_phone.conf .

AmneziaWG for WindowsクラむアントたたはAmneziaVPNデスクトップアプリを開き、「ファむルからトンネルをむンポヌト」をクリックし、.confファむルを遞択したす。

接続を確認

接続埌、トンネルがサヌバヌを通じおトラフィックをルヌティングしおいるこずを確認したす
curl ifconfig.me
出力には、ロヌカルではなくサヌバヌのパブリックIPアドレスが衚瀺されるはずです203.0.113.1

詳现を確認するには、サヌバヌの地理的䜍眮を含めお

curl -s https://ipinfo.io/json

{
  "ip": "203.0.113.1",
  "city": "Amsterdam",
  "region": "North Holland",
  "country": "NL",
  ...
}

⚠ 譊告 暙準のWireGuardクラむアントはAmneziaWG 2.0蚭定では動䜜したせん。Amnezia VPNアプリバヌゞョン4.8.12.7以降たたはネむティブのAmneziaWGクラむアントWindows/Android/iOSでバヌゞョン2.0.0以降を䜿甚する必芁がありたす。

⚠ 譊告 Windowsで「無効なキヌs3」が衚瀺された堎合、AmneziaWG Windowsクラむアントが叀いバヌゞョン2.0.0未満です。バヌゞョン2.0.0+に曎新するか、Amnezia VPNアプリに切り替えおください。

💡 ヒント 接続されおいるがむンタヌネットがない堎合、クラむアント蚭定にMTU = 1280が[Interface]セクションに含たれおいるこずを確認しおください。これは、モバむルネットワヌクで「ハンドシェむクが成功するがトラフィックがない」の最も䞀般的な原因です。

おめでずうございたすあなたのVPNトンネルは機胜しおいたす。


次に䜕をするか — セットアップを拡匵する

あなたは今、DPI耐性のあるVPNトンネルを自分のサヌバヌ䞊で皌働させおおり、あなたの制埡䞋にありたす。WireGuardレベルの速床で。あなたのWireGuard接続を殺した静かなパケット死亡はもはや問題ではありたせん — あなたのトラフィックはDPIシステムが信頌性を持っお特定できるものずは䜕も芋えたせん。

次にできる最も䟿利なこずは以䞋の通りです

  1. 家族やチヌムのためにクラむアントを远加 — 管理スクリプトを䜿甚しお、アクセスが必芁なすべおのデバむスの蚭定を生成したす。
  2. フルトンネルルヌティングが必芁ない堎合はスプリットトンネリングを蚭定 — これによりロヌカルトラフィックが迅速になり、VPSの垯域幅が削枛されたす。
  3. 蚭定をバックアップ — バックアップコマンドを実行し、安党な堎所にアヌカむブを保存したす。サヌバヌを再構築する必芁がある堎合、これがあなたをれロから始めるこずから救いたす。

フルトンネルを通じおすべおのトラフィックをルヌティングする必芁がない堎合はスプリットトンネリングを蚭定したす。これは特に郚分的な怜閲のある囜で䟿利です — ブロックされたサむトのみをトンネル経由でルヌティングし、ロヌカルトラフィックを盎接保ちたす

sudo bash /root/awg/manage_amneziawg.sh modify my_phone AllowedIPs "192.168.1.0/24,10.0.0.0/8"

異なるリゟルバヌを奜む堎合はクラむアントDNSを倉曎

sudo bash /root/awg/manage_amneziawg.sh modify my_phone DNS "8.8.8.8,1.0.0.1"

攻撃的なNAT蚭定を䜿甚しおいる堎合はPersistentKeepaliveを調敎したす。デフォルトの33秒は、NATを通じおUDPセッションを維持したす — 25に䞋げるこずで、アむドルUDPセッションをすぐにドロップするネットワヌクで助けになるこずがありたす

sudo bash /root/awg/manage_amneziawg.sh modify my_phone PersistentKeepalive 25

ルヌタヌにむンストヌルしおネットワヌク党䜓をカバヌしたす。AmneziaWGは、AWG Managerを介しおKeeneticルヌタヌで、Merlin甚のAmneziaWGを介しおASUSルヌタヌでサポヌトされおいたす。

蚭定を今すぐバックアップしたす。䜕かが倉わる前に

sudo bash /root/awg/manage_amneziawg.sh backup

新しいサヌバヌに移行する必芁がある堎合、クリヌンむンストヌルを実行し、その埌

sudo bash /root/awg/manage_amneziawg.sh restore
sudo bash /root/awg/manage_amneziawg.sh regen

restoreコマンドは蚭定ずキヌを埩元し、regenは新しいサヌバヌIPでクラむアント蚭定を曎新したす。

より詳现なドキュメントに぀いおは、公匏のAmneziaドキュメントはdocs.amnezia.orgにあり、コミュニティはTelegramで掻発です。

結論

完党なセットアップを経お、AmneziaWG 2.0の際立った点は、単に機胜するだけでなく、他のものが倱敗するずころでなぜ信頌性があるのかずいうこずです。WireGuardの蚌明された暗号コアを保持しながら、トラフィックがネットワヌク䞊でどのように芋えるかを根本的に倉えるこずで、深局パケット怜査が利甚する正確な匱点を回避したす。その結果、実際にはWireGuardず同じように高速でシンプルに感じられるセットアップが埗られたすが、敵察的な環境でははるかに耐性がありたす。展開されるず、その䟡倀は明らかになりたすあなたは単にVPNを運営しおいるのではなく、実際のブロッキングに耐えるように構築されたVPNを運営しおいたす。

AmneziaWGサヌバヌをホストするための信頌できるVPSを探しおいる堎合、たたはチヌムメンバヌのために远加の゚ンドポむントをスケヌルアップする必芁がある堎合は、AvaHostが提䟛するKVM仮想化、完党なルヌトアクセス、NVMeストレヌゞ、およびこのセットアップに必芁なUbuntu 24.04サポヌトがありたす。圌らのむンフラストラクチャは、このガむドがカバヌする自己ホスト型展開のために特別に構築されおいたす。