Skip to content

Instantly share code, notes, and snippets.

@xeptore
Last active April 5, 2021 05:39
Show Gist options
  • Save xeptore/e0600752a71a8bf6479871af6ea9b980 to your computer and use it in GitHub Desktop.
Save xeptore/e0600752a71a8bf6479871af6ea9b980 to your computer and use it in GitHub Desktop.
Wireguard Ubuntu 20.04 Installation Guide
  1. Install

    sudo apt update
    sudo apt upgrade -y
    sudo apt install wireguard
  2. Configure Server

    Copy the following contents to /etc/wireguard/default.conf:

    ## Set Up WireGuard VPN on Ubuntu By Editing/Creating wg0.conf File ##
    [Interface]
    ## My VPN server private IP address ##
    Address = 192.168.6.1/24
    
    ## My VPN server port ##
    ListenPort = 41194
    
    ## VPN server's private key i.e. /etc/wireguard/privatekey ##
    PrivateKey = x
    
    [Peer]
    ## Desktop/client VPN public key ##
    PublicKey = w
    
    ## client VPN IP address (note  the /32 subnet) ##
    AllowedIPs = 192.168.6.2/32
  3. Start Server Service

    sudo systemctl start wg-quick@default
  4. Enable Server Service On Restarts (Optional)

    sudo systemctl enable wg-quick@default

Mostly copied from: https://www.cyberciti.biz/faq/ubuntu-20-04-set-up-wireguard-vpn-server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment