Updated

What you see

Creating the WireGuard interface fails with one of these messages, usually the first time you try on a new VPS:
RTNETLINK answers: Operation not supported
Unable to access interface: Protocol not supported

What it means

WireGuard normally runs inside the Linux kernel, and these errors mean your server's kernel doesn't have it — or isn't allowed to use it. It points to the kind of VPS or its kernel, not to your config.
Quick fix
Run systemd-detect-virt. If it says openvz or lxc, the VPS shares its host's kernel and probably can't run kernel WireGuard — choose a KVM VPS. If it says kvm, check the kernel version with uname -r.

Causes and how to fix them

1. It's a container-based VPS (OpenVZ or LXC)

Container VPS plans share the host's kernel, so you can't add modules to it. If the host hasn't enabled WireGuard, it won't work in kernel mode. Check what you're on:
systemd-detect-virt
Your options are asking the host to enable WireGuard (some do), running the userspace wireguard-go program instead (it needs a TUN device, /dev/net/tun, which your host must switch on), or moving to a KVM VPS, which has its own kernel and runs WireGuard normally.

2. The kernel is older than 5.6

WireGuard became part of Linux in version 5.6. On older systems, such as Debian 10 or Ubuntu 18.04, the package builds the module for you but needs the kernel headers to do it:
uname -r
sudo apt install linux-headers-$(uname -r) wireguard

3. The module doesn't match the running kernel

After a kernel update, the module can exist for the new kernel while you're still running the old one. Restart so the two agree, then test by loading the module:
sudo reboot
sudo modprobe wireguard
If modprobe says the module wasn't found even on a current kernel, the host supplies a stripped-down kernel — contact support, or switch to a provider that lets you use the distribution's own.

Using Nullsify?

Nullsify's servers run WireGuard and AmneziaWG as userspace programs (amneziawg-go), so they don't depend on the kernel module. They do need a TUN device, which a few container VPS plans leave off — if setup fails on one of those, ask your host to enable TUN or choose a KVM plan.
Free for 1 server. Bring your own VPS — Nullsify configures WireGuard, AmneziaWG or VLESS on it for you.

Related problems

Read more