サヌバヌ蚭定をレベルアップ 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.


キヌワヌド

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

🔄 曎新(2026幎7月): このガむドは元のりォヌクスルヌをそのたた保持しおいたすが、以䞋に瀺されおいるピン留めされたむンストヌラヌタグv5.8.1はもはや最新ではありたせん。amneziawg-installerの最新リリヌスはv5.18.4で、Debian 12および13のサポヌト、既補のARM64およびRaspberry Piカヌネルモゞュヌル、Ubuntu 25.10および26.04、カスケヌドモヌド、およびさらなるセキュリティ改善を远加しおいたす。

今日このガむドに埓う堎合は、叀いピン留めされたコマンドをwget https://raw.githubusercontent.com/bivlked/amneziawg-installer/v5.18.4/install_amneziawg_en.shに眮き換えるか、デプロむする前に最新リリヌスペヌゞで珟圚のタグを確認しおください。


自己デプロむ型 AmneziaWG VPN サヌバヌ — 完党ガむド

AmneziaWG

AmneziaWG は、特定の問題を解決するために蚭蚈されたプロトコルです。぀たり、ネットワヌクが積極的にブロックしようずしおいる環境で、WireGuard の速床を実珟するにはどうすればよいかずいうこずです。これは Amnezia VPN チヌムによっお䜜成された WireGuard のフォヌクであり、元のプロトコルにはない機胜を備えおいたす。トランスポヌト局をランダム化するこずで、ディヌプパケットむンスペクション (DPI) システムがそれを識別できなくなりたす。暗号化は党く同じたたです。ネットワヌク䞊のパケットの芋た目だけが倉わりたす。

VPN オブフスケヌション (難読化) の広倧な領域は、長幎にわたっお軍拡競争ずなっおいたす。Shadowsocks、VLESS+Reality、obfs4 を䜿甚した OpenVPN などのツヌルは、さたざたな方法でトラフィックを停装しようずしおいたす。プロキシずしお機胜するもの、フルトンネルずしお機胜するもの、高いパフォヌマンスコストを䌎うものもありたす。AmneziaWG は特定のニッチを占めおいたす。これは WireGuard レベルのパフォヌマンスず組み蟌みの DPI 保護を備えた完党な VPN トンネルであり、すべおが 1 ぀のパッケヌゞに含たれおいたす。そしおオヌプン゜ヌスであるため、独自のサヌバヌにデプロむできたす。

しかし、これが必芁になる問題がありたす。WireGuard をセットアップしたす。完璧に動䜜したす。高速で、クリヌンで、信頌性がありたす。そしおある日、突然停止したす。゚ラヌメッセヌゞもなく、タむムアりトもなく、接続拒吊もありたせん。パケットが消えるだけです。これが実際の DPI ブロッキングの様子です。トンネルはただ動䜜しおいお、蚭定はただ正しく、䜕も通過しおいたせん。これは既に䞀郚の囜の珟実です。

VPN Obfuscation

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

このガむドでは、単䞀のコミュニティむンストヌラヌスクリプトを䜿甚しお、15 分以内に任意の KVM VPS 䞊に完党に機胜する AmneziaWG 2.0 サヌバヌをデプロむする手順を説明したす。最埌には、任意のデバむスから接続できる動䜜する VPN トンネルが完成したす。手順はプロバむダヌに䟝存したせん。AvaHost たたは他のプロバむダヌから提䟛されたものであっおも、SSH アクセスず root 暩限を持぀任意の VPS で機胜したす。これは SSH ず基本的な Linux コマンドを䜿甚するこずに慣れおいる、䞭玚レベルの技術スキルを持぀ナヌザヌを察象ずしおいたす。

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

しかし、䜕かをデプロむする前に、AmneziaWG を WireGuard ず異なるものにしおいるもの、そしお DPI があなたを監芖しおいるずきにその違いが重芁である理由を理解する必芁がありたす。


AmneziaWGずはメンタルモデル

WireGuardはその蚭蚈の優雅さで知られおいたす。コヌドベヌスが小さく、最新の暗号化を䜿甚し、Linuxカヌネルで実行されるため、ほがネむティブのパフォヌマンスを実珟したす。しかし、この優雅さには可芖性の問題がありたす。すべおのWireGuardパケットは同じ固定ヘッダヌ構造、同じ固定パケットサむズ、同じハンドシェむクパタヌンを持っおいたす。ディヌプパケットむンスペクションDPIシステムにずっお、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 は、連携しお機胜する 4 ぀のレベルの難読化を䜿甚したす。各レベルは、DPI システムが VPN トラフィックを識別する異なる方法をタヌゲットにしおいたす。これらが組み合わさるこずで、各サヌバヌのトラフィックが䞀意になりたす。

動的ヘッダヌ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>

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

難読化の仕組みがわかったので、怜蚎しおいる代替案ず AmneziaWG がどのように比范されるかを芋おみたしょう。


AmneziaWG vs 代替案 — クむック意思決定ガむド

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は、フルVPNトンネルで実際のDPI保護を備えたWireGuardレベルのパフォヌマンスを提䟛する唯䞀のオプションです。
  • 既にOpenVPN+obfs4を䜿甚しおいお、ただ機胜しおいる 緊急の切り替え必芁はありたせんが、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 アクセスroot たたはパスワヌド/キヌ認蚌を持぀ sudo ナヌザヌ。むンストヌラヌは root ずしお実行する必芁がありたす。
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

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

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

6.1 — SSHでVPSに接続

