A shell script for quickly and remotely setting up a WireGuard server and generating client configs.
Dependencies:
wireguard-tools
ssh
qrencode
(Optional. For generating QR code images)
- Download the
linwg
script:wget https://raw.githubusercontent.com/iguanajuice/linwg/main/linwg
- Make executable:
chmod +x linwg
- Move it into your path:
sudo mv linwg /usr/local/bin
You will need:
- An account with a VPS provider (e.g. Linode)
- An SSH public key
The following instructions will be for Linode specifically, but these steps can be adapted for other VPS providers:
- Create a new Linode/instance
- Leave image as Debian
- Select your desired region
- Under "Linode Plan" select "Shared CPU" and "Nanode 1 GB"
- Set a root password (use your browser's password generator so it'll auto-complete next time)
- Under "SSH keys" check your SSH key. If none are listed, add your SSH public key.
- Scroll to the bottom and click "Create Linode"
- Wait for your Linode to fully boot
- Copy it's IPv4 address and run the command
linwg [IP_ADRESS_WITHOUT_BRACKETS]
- To connect to the server, run
linwg wg1
- To disconnect, repeat the above command (if not using NetworkManager)