Member-only story

WireGuard VPN on Raspberry Pi

Maciej
2 min readMar 8, 2021

--

Introduction

We will create a VPN server which can be used to connect to your home LAN from outside using Raspberry Pi.

The client is assumed to be Windows and iOS, I don’t think there is any particular difference between macOS and ubuntu except for reading the configuration file.

Necessary will be port mapping/port opening on ​​the router side.

Installation procedure

Installation

$ sudo apt update
$ sudo apt upgrade
$ curl -L https://install.pivpn.io | bas

Generate key for the server

# Make a private key
$ wg genkey | sudo tee /etc/wireguard/server.key
$ sudo chmod 600 /etc/wireguard/server.key
# Generate and save the public key from the private key.
$ sudo cat /etc/wireguard/server.key | wg pubkey | sudo tee /etc/wireguard/server.pub
$ sudo chmod 600 /etc/wireguard/server.pub

Generate key for client

# Make a private key
$ wg genkey | sudo tee /etc/wireguard/client.key
$ sudo chmod 600 /etc/wireguard/client.key
# Generate and save the public key from the private key.
$ sudo cat /etc/wireguard/server.key | wg pubkey | sudo tee /etc/wireguard/client.pub…

--

--

Maciej
Maciej

Written by Maciej

DevOps Consultant. I’m strongly focused on automation, security, and reliability.

No responses yet