19: Installing WireGuard - Secure VPN Access

WireGuard is a modern, fast, and secure VPN (Virtual Private Network) that lets you access your server and its services securely from anywhere. Once connected, you can access internal services, manage your server, and browse securely - all encrypted and protected!

For advanced features, API documentation, and technical details, see the official WireGuard documentation.

Why WireGuard?

Prerequisites

Note: WireGuard works great with Traefik and a domain name. Having a friendly URL like vpn.yourdomain.com makes it easy to access the web management interface.

Step 1: Start Infinity Tools

sudo infinity-tools

Step 2: Install WireGuard

  1. Go to 📱 APPLICATIONS
  2. Select WireGuard
  3. Choose Install WireGuard

Using the Infinity Tools GUI

Step 2.1: Network Configuration

You'll be asked to configure two networks:

VPN Network (Default: 10.13.13)

Host Network (Default: 10.13.14)

💡 Tip: Unless you have a specific reason, accept the defaults (just press Enter).

Step 2.2: DNS Configuration

WireGuard will automatically detect your server's DNS settings. This ensures VPN clients use the same DNS as your server for consistency.

Usually, you can just accept the auto-detected DNS (press Enter).

Step 2.3: Choose SSL Mode

You'll see two options. Here's what each means:

Simple rule of thumb: Use Standalone for most cases. Use Traefik if you have a domain and want trusted SSL.

Step 2.4: VPN Port Configuration

You'll be asked for the UDP port for VPN connections:

Step 2.5: Server Endpoint

You'll be asked for your server's public IP address or domain name:

What Happens During Installation

Step 3: Open Firewall Port

⚠️ CRITICAL: You MUST open the VPN port in your firewall, or clients cannot connect!

Opening the Port

sudo ufw allow 51820/udp

Replace 51820 with your custom port if you chose a different one.

Why This Matters

Step 4: Access WireGuard Web Interface

If Using Traefik

  1. Wait 30-60 seconds for SSL certificate generation
  2. Open https://vpn.yourdomain.com in your browser
  3. You'll see the WireGuard login page

If Using Standalone

  1. Open https://SERVER_IP:8445 in your browser
  2. You'll see a security warning (normal for self-signed certificates)
  3. Click "Advanced" → "Proceed to site" to continue
  4. You'll see the WireGuard login page

Step 5: Login to Web Interface

⚠️ CRITICAL: During installation, a random password was generated and displayed. Save it immediately!

Default Credentials

If You Lost the Password

You can retrieve it from:

cat /opt/speedbits/wireguard/web-password.txt

Login Steps

  1. Enter username: admin
  2. Enter the password shown during installation
  3. Click "Login"
  4. You'll see the WireGuard dashboard!

Step 6: Create Your First VPN Client

Now that you're logged in, let's create your first VPN client!

Adding a Client

  1. Click "Add Client" or the "+" button
  2. Enter a name for your device, e.g., "My Phone", "Laptop", "Work PC"
  3. Configure settings (or use defaults):
    • Allowed IPs: Usually auto-filled (VPN network + Host network)
    • Use Server DNS: Usually enabled (recommended)
  4. Click "Save" or "Create"
  5. You'll see a QR code and download options!

What You'll Get

Step 7: Set Up WireGuard on Your Device

Windows

  1. Install WireGuard from Microsoft Store
  2. Open WireGuard app
  3. Click "Add Tunnel""Import from file"
  4. Select the downloaded .conf file
  5. Click "Activate" to connect

Android/iOS/macOS

  1. Install WireGuard app from Play Store/App Store
  2. Open WireGuard app
  3. Tap "+""Create from QR code"
  4. Scan the QR code from the web interface
  5. Tap "Activate" to connect

Linux

  1. Install WireGuard: sudo apt install wireguard
  2. Copy the .conf file to: /etc/wireguard/wg0.conf
  3. Start WireGuard: sudo wg-quick up wg0
  4. Enable auto-start: sudo systemctl enable wg-quick@wg0

Step 8: Understanding VPN Networks

WireGuard creates two networks for different purposes:

VPN Network (10.13.13.0/24)

This network is for WireGuard clients and Docker services:

Host Network (10.13.14.0/24)

This network is for accessing host services (services running directly on the server):

What You Can Access via VPN

Docker Services (VPN Network)

Host Services (Host Network)

Security Recommendations

Firewall Best Practices

After setting up WireGuard, you can close other public ports:

# Close Webmin public access (access via VPN instead)
sudo ufw delete allow 8443

# Close Apprise public access (access via VPN instead)
sudo ufw delete allow 8444

# Close WireGuard web UI public access (access via VPN instead)
sudo ufw delete allow 8445

Now access everything securely via VPN!

Troubleshooting

Can't Connect to VPN

Can't Access Web Interface

Can't Access Services via VPN

Lost Web UI Password

Where to Find WireGuard After Install

Managing VPN Clients

Adding More Clients

Simply repeat Step 6 for each device you want to connect. Each device gets its own unique IP address.

Disabling Clients

In the web interface, you can disable clients without deleting them. This is useful if you temporarily don't want a device to connect.

Viewing Connection Stats

The web interface shows connection statistics for each client, including data transferred and connection time.

You're Ready!

WireGuard is now installed and ready to use! Remember:

Next steps: Create your first client, set up WireGuard on your device, test the connection, and start accessing your services securely from anywhere!


Revision #2
Created 17 November 2025 17:30:32 by bjoern
Updated 11 December 2025 15:58:29 by bjoern