2024-02-12 06:01:15 +00:00
# awg-manager
2022-11-03 15:37:53 +00:00
2024-02-12 06:01:15 +00:00
AmneziaWG manager allow initialize AmneziaWG server and manage users.
2022-11-03 15:37:53 +00:00
2024-02-12 06:01:15 +00:00
You can start the AmneziaWG server with one command, and then create (and delete) users.
2022-11-03 15:53:56 +00:00
2022-11-03 15:37:53 +00:00
```bash
2024-02-12 06:01:15 +00:00
Usage: ./awg-manager.sh [< options > ] [command [arg]]
2022-11-03 15:37:53 +00:00
Options:
-i : Init (Create server keys and configs)
-c : Create new user
-d : Delete user
2022-12-13 19:07:37 +00:00
-L : Lock user
-U : Unlock user
2022-11-03 15:37:53 +00:00
-p : Print user config
-u < user > : User identifier (uniq field for vpn account)
-s < server > : Server host for user connection
2022-12-13 19:07:37 +00:00
-I : Interface (default auto)
2022-11-03 15:37:53 +00:00
-h : Usage
```
## Quick start
2024-02-12 06:01:15 +00:00
Run server (bare-metal or VPS) with Ubuntu 20.02, 22.02
2022-11-03 15:37:53 +00:00
2024-02-12 06:06:05 +00:00
## Install AmneziaWG
2022-11-03 15:37:53 +00:00
```bash
2024-02-12 06:01:15 +00:00
apt update & & apt upgrade -y
apt install build-essential curl git wget -y
#install Golang
mkdir -p /opt/go
cd /opt/go
wget https://go.dev/dl/go1.22.0.linux-amd64.tar.gz
rm -rf /usr/local/go & & tar -C /usr/local -xzf go1.22.0.linux-amd64.tar.gz
echo "export PATH=$PATH:/usr/local/go/bin" >> /etc/profile
source $HOME/.profile
2024-02-19 13:21:57 +00:00
#or source /etc/profile
2024-02-12 06:01:15 +00:00
# if the go version does not show, then update the session
#Install amnezia-go
git clone https://github.com/amnezia-vpn/amneziawg-go.git /opt/amnezia-go
cd /opt/amnezia-go
make
#copy to amneziawg-go
2024-02-19 13:22:25 +00:00
cp /opt/amnezia-go/amneziawg-go /usr/bin/amneziawg-go
2024-02-12 06:01:15 +00:00
#Install amnezia-tools
git clone https://github.com/amnezia-vpn/amneziawg-tools.git /opt/amnezia-tools
cd /opt/amnezia-tools/src
make
make install
2022-11-03 15:37:53 +00:00
```
2024-02-12 06:06:05 +00:00
## Usage
Simply run:
```
amneziawg-go awg0
```
This will create an interface and fork into the background. To remove the interface, use the usual ip link del wg0, or if your system does not support removing interfaces directly, you may instead remove the control socket via rm -f /var/run/amneziawg/wg0.sock, which will result in amneziawg-go shutting down.
To run amneziawg-go without forking to the background, pass -f or --foreground:
```
2024-02-24 14:02:05 +00:00
amneziawg-go -f awg0
2024-02-12 06:06:05 +00:00
```
When an interface is running, you may use amnezia-wg-tools `awg-quick` to configure it, as well as the usual ip(8) and ifconfig(8) commands.
## Setup
2022-11-03 15:37:53 +00:00
2024-02-12 06:08:31 +00:00
- Download this script [awg-manager.sh ](https://raw.githubusercontent.com/bkeenke/awg-manager/master/awg-manager.sh ) from GitHub
2024-02-19 13:23:24 +00:00
- Initialize Annezia-WG server: `./awg-manager.sh -i -s YOUR_SERVER_IP`
2024-02-12 06:08:31 +00:00
- Add your user: `./awg-manager.sh -c -u my_user -p > awg-client.conf`
2024-02-19 13:23:24 +00:00
- Install AmneziaVPN on the client
2024-02-12 06:08:31 +00:00
- Start client with config `awg-client.conf`
2022-11-03 16:12:23 +00:00