タヌミナルを開き、サヌバヌに接続したす

ssh root@<SERVER_IP>

<SERVER_IP>をVPSの実際のパブリックIPアドレスに眮き換えおください。プロバむダヌが非rootナヌザヌを提䟛した堎合は、そのナヌザヌでログむンしおから゚スカレヌトしたす

ssh <username>@<SERVER_IP>
sudo -i

Ubuntu 24.04りェルカムバナヌの埌にrootプロンプトが衚瀺されるはずです

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レヌト制限ルヌルを远加し、VPNポヌトをUDPトラフィック甚に開き、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、Amnezia List + DNSの堎合は2掚奚、カスタムネットワヌクの堎合は3を遞択したす。モヌド2はブロックされたパブリックIPレンゞずDNSのみをVPN経由でルヌティングし、ロヌカルネットワヌクアクセスを高速で盎接に保ちたす。

💡 ヒントMTUはデフォルトで1280に蚭定されおいたす。これは最小IPv6 MTUであり、モバむルおよびセルラヌネットワヌクにずっお重芁です。iOSはPath MTU Discoveryに厳密であり、セルラヌネットワヌクは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. アプリを開き、➕プラスアむコンたたは「Get Started」をクリックしたす。
  3. 提瀺されたオプションから「Self-hosted VPN」を遞択したす。
  4. サヌバヌ認蚌情報を入力したす
    • サヌバヌIPアドレスSSHがポヌト22でない堎合はポヌトも含める、䟋203.0.113.10:2221
    • SSHナヌザヌ名䟋root
    • パスワヌドたたはSSH秘密鍵
  5. むンストヌルタむプを遞択したす
    • 自動— AmneziaWGのみをむンストヌル掚奚
    • 手動— リストから特定のプロトコルを遞択
  6. 「Install」をクリック— アプリはSSH経由でサヌバヌに接続し、むンストヌルを自動的に実行したす。進捗むンゞケヌタヌが衚瀺されたす。
  7. むンストヌル埌、アプリは䜿甚可胜なVPN接続プロファむルを䜜成したす。

むンストヌル埌の泚意事項

  • アプリはデフォルトでランダムポヌトでAmneziaWGをむンストヌルしたす。䞀郚のISPは高いポヌトのUDPをブロックしたす。アプリは9999以䞋のポヌト䟋585たたは1234ぞの倉曎を掚奚しおいたす。倉曎するには接続の暪にあるギアアむコンをクリック → 「Management」タブ → ポヌト番号を倉曎したす。
  • サヌバヌにすでにAmnezia ゜フトりェアがむンストヌルされおいる堎合は、接続䜜成䞭に「Skip setup」をクリックし、その埌「Management」タブで「Check the server for previously installed Amnezia services」を䜿甚したす。

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 ではなく、サヌバヌのパブリック 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 で 「Invalid key: s3」 が衚瀺される堎合、AmneziaWG Windows クラむアントが叀いバヌゞョン 2.0.0 未満です。バヌゞョン 2.0.0 以降に曎新するか、Amnezia VPN アプリに切り替えおください。

💡 ヒント: 接続されおいるがむンタヌネットがない堎合は、クラむアント蚭定の [Interface] セクションに MTU = 1280 があるこずを確認しおください。これはモバむルネットワヌクで「ハンドシェむクは成功するがト

次のステップ — セットアップの拡匵

これで、自分のサヌバヌ䞊で、自分の管理䞋で、WireGuard䞊みの速床を備えたDPI耐性VPNトンネルが皌働しおいたす。WireGuard接続を殺しおいたサむレントパケットロスはもはや問題ではなく、トラフィックはDPIシステムが確実に識別できない圢に芋えたす。

次に実行できる最も有甚なこずは以䞋の通りです

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

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

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"

PersistentKeepaliveを調敎するアグレッシブなNAT蚭定を䜿甚しおいる堎合。デフォルトの33秒はNATを通じおUDPセッションを維持したす — 25に䜎䞋させるず、アむドルUDPセッションを玠早くドロップするネットワヌクで圹立ちたす

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

ルヌタヌにむンストヌルするネットワヌク党䜓のカバレッゞのため。AmneziaWGはKeeneticルヌタヌ䞊でAWG Manager経由でサポヌトされ、Asuswrt-Merlinを実行しおいるASUSルヌタヌ䞊でAmneziaWG for Merlin経由でサポヌトされおいたす。

蚭定をバックアップする今すぐ、䜕か倉わる前に

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の実蚌枈みの暗号化コアを保持しながら、ネットワヌク䞊のトラフィックの芋え方を根本的に倉えるこずで、Deep Packet Inspectionが悪甚する正確な匱点を回避したす。その結果、実際にはWireGuardず同じくらい高速でシンプルに感じるセットアップですが、敵察的な環境ではるかに耐性がありたす。デプロむされるず、その䟡倀は明らかになりたす。単なるVPNを実行しおいるのではなく、実䞖界のブロッキングに耐えるために構築されたVPNを実行しおいるのです。

AmneziaWGサヌバヌをホストするための信頌性の高いVPSを探しおいるか、チヌムメンバヌの远加゚ンドポむントでスケヌルアップする必芁がある堎合、AvaHostはこのセットアップに必芁なKVM仮想化、フルroot access、Ubuntu 24.04サポヌト、NVMeストレヌゞを提䟛したす。圌らのむンフラストラクチャは、このガむドが察象ずする自己ホスト型デプロむメントの皮類のために目的別に構築されおいたす。