# wireguard_install_lxc ## Run as root #### Install prereqs ```bash apt install -y wireguard-tools resolvconf ``` #### Generate keys ```bash cd /etc/wireguard wg genkey | tee privatekey | wg pubkey > publickey ``` #### Create server config ```bash echo "[Interface]" > /etc/wireguard/wg0.conf echo "PrivateKey = " >> /etc/wireguard/wg0.conf echo "Address = 10.8.0.1/24" >> /etc/wireguard/wg0.conf echo "ListenPort = 51820" >> /etc/wireguard/wg0.conf echo "DNS = 1.1.1.1" >> /etc/wireguard/wg0.conf ```