Wireguard on Proxmox LXC container

Prerequisites before starting the tutorial
Download the Ubuntu 18.04 CT template onto a storage drive in Proxmox.

Then follow this youtube tutorial with the code listed below

First create your LXC container using the CT template you downloaded earlier

In PVE shell run following commands to finalize your setup

cd /etc/pve/lxc
nano (container number)

add these lines at the end
lxc.cgroup2.devices.allow: c 10:200 rwm
lxc.mount.entry: /dev/net dev/net none bind,create=dir

Save and close nano

run this command
chown 100000:100000 /dev/net/tun

check that it worked
ls -l /dev/net/tun
output should be something like this
crw-rw-rw- 1 100000 100000 10, 200 Dec 22 13:26 /dev/net/tun

To install Wireguard in your newly created container:

Open the console of the container and login as root with the password you made during the container creation
Then visit pivpn.io to get the install link and copy this in the terminal and execute it.
curl -L https://install.pivpn.io | bash

Just follow all steps during the installation wizard and you’ll have a working Wireguard instance at the end.