WireGuard Setup Guide - ajgillis04/GillisDockerDepot GitHub Wiki

WireGuard Setup Guide

Introduction

WireGuard is a fast, modern, and secure VPN tunnel that provides ease of use and high performance. It is available for various platforms including Windows, Linux, macOS, iOS, and Android.

Prerequisites

  • Docker installed (optional, for containerized setup)
  • WireGuard installed on your system

Configuration Steps

Step 1: Installing WireGuard

  1. Windows: Download the installer from the official WireGuard website and follow the installation instructions.
  2. macOS: Download WireGuard from the App Store.
  3. Linux: Use your package manager to install WireGuard. For example, on Ubuntu:
    sudo apt install wireguard
    
    

Useful Commands

Steps to Reset WireGuard Keys

Follow these steps to reset the private and public keys for a WireGuard peer:

  1. Generate New Private Key:

    wg genkey | tee /path/to/new_private_key
    
    
  2. Generate New Public Key from Private Key:

    • Note, if you get Permission denied set the permissions to write for the file.
    wg pubkey < /path/to/new_private_key > /path/to/new_public_key
    
    
  3. Update WireGuard Configuration File:

    • Update your WireGuard configuration file (wg0.conf or similar) with the new keys.
  4. Restart WireGuard Interface:

    • Restart the WireGuard interface to apply the changes.
    sudo wg-quick down wg0
    sudo wg-quick up wg0
    
    
  5. Update Peers:

    • Inform the affected peer(s) to update their configuration with the new public key.