[GH-ISSUE #850] Headless installation & CLI interface? #228

Open
opened 2026-10-13 20:16:00 +00:00 by bsakaguchi · 16 comments
Owner

Originally created by @rudenkornk on GitHub (Jun 12, 2024).
Original GitHub issue: https://github.com/amnezia-vpn/amnezia-client/issues/850

Describe the bug
Amnezia client is currently a GUI-first application requiring manual graphical installation and configuring.
Enabling and disabling VPN also requires to use GUI client.

Expected behavior

  1. Ability to perform a headless scripted installation.
  2. CLI client not requiring any graphical support.

Desktop (please complete the following information):

  • OS: Ubuntu 22.04-24.04, Fedora 38-40
Originally created by @rudenkornk on GitHub (Jun 12, 2024). Original GitHub issue: https://github.com/amnezia-vpn/amnezia-client/issues/850 **Describe the bug** Amnezia client is currently a GUI-first application requiring manual graphical installation and configuring. Enabling and disabling VPN also requires to use GUI client. **Expected behavior** 1. Ability to perform a headless scripted installation. 2. CLI client not requiring any graphical support. **Desktop (please complete the following information):** - OS: Ubuntu 22.04-24.04, Fedora 38-40
Author
Owner

@jeffangelion commented on GitHub (Jul 19, 2024):

About headless installation:

jeffangelion@redstar:~$ sudo ./AmneziaVPN_Linux_Installer.bin install
[0] Arguments: ./AmneziaVPN_Linux_Installer.bin, install
[3] Operations sanity check succeeded.
[10] OS: Debian GNU/Linux 12 (bookworm), architecture: x86_64
[10] Check if app already installed: false
[74] Loaded control script ":/metadata/installer-config/controlscript_js.js"
[74] No target directory specified, using default value: "/opt/AmneziaVPN"
[74] Preparing meta information download...
[81] Warning: QFont::setPixelSize: Pixel size <= 0 (-1)
[81] Selected components without dependencies:
org.amneziavpn.package
[81] Installation space required: "547.22 MB" Temporary space required: "256.00 MB" Local repository size: "0.00 bytes"
[82] Tmp and install directories are on the same volume. Volume mount point: "/" Free space available: "76.94 GB"
[82] Installation will use 291.22 MB of disk space.
[82] Do you want to continue?
[82] Yes|No
yes
[3784] backup  operation: Mkdir
[3784] 	- arguments: /opt/AmneziaVPN
[3784] Done
[3784] perform  operation: Mkdir
[3784] 	- arguments: /opt/AmneziaVPN
[3784] Done
[3784] Preparing the installation...
[3785] Install size: 1 components
[3788] Preparing to unpack components...
[3789] backup org.amneziavpn.package concurrent operation: Extract
[3789] 	- arguments: installer://org.amneziavpn.package/4.6.0.3data.7z, /opt/AmneziaVPN
[3789] Started
[3810] Unpacking components...
[3810] perform org.amneziavpn.package concurrent operation: Extract
[3810] 	- arguments: installer://org.amneziavpn.package/4.6.0.3data.7z, /opt/AmneziaVPN
[3810] Started
[9195] Installing component AmneziaVPN
[9195] "Execute" as admin: true
[9195] backup org.amneziavpn.package operation: Execute
[9195] 	- arguments: bash, /opt/AmneziaVPN/post_install.sh, UNDOEXECUTE, bash, /opt/AmneziaVPN/post_uninstall.sh
[9195] Done
[9196] perform org.amneziavpn.package operation: Execute
[9196] 	- arguments: bash, /opt/AmneziaVPN/post_install.sh, UNDOEXECUTE, bash, /opt/AmneziaVPN/post_uninstall.sh
[9198] bash" started, arguments: "/opt/AmneziaVPN/post_install.sh
[9213] AmneziaVPN log dir created at /var/log/\n
[9951] Done
[9954] Writing maintenance tool: "/opt/AmneziaVPN/maintenancetool.new"
[9954] Writing maintenance tool.
[10034] Wrote permissions for maintenance tool.
[10075] Maintenance tool hard restart: false.
[10075] Installation finished!
[10075] Components installed successfully.
jeffangelion@redstar:~$ 
<!-- gh-comment-id:2238579115 --> @jeffangelion commented on GitHub (Jul 19, 2024): About headless installation: ```bash jeffangelion@redstar:~$ sudo ./AmneziaVPN_Linux_Installer.bin install [0] Arguments: ./AmneziaVPN_Linux_Installer.bin, install [3] Operations sanity check succeeded. [10] OS: Debian GNU/Linux 12 (bookworm), architecture: x86_64 [10] Check if app already installed: false [74] Loaded control script ":/metadata/installer-config/controlscript_js.js" [74] No target directory specified, using default value: "/opt/AmneziaVPN" [74] Preparing meta information download... [81] Warning: QFont::setPixelSize: Pixel size <= 0 (-1) [81] Selected components without dependencies: org.amneziavpn.package [81] Installation space required: "547.22 MB" Temporary space required: "256.00 MB" Local repository size: "0.00 bytes" [82] Tmp and install directories are on the same volume. Volume mount point: "/" Free space available: "76.94 GB" [82] Installation will use 291.22 MB of disk space. [82] Do you want to continue? [82] Yes|No yes [3784] backup operation: Mkdir [3784] - arguments: /opt/AmneziaVPN [3784] Done [3784] perform operation: Mkdir [3784] - arguments: /opt/AmneziaVPN [3784] Done [3784] Preparing the installation... [3785] Install size: 1 components [3788] Preparing to unpack components... [3789] backup org.amneziavpn.package concurrent operation: Extract [3789] - arguments: installer://org.amneziavpn.package/4.6.0.3data.7z, /opt/AmneziaVPN [3789] Started [3810] Unpacking components... [3810] perform org.amneziavpn.package concurrent operation: Extract [3810] - arguments: installer://org.amneziavpn.package/4.6.0.3data.7z, /opt/AmneziaVPN [3810] Started [9195] Installing component AmneziaVPN [9195] "Execute" as admin: true [9195] backup org.amneziavpn.package operation: Execute [9195] - arguments: bash, /opt/AmneziaVPN/post_install.sh, UNDOEXECUTE, bash, /opt/AmneziaVPN/post_uninstall.sh [9195] Done [9196] perform org.amneziavpn.package operation: Execute [9196] - arguments: bash, /opt/AmneziaVPN/post_install.sh, UNDOEXECUTE, bash, /opt/AmneziaVPN/post_uninstall.sh [9198] bash" started, arguments: "/opt/AmneziaVPN/post_install.sh [9213] AmneziaVPN log dir created at /var/log/\n [9951] Done [9954] Writing maintenance tool: "/opt/AmneziaVPN/maintenancetool.new" [9954] Writing maintenance tool. [10034] Wrote permissions for maintenance tool. [10075] Maintenance tool hard restart: false. [10075] Installation finished! [10075] Components installed successfully. jeffangelion@redstar:~$ ```
Author
Owner

@rasolAAaa commented on GitHub (Jul 19, 2024):

بسیار عالی دست تون درد نکنه خیلی ممنون از دست اندرکاران برنامه خوبتان

در تاریخ جمعه ۱۹ ژوئیهٔ ۲۰۲۴،‏ ۱۲:۲۰ Ivan Vatlin @.***>
نوشت:

About headless installation:

@.:~$ sudo ./AmneziaVPN_Linux_Installer.bin install
[0] Arguments: ./AmneziaVPN_Linux_Installer.bin, install
[3] Operations sanity check succeeded.
[10] OS: Debian GNU/Linux 12 (bookworm), architecture: x86_64
[10] Check if app already installed: false
[74] Loaded control script ":/metadata/installer-config/controlscript_js.js"
[74] No target directory specified, using default value: "/opt/AmneziaVPN"
[74] Preparing meta information download...
[81] Warning: QFont::setPixelSize: Pixel size <= 0 (-1)
[81] Selected components without dependencies:
org.amneziavpn.package
[81] Installation space required: "547.22 MB" Temporary space required: "256.00 MB" Local repository size: "0.00 bytes"
[82] Tmp and install directories are on the same volume. Volume mount point: "/" Free space available: "76.94 GB"
[82] Installation will use 291.22 MB of disk space.
[82] Do you want to continue?
[82] Yes|No
yes
[3784] backup operation: Mkdir
[3784] - arguments: /opt/AmneziaVPN
[3784] Done
[3784] perform operation: Mkdir
[3784] - arguments: /opt/AmneziaVPN
[3784] Done
[3784] Preparing the installation...
[3785] Install size: 1 components
[3788] Preparing to unpack components...
[3789] backup org.amneziavpn.package concurrent operation: Extract
[3789] - arguments: installer://org.amneziavpn.package/4.6.0.3data.7z, /opt/AmneziaVPN
[3789] Started
[3810] Unpacking components...
[3810] perform org.amneziavpn.package concurrent operation: Extract
[3810] - arguments: installer://org.amneziavpn.package/4.6.0.3data.7z, /opt/AmneziaVPN
[3810] Started
[9195] Installing component AmneziaVPN
[9195] "Execute" as admin: true
[9195] backup org.amneziavpn.package operation: Execute
[9195] - arguments: bash, /opt/AmneziaVPN/post_install.sh, UNDOEXECUTE, bash, /opt/AmneziaVPN/post_uninstall.sh
[9195] Done
[9196] perform org.amneziavpn.package operation: Execute
[9196] - arguments: bash, /opt/AmneziaVPN/post_install.sh, UNDOEXECUTE, bash, /opt/AmneziaVPN/post_uninstall.sh
[9198] bash" started, arguments: "/opt/AmneziaVPN/post_install.sh
[9213] AmneziaVPN log dir created at /var/log/\n
[9951] Done
[9954] Writing maintenance tool: "/opt/AmneziaVPN/maintenancetool.new"
[9954] Writing maintenance tool.
[10034] Wrote permissions for maintenance tool.
[10075] Maintenance tool hard restart: false.
[10075] Installation finished!
[10075] Components installed successfully.
@.
:~$

—
Reply to this email directly, view it on GitHub
https://github.com/amnezia-vpn/amnezia-client/issues/850#issuecomment-2238579115,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/BIQMEYQXH5AWRGDEUEL5THTZNDAM5AVCNFSM6AAAAABJGKGBJCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZYGU3TSMJRGU
.
You are receiving this because you are subscribed to this thread.Message
ID: @.***>

<!-- gh-comment-id:2239063742 --> @rasolAAaa commented on GitHub (Jul 19, 2024): بسیار عالی دست تون درد نکنه خیلی ممنون از دست اندرکاران برنامه خوبتان در تاریخ جمعه ۱۹ ژوئیهٔ ۲۰۲۴،‏ ۱۲:۲۰ Ivan Vatlin ***@***.***> نوشت: > About headless installation: > > ***@***.***:~$ sudo ./AmneziaVPN_Linux_Installer.bin install > [0] Arguments: ./AmneziaVPN_Linux_Installer.bin, install > [3] Operations sanity check succeeded. > [10] OS: Debian GNU/Linux 12 (bookworm), architecture: x86_64 > [10] Check if app already installed: false > [74] Loaded control script ":/metadata/installer-config/controlscript_js.js" > [74] No target directory specified, using default value: "/opt/AmneziaVPN" > [74] Preparing meta information download... > [81] Warning: QFont::setPixelSize: Pixel size <= 0 (-1) > [81] Selected components without dependencies: > org.amneziavpn.package > [81] Installation space required: "547.22 MB" Temporary space required: "256.00 MB" Local repository size: "0.00 bytes" > [82] Tmp and install directories are on the same volume. Volume mount point: "/" Free space available: "76.94 GB" > [82] Installation will use 291.22 MB of disk space. > [82] Do you want to continue? > [82] Yes|No > yes > [3784] backup operation: Mkdir > [3784] - arguments: /opt/AmneziaVPN > [3784] Done > [3784] perform operation: Mkdir > [3784] - arguments: /opt/AmneziaVPN > [3784] Done > [3784] Preparing the installation... > [3785] Install size: 1 components > [3788] Preparing to unpack components... > [3789] backup org.amneziavpn.package concurrent operation: Extract > [3789] - arguments: installer://org.amneziavpn.package/4.6.0.3data.7z, /opt/AmneziaVPN > [3789] Started > [3810] Unpacking components... > [3810] perform org.amneziavpn.package concurrent operation: Extract > [3810] - arguments: installer://org.amneziavpn.package/4.6.0.3data.7z, /opt/AmneziaVPN > [3810] Started > [9195] Installing component AmneziaVPN > [9195] "Execute" as admin: true > [9195] backup org.amneziavpn.package operation: Execute > [9195] - arguments: bash, /opt/AmneziaVPN/post_install.sh, UNDOEXECUTE, bash, /opt/AmneziaVPN/post_uninstall.sh > [9195] Done > [9196] perform org.amneziavpn.package operation: Execute > [9196] - arguments: bash, /opt/AmneziaVPN/post_install.sh, UNDOEXECUTE, bash, /opt/AmneziaVPN/post_uninstall.sh > [9198] bash" started, arguments: "/opt/AmneziaVPN/post_install.sh > [9213] AmneziaVPN log dir created at /var/log/\n > [9951] Done > [9954] Writing maintenance tool: "/opt/AmneziaVPN/maintenancetool.new" > [9954] Writing maintenance tool. > [10034] Wrote permissions for maintenance tool. > [10075] Maintenance tool hard restart: false. > [10075] Installation finished! > [10075] Components installed successfully. > ***@***.***:~$ > > — > Reply to this email directly, view it on GitHub > <https://github.com/amnezia-vpn/amnezia-client/issues/850#issuecomment-2238579115>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/BIQMEYQXH5AWRGDEUEL5THTZNDAM5AVCNFSM6AAAAABJGKGBJCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZYGU3TSMJRGU> > . > You are receiving this because you are subscribed to this thread.Message > ID: ***@***.***> >
Author
Owner

@StreetStrider commented on GitHub (Aug 31, 2024):

@jeffangelion how to connect then? It seemes that docs centered around gui. It cannot find a guide on how to connect from command line.

<!-- gh-comment-id:2322881111 --> @StreetStrider commented on GitHub (Aug 31, 2024): @jeffangelion how to connect then? It seemes that docs centered around gui. It cannot find a guide on how to connect from command line.
Author
Owner

@isnullxbh commented on GitHub (Oct 13, 2024):

@pokamest, do you have any plans to support connection from command line?

<!-- gh-comment-id:2408925734 --> @isnullxbh commented on GitHub (Oct 13, 2024): @pokamest, do you have any plans to support connection from command line?
Author
Owner

@neikist commented on GitHub (Oct 17, 2024):

Are there any updates? Or can I find another client, that doesn't need a GUI, anywhere? I want to run it on my home server which doesn't have a GUI. Current client here requires a lot of extra dependencies.

<!-- gh-comment-id:2419644077 --> @neikist commented on GitHub (Oct 17, 2024): Are there any updates? Or can I find another client, that doesn't need a GUI, anywhere? I want to run it on my home server which doesn't have a GUI. Current client here requires a lot of extra dependencies.
Author
Owner

@StreetStrider commented on GitHub (Oct 17, 2024):

I used amneziawg-go. Then, given the config provided at /etc/wgcf-profile.conf:

amneziawg-go wg0
wg setconf wg0 /etc/wgcf-profile.conf
ip address add $ADDRESS dev wg0 # Address: from profile
ip link set up dev wg0

ip route delete default
ip route add $ENDPOINT via $GW dev eth0 # Endpoint: from profile, GW is default gateway
ip route add default dev wg0

You may or may not need other actions, I used docker environment and image FROM amneziavpn/amneziawg-go:0.2.12.

<!-- gh-comment-id:2419735377 --> @StreetStrider commented on GitHub (Oct 17, 2024): I used `amneziawg-go`. Then, given the config provided at `/etc/wgcf-profile.conf`: ``` amneziawg-go wg0 wg setconf wg0 /etc/wgcf-profile.conf ip address add $ADDRESS dev wg0 # Address: from profile ip link set up dev wg0 ip route delete default ip route add $ENDPOINT via $GW dev eth0 # Endpoint: from profile, GW is default gateway ip route add default dev wg0 ``` You may or may not need other actions, I used docker environment and image `FROM amneziavpn/amneziawg-go:0.2.12`.
Author
Owner

@ukqfhf commented on GitHub (Mar 8, 2025):

It also would be great to have a official Raycast extension to simplify interaction

<!-- gh-comment-id:2708340277 --> @ukqfhf commented on GitHub (Mar 8, 2025): It also would be great to have a official Raycast extension to simplify interaction
Author
Owner

@nerevarishe101 commented on GitHub (May 11, 2025):

@StreetStrider on

wg setconf wg0 /etc/wgcf-profile.conf

I get error:

Line unrecognized: `Address=10.8.1.9/32'
Configuration parsing error

Any idea what i am doing wrong?

I try with wireguard tools and with amnezia wireguard tools from here

My config look like this:

[Interface]
Address = 10.8.1.9/32
DNS = 1.1.1.1, 1.0.0.1
PrivateKey = xxxxxxxxxxxxxxxxxxxxxxxxxx
Jc = xx
Jmin = xx
Jmax = xx
S1 = xx
S2 = xx
H1 = xxxxxxxxx
H2 = xxxxxxxxx
H3 = xxxxxxxxx
H4 = xxxxxxxxx

[Peer]
PublicKey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
PresharedKey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
AllowedIPs = 0.0.0.0/0, ::/0
Endpoint = xxx.xxx.xxx.xxx:xxxxxx
PersistentKeepalive = xx
<!-- gh-comment-id:2870041314 --> @nerevarishe101 commented on GitHub (May 11, 2025): @StreetStrider on ``` wg setconf wg0 /etc/wgcf-profile.conf ``` I get error: ``` Line unrecognized: `Address=10.8.1.9/32' Configuration parsing error ``` Any idea what i am doing wrong? I try with wireguard tools and with amnezia wireguard tools from [here](https://github.com/amnezia-vpn/amneziawg-tools) My config look like this: ``` [Interface] Address = 10.8.1.9/32 DNS = 1.1.1.1, 1.0.0.1 PrivateKey = xxxxxxxxxxxxxxxxxxxxxxxxxx Jc = xx Jmin = xx Jmax = xx S1 = xx S2 = xx H1 = xxxxxxxxx H2 = xxxxxxxxx H3 = xxxxxxxxx H4 = xxxxxxxxx [Peer] PublicKey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx PresharedKey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx AllowedIPs = 0.0.0.0/0, ::/0 Endpoint = xxx.xxx.xxx.xxx:xxxxxx PersistentKeepalive = xx ```
Author
Owner

@StreetStrider commented on GitHub (May 11, 2025):

@nerevarishe101 I had it in the past. As far as I understood you need either to remove Address from your config or to use some tooling over wg that understands Address. I took 1st path, I comment out Address in my config and install routing on my own (ip address add $ADDRESS dev wg0 then ip route add $ENDPOINT via $GW dev eth0 as shown above).

I think the 2nd path is to use something like wg-quick. Consult this question. You can google the error wg configuration parsing error and you'll find additional clues.

<!-- gh-comment-id:2870052348 --> @StreetStrider commented on GitHub (May 11, 2025): @nerevarishe101 I had it in the past. As far as I understood you need either to remove Address from your config or to use some tooling over wg that understands Address. I took 1st path, I comment out Address in my config and install routing on my own (`ip address add $ADDRESS dev wg0` then `ip route add $ENDPOINT via $GW dev eth0` as shown above). I think the 2nd path is to use something like wg-quick. [Consult this question](https://serverfault.com/questions/1006595/cannot-setup-wireguard-vpn). You can google the error `wg configuration parsing error` and you'll find additional clues.
Author
Owner

@evgeny-kim commented on GitHub (Jun 3, 2025):

How to install and use Amnezia VPN client without GUI

Here's an example Debian setup that can be easily adapted to other platforms:

1. Install Go

wget https://go.dev/dl/go1.24.3.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.24.3.linux-amd64.tar.gz

~/.bashrc:

export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

go version

2. Install amneziawg-go

git clone https://github.com/amnezia-vpn/amneziawg-go
cd amneziawg-go
make
sudo mv amneziawg-go /usr/local/bin/
sudo chmod +x /usr/local/bin/amneziawg-go

3. Install amneziawg-tools

git clone https://github.com/amnezia-vpn/amneziawg-tools.git
cd amneziawg-tools/src/
make
sudo make install

4. Add config

/etc/amnezia/wg0.conf:

[Interface]
PrivateKey = YOUR_PRIVATE_KEY
Address = YOUR_VPN_INTERFACE_IP/CIDR
DNS = 1.1.1.1                         # Or your preferred DNS server
Table = off                           # We will be using PostUp/PreDown for routing

# AmneziaWG specific parameters (use your actual values)
Jc = 
Jmin = 
Jmax = 
S1 = 
S2 = 
H1 = 
H2 = 
H3 = 
H4 = 

# PostUp: Commands executed after VPN interface (wg0) is up
#  - Route VPN server traffic via eth0
#  - Delete existing default IPv4 route via eth0
#  - Set new default IPv4 route to send all traffic via VPN (wg0)
#  - Set new default IPv6 route to send all IPv6 traffic via VPN (wg0)
PostUp = ip route add YOUR_VPN_ENDPOINT_IP via YOUR_ETH0_GATEWAY_IP dev eth0; ip route del default via YOUR_ETH0_GATEWAY_IP dev eth0; ip route add 0.0.0.0/0 dev wg0; ip -6 route add ::/0 dev wg0

# PreDown: Commands executed before VPN interface (wg0) is taken down
#  - Delete default IPv4 route that sent traffic via VPN (wg0)
#  - Delete default IPv6 route that sent traffic via VPN (wg0)
#  - Restore original default IPv4 route via eth0
#  - Delete route for VPN server via eth0
PreDown = ip route del 0.0.0.0/0 dev wg0; ip -6 route del ::/0 dev wg0; ip route add default via YOUR_ETH0_GATEWAY_IP dev eth0; ip route del YOUR_VPN_ENDPOINT_IP via YOUR_ETH0_GATEWAY_IP dev eth0

[Peer]
PublicKey = YOUR_PEER_PUBLIC_KEY
PresharedKey = YOUR_PRESHARED_KEY
AllowedIPs = 0.0.0.0/0, ::/0          # Route all traffic
Endpoint = YOUR_VPN_ENDPOINT_IP:PORT
PersistentKeepalive = 25

5. Test connection

Connect VPN:

sudo awg-quick up wg0
ip route show
curl ifconfig.me

Disconnect VPN:

sudo awg-quick down wg0
ip route show
curl ifconfig.me

6. Start on boot

sudo systemctl enable awg-quick@wg0.service
sudo systemctl start awg-quick@wg0.service
<!-- gh-comment-id:2936984154 --> @evgeny-kim commented on GitHub (Jun 3, 2025): ## How to install and use Amnezia VPN client without GUI Here's an example Debian setup that can be easily adapted to other platforms: ### 1. Install Go ``` wget https://go.dev/dl/go1.24.3.linux-amd64.tar.gz sudo tar -C /usr/local -xzf go1.24.3.linux-amd64.tar.gz ``` _~/.bashrc:_ ``` export GOROOT=/usr/local/go export GOPATH=$HOME/go export PATH=$PATH:$GOROOT/bin:$GOPATH/bin ``` `go version` ### 2. Install amneziawg-go ``` git clone https://github.com/amnezia-vpn/amneziawg-go cd amneziawg-go make sudo mv amneziawg-go /usr/local/bin/ sudo chmod +x /usr/local/bin/amneziawg-go ``` ### 3. Install amneziawg-tools ``` git clone https://github.com/amnezia-vpn/amneziawg-tools.git cd amneziawg-tools/src/ make sudo make install ``` ### 4. Add config _/etc/amnezia/wg0.conf:_ ``` [Interface] PrivateKey = YOUR_PRIVATE_KEY Address = YOUR_VPN_INTERFACE_IP/CIDR DNS = 1.1.1.1 # Or your preferred DNS server Table = off # We will be using PostUp/PreDown for routing # AmneziaWG specific parameters (use your actual values) Jc = Jmin = Jmax = S1 = S2 = H1 = H2 = H3 = H4 = # PostUp: Commands executed after VPN interface (wg0) is up # - Route VPN server traffic via eth0 # - Delete existing default IPv4 route via eth0 # - Set new default IPv4 route to send all traffic via VPN (wg0) # - Set new default IPv6 route to send all IPv6 traffic via VPN (wg0) PostUp = ip route add YOUR_VPN_ENDPOINT_IP via YOUR_ETH0_GATEWAY_IP dev eth0; ip route del default via YOUR_ETH0_GATEWAY_IP dev eth0; ip route add 0.0.0.0/0 dev wg0; ip -6 route add ::/0 dev wg0 # PreDown: Commands executed before VPN interface (wg0) is taken down # - Delete default IPv4 route that sent traffic via VPN (wg0) # - Delete default IPv6 route that sent traffic via VPN (wg0) # - Restore original default IPv4 route via eth0 # - Delete route for VPN server via eth0 PreDown = ip route del 0.0.0.0/0 dev wg0; ip -6 route del ::/0 dev wg0; ip route add default via YOUR_ETH0_GATEWAY_IP dev eth0; ip route del YOUR_VPN_ENDPOINT_IP via YOUR_ETH0_GATEWAY_IP dev eth0 [Peer] PublicKey = YOUR_PEER_PUBLIC_KEY PresharedKey = YOUR_PRESHARED_KEY AllowedIPs = 0.0.0.0/0, ::/0 # Route all traffic Endpoint = YOUR_VPN_ENDPOINT_IP:PORT PersistentKeepalive = 25 ``` ### 5. Test connection Connect VPN: ``` sudo awg-quick up wg0 ip route show curl ifconfig.me ``` Disconnect VPN: ``` sudo awg-quick down wg0 ip route show curl ifconfig.me ``` ### 6. Start on boot ``` sudo systemctl enable awg-quick@wg0.service sudo systemctl start awg-quick@wg0.service ```
Author
Owner

@potap1978 commented on GitHub (Jun 4, 2025):

Пример настройки Debian:

1. Установить Go

wget https://go.dev/dl/go1.24.3.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.24.3.linux-amd64.tar.gz

~/.bashrc:

export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

go version

2. Установить amneziawg-go

git clone https://github.com/amnezia-vpn/amneziawg-go
cd amneziawg-go
make
sudo mv amneziawg-go /usr/local/bin/
sudo chmod +x /usr/local/bin/amneziawg-go

3. Установите amneziawg-tools

git clone https://github.com/amnezia-vpn/amneziawg-tools.git
cd amneziawg-tools/src/
make
sudo make install

4. Добавить конфигурацию

/etc/amnezia/wg0.conf:

[Interface]
PrivateKey = YOUR_PRIVATE_KEY
Address = YOUR_VPN_INTERFACE_IP/CIDR
DNS = 1.1.1.1                         # Or your preferred DNS server
Table = off                           # We will be using PostUp/PreDown for routing

# AmneziaWG specific parameters (use your actual values)
Jc = 
Jmin = 
Jmax = 
S1 = 
S2 = 
H1 = 
H2 = 
H3 = 
H4 = 

# PostUp: Commands executed after VPN interface (wg0) is up
#  - Route VPN server traffic via eth0
#  - Delete existing default IPv4 route via eth0
#  - Set new default IPv4 route to send all traffic via VPN (wg0)
#  - Set new default IPv6 route to send all IPv6 traffic via VPN (wg0)
PostUp = ip route add YOUR_VPN_ENDPOINT_IP via YOUR_ETH0_GATEWAY_IP dev eth0; ip route del default via YOUR_ETH0_GATEWAY_IP dev eth0; ip route add 0.0.0.0/0 dev wg0; ip -6 route add ::/0 dev wg0

# PreDown: Commands executed before VPN interface (wg0) is taken down
#  - Delete default IPv4 route that sent traffic via VPN (wg0)
#  - Delete default IPv6 route that sent traffic via VPN (wg0)
#  - Restore original default IPv4 route via eth0
#  - Delete route for VPN server via eth0
PreDown = ip route del 0.0.0.0/0 dev wg0; ip -6 route del ::/0 dev wg0; ip route add default via YOUR_ETH0_GATEWAY_IP dev eth0; ip route del YOUR_VPN_ENDPOINT_IP via YOUR_ETH0_GATEWAY_IP dev eth0

[Peer]
PublicKey = YOUR_PEER_PUBLIC_KEY
PresharedKey = YOUR_PRESHARED_KEY
AllowedIPs = 0.0.0.0/0, ::/0          # Route all traffic
Endpoint = YOUR_VPN_ENDPOINT_IP:PORT
PersistentKeepalive = 25

5. Тестовое соединение

Подключить VPN:

sudo awg-quick up wg0
ip route show
curl ifconfig.me

Отключить VPN:

sudo awg-quick down wg0
ip route show
curl ifconfig.me

6. Запуск при загрузке

sudo systemctl enable awg-quick@wg0.service
sudo systemctl start awg-quick@wg0.service

root@DEBIAN:~# awg-quick up wg0
[#] ip link add wg0 type amneziawg
Error: Unknown device type.
[!] Missing WireGuard (Amnezia VPN) kernel module. Falling back to slow userspace implementation.
[#] amneziawg-go wg0
┌──────────────────────────────────────────────────────────────┐
│ │
│ Running amneziawg-go is not required because this │
│ kernel has first class support for AmneziaWG. For │
│ information on installing the kernel module, │
│ please visit: │
| https://github.com/amnezia-vpn/amneziawg-linux-kernel-module │
│ │
└──────────────────────────────────────────────────────────────┘
[#] awg setconf wg0 /dev/fd/63
[#] ip -4 address add 172.16.0.2/32 dev wg0
[#] ip -6 address add 2606:4700:110:8f1b:944b:950f:8f25:255e/128 dev wg0
[#] ip link set mtu 1280 up dev wg0
[#] resolvconf -a wg0 -m 0 -x
/usr/bin/awg-quick: line 32: resolvconf: command not found
[#] ip link delete dev wg0

Неа,

root@DEBIAN:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host noprefixroute
valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 08:00:27:d9:34:b7 brd ff:ff:ff:ff:ff:ff
inet 192.168.10.1/24 brd 192.168.10.255 scope global enp0s3
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fed9:34b7/64 scope link
valid_lft forever preferred_lft forever

<!-- gh-comment-id:2939061985 --> @potap1978 commented on GitHub (Jun 4, 2025): > Пример настройки Debian: > > ### 1. Установить Go > ``` > wget https://go.dev/dl/go1.24.3.linux-amd64.tar.gz > sudo tar -C /usr/local -xzf go1.24.3.linux-amd64.tar.gz > ``` > > _~/.bashrc:_ > > ``` > export GOROOT=/usr/local/go > export GOPATH=$HOME/go > export PATH=$PATH:$GOROOT/bin:$GOPATH/bin > ``` > > `go version` > > ### 2. Установить amneziawg-go > ``` > git clone https://github.com/amnezia-vpn/amneziawg-go > cd amneziawg-go > make > sudo mv amneziawg-go /usr/local/bin/ > sudo chmod +x /usr/local/bin/amneziawg-go > ``` > > ### 3. Установите amneziawg-tools > ``` > git clone https://github.com/amnezia-vpn/amneziawg-tools.git > cd amneziawg-tools/src/ > make > sudo make install > ``` > > ### 4. Добавить конфигурацию > _/etc/amnezia/wg0.conf:_ > > ``` > [Interface] > PrivateKey = YOUR_PRIVATE_KEY > Address = YOUR_VPN_INTERFACE_IP/CIDR > DNS = 1.1.1.1 # Or your preferred DNS server > Table = off # We will be using PostUp/PreDown for routing > > # AmneziaWG specific parameters (use your actual values) > Jc = > Jmin = > Jmax = > S1 = > S2 = > H1 = > H2 = > H3 = > H4 = > > # PostUp: Commands executed after VPN interface (wg0) is up > # - Route VPN server traffic via eth0 > # - Delete existing default IPv4 route via eth0 > # - Set new default IPv4 route to send all traffic via VPN (wg0) > # - Set new default IPv6 route to send all IPv6 traffic via VPN (wg0) > PostUp = ip route add YOUR_VPN_ENDPOINT_IP via YOUR_ETH0_GATEWAY_IP dev eth0; ip route del default via YOUR_ETH0_GATEWAY_IP dev eth0; ip route add 0.0.0.0/0 dev wg0; ip -6 route add ::/0 dev wg0 > > # PreDown: Commands executed before VPN interface (wg0) is taken down > # - Delete default IPv4 route that sent traffic via VPN (wg0) > # - Delete default IPv6 route that sent traffic via VPN (wg0) > # - Restore original default IPv4 route via eth0 > # - Delete route for VPN server via eth0 > PreDown = ip route del 0.0.0.0/0 dev wg0; ip -6 route del ::/0 dev wg0; ip route add default via YOUR_ETH0_GATEWAY_IP dev eth0; ip route del YOUR_VPN_ENDPOINT_IP via YOUR_ETH0_GATEWAY_IP dev eth0 > > [Peer] > PublicKey = YOUR_PEER_PUBLIC_KEY > PresharedKey = YOUR_PRESHARED_KEY > AllowedIPs = 0.0.0.0/0, ::/0 # Route all traffic > Endpoint = YOUR_VPN_ENDPOINT_IP:PORT > PersistentKeepalive = 25 > ``` > > ### 5. Тестовое соединение > Подключить VPN: > > ``` > sudo awg-quick up wg0 > ip route show > curl ifconfig.me > ``` > > Отключить VPN: > > ``` > sudo awg-quick down wg0 > ip route show > curl ifconfig.me > ``` > > ### 6. Запуск при загрузке > ``` > sudo systemctl enable awg-quick@wg0.service > sudo systemctl start awg-quick@wg0.service > ``` root@DEBIAN:~# awg-quick up wg0 [#] ip link add wg0 type amneziawg Error: Unknown device type. [!] Missing WireGuard (Amnezia VPN) kernel module. Falling back to slow userspace implementation. [#] amneziawg-go wg0 ┌──────────────────────────────────────────────────────────────┐ │ │ │ Running amneziawg-go is not required because this │ │ kernel has first class support for AmneziaWG. For │ │ information on installing the kernel module, │ │ please visit: │ | https://github.com/amnezia-vpn/amneziawg-linux-kernel-module │ │ │ └──────────────────────────────────────────────────────────────┘ [#] awg setconf wg0 /dev/fd/63 [#] ip -4 address add 172.16.0.2/32 dev wg0 [#] ip -6 address add 2606:4700:110:8f1b:944b:950f:8f25:255e/128 dev wg0 [#] ip link set mtu 1280 up dev wg0 [#] resolvconf -a wg0 -m 0 -x /usr/bin/awg-quick: line 32: resolvconf: command not found [#] ip link delete dev wg0 Неа, root@DEBIAN:~# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host noprefixroute valid_lft forever preferred_lft forever 2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 08:00:27:d9:34:b7 brd ff:ff:ff:ff:ff:ff inet 192.168.10.1/24 brd 192.168.10.255 scope global enp0s3 valid_lft forever preferred_lft forever inet6 fe80::a00:27ff:fed9:34b7/64 scope link valid_lft forever preferred_lft forever
Author
Owner

@evgeny-kim commented on GitHub (Jun 5, 2025):

[#] resolvconf -a wg0 -m 0 -x
/usr/bin/awg-quick: line 32: resolvconf: command not found

You should have resolvconf installed

install: sudo apt install resolvconf
confirm: sudo systemctl status resolvconf

<!-- gh-comment-id:2944239379 --> @evgeny-kim commented on GitHub (Jun 5, 2025): > [#] resolvconf -a wg0 -m 0 -x > /usr/bin/awg-quick: line 32: resolvconf: command not found You should have resolvconf installed install: `sudo apt install resolvconf` confirm: `sudo systemctl status resolvconf`
Author
Owner

@Nastradamus commented on GitHub (Dec 15, 2025):

As far as I understand, there is no support for the vless protocol in amneziawg-go.
Because of this, my providers are blocking AmneziaWG, amneziawg-go.

We still need normal headless version, with vless support.

<!-- gh-comment-id:3657024426 --> @Nastradamus commented on GitHub (Dec 15, 2025): As far as I understand, there is no support for the vless protocol in amneziawg-go. Because of this, my providers are blocking AmneziaWG, amneziawg-go. We still need normal headless version, with vless support.
Author
Owner

@dmtazetdinov commented on GitHub (Feb 4, 2026):

does it work with obfuscation (i1..i5)? I have a syntax error in the config

<!-- gh-comment-id:3847350261 --> @dmtazetdinov commented on GitHub (Feb 4, 2026): does it work with obfuscation (i1..i5)? I have a syntax error in the config
Author
Owner

@StreetStrider commented on GitHub (Feb 5, 2026):

@dmtazetdinov I'm using amneziavpn/amneziawg-go:0.2.15 and it can consume I1/H1. But it cannot parse MTU, DNS and Address. I comment them out.

<!-- gh-comment-id:3850495052 --> @StreetStrider commented on GitHub (Feb 5, 2026): @dmtazetdinov I'm using `amneziavpn/amneziawg-go:0.2.15` and it can consume I1/H1. But it cannot parse MTU, DNS and Address. I comment them out.
Author
Owner

@bivlked commented on GitHub (Apr 21, 2026):

For headless Linux, a few pointers based on what's come up in this thread:

  • Server-side self-host — amneziawg-installer (disclosure: I maintain it) handles kernel module + AWG 2.0 config in one bash command on Ubuntu/Debian, incl. ARM VPS since v5.9.0 (Raspberry Pi, Oracle Cloud Ampere, Hetzner CAX). Generated configs have valid H1..H4 / I1 — no manual editing needed.
  • Client-side — @evgeny-kim's amneziawg-go + amneziawg-tools recipe earlier in this thread is the way. Key detail: use the Amnezia fork of awg-quick, not system wireguard-tools — that's the root cause of the I1..I5 syntax errors @dmtazetdinov hit. The tagged format is case-sensitive uppercase: <b 0xHEX>, <r N>, <t>, <c>.
  • VLESS — different protocol family (Xray/XTLS-Reality), not a WireGuard fork, so amneziawg-go won't cover it.
    That's a separate ecosystem from AmneziaWG.

For maintainers: the CLI installer question loops back every few months. There's a parallel ask in discussion #2356 about adding a Community CLI Tools section on docs.amnezia.org — might be a nice resolution for this thread too.

<!-- gh-comment-id:4290127656 --> @bivlked commented on GitHub (Apr 21, 2026): For headless Linux, a few pointers based on what's come up in this thread: - **Server-side self-host** — `amneziawg-installer` (disclosure: I maintain it) handles kernel module + AWG 2.0 config in one bash command on Ubuntu/Debian, incl. ARM VPS since v5.9.0 (Raspberry Pi, Oracle Cloud Ampere, Hetzner CAX). Generated configs have valid `H1..H4` / `I1` — no manual editing needed. - **Client-side** — @evgeny-kim's `amneziawg-go` + `amneziawg-tools` recipe earlier in this thread is the way. Key detail: use the Amnezia fork of `awg-quick`, not system `wireguard-tools` — that's the root cause of the `I1..I5` syntax errors @dmtazetdinov hit. The tagged format is case-sensitive uppercase: `<b 0xHEX>`, `<r N>`, `<t>`, `<c>`. - **VLESS** — different protocol family (Xray/XTLS-Reality), not a WireGuard fork, so `amneziawg-go` won't cover it. That's a separate ecosystem from AmneziaWG. For maintainers: the CLI installer question loops back every few months. There's a parallel ask in [discussion #2356](https://github.com/amnezia-vpn/amnezia-client/discussions/2356) about adding a `Community CLI Tools` section on docs.amnezia.org — might be a nice resolution for this thread too.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
amnezia-vpn/amnezia-client#228
No description provided.