Set Up Your Own Wireguard VPN Server on Ubuntu 22.04

  Рет қаралды 17,592

ZacsTech

ZacsTech

8 ай бұрын

In this video, we have an exciting tutorial where we'll be setting up WireGuard VPN on Ubuntu 22.04, step by step. WireGuard is a modern, fast, and secure VPN protocol. Setting it up on Ubuntu is relatively straightforward, and I'll guide you through the process.
Get Kamatera VPS (30 days free trial)
zacs-tech.com/go/kamatera-vps/
Get RedHosting VPS
zacs-tech.com/go/rosehosting/
Get InterServer VPS
zacs-tech.com/go/interserver/
Get Hawk Host VPS
zacs-tech.com/go/hawkhost/
Register domain name
tinyurl.com/y8hz9seu
Commands
sudo nano /etc/sysctl.conf
sudo sysctl -p
sudo apt install wireguard
wg genkey | sudo tee /etc/wireguard/server_private.key | wg pubkey | sudo tee /etc/wireguard/server_public.key
sudo nano /etc/wireguard/wg0.conf
----------------------------------------------------------------------------------
[Interface]
Private IP address for the wg0 interface ##
Address = 10.0.0.1/24
VPN server listening port ##
ListenPort = 51820
VPN server private key ##
PrivateKey = ncjecndiuvndeivenokdmcdpo0dockecok
Firewall rules ##
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o enp1s0 -j MASQUERADE
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o enp1s0 -j MASQUERAD
-------------------------------------------------------------------------------------------------------------
ip -o -4 route show to default | awk '{print $5}'
sudo chmod -R 600 /etc/wireguard/
sudo systemctl enable wg-quick@wg0
sudo systemctl start wg-quick@wg0
sudo systemctl status wg-quick@wg0.service
wg genkey | sudo tee /etc/wireguard/client_private.key | wg pubkey | sudo tee /etc/wireguard/client_public.key
sudo nano /etc/wireguard/wg0.conf
-----------------------------------------------------------------------------------------------------------------------
[Interface]
VPN client private IP address ##
Address = 10.0.0.2/24
VPN client private key ##
PrivateKey = 0COkq1GMM86CmlF5blPFDYhU84iTX8iJ7lWoC1gLfnk=
[Peer]
VPN server public key ##
PublicKey = Znnnnnmjiio
VPN server public IP address and port ##
Endpoint = 192.168.122.101:51820
Route all the traffic through the VPN tunnel ##
AllowedIPs = 0.0.0.0/0
Key connection alive ##
PersistentKeepalive = 15
------------------------------------------------------------------------------------------------------------
[Peer]
Client public key ##
PublicKey = 6mmmmmmm
Client IP address ##
AllowedIPs = 10.0.0.2/24
-------------------------------------------------------------------------------------------------------
sudo systemctl restart wg-quick@wg0.service
sudo systemctl start wg-quick@wg0
DISCLAIMER: This video and description contain affiliate links, which means that if you click on one of the product links, I’ll receive a small commission. This helps support the channel and allows us to continue to make videos like this. Thank you for your support!

Пікірлер: 10
@OniroPhotography
@OniroPhotography 4 ай бұрын
Great Tutorial very accurate. Congrats and thank you !
@gianfidimo1089
@gianfidimo1089 4 ай бұрын
Is it possible to install wireguard on a server that uses a SIM for the internet connection? Thank you very much for your reply
@saamirahimi6076
@saamirahimi6076 4 ай бұрын
Thank you
@Apollo-gs4dv
@Apollo-gs4dv 4 ай бұрын
Followed the instructions until this command: 'sudo systemctl start wg-quick@wg0'. The output is: 'client_loop: send disconnect: Connection reset'. After that I can no longer log in to my server
@combatjeyj6234
@combatjeyj6234 4 ай бұрын
oh no you destroyed your net configs and restarted the service only way to fix it is to reset your install or if in a vps ask for support
@user-jm4qr9jx7r
@user-jm4qr9jx7r 4 ай бұрын
how do you keep switching between client and server?
@danielgumprecht
@danielgumprecht 4 ай бұрын
via SSH
@BACKSPIN9ball
@BACKSPIN9ball 17 күн бұрын
very unorganized I should say, you mdae this complicated than it needed to be
@IvanTejada
@IvanTejada 5 ай бұрын
error in setup Firewall rules ## PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o enp1s0 -j MASQUERADE PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o enp1s0 -j MASQUERAD
@galax5130
@galax5130 4 ай бұрын
it's MASQUERADE not MASQUERAD at last line
Create your own VPN server with WireGuard in Docker
24:38
Christian Lempa
Рет қаралды 180 М.
50 YouTubers Fight For $1,000,000
41:27
MrBeast
Рет қаралды 208 МЛН
39kgのガリガリが踊る絵文字ダンス/39kg boney emoji dance#dance #ダンス #にんげんっていいな
00:16
💀Skeleton Ninja🥷【にんげんっていいなチャンネル】
Рет қаралды 8 МЛН
Clown takes blame for missing candy 🍬🤣 #shorts
00:49
Yoeslan
Рет қаралды 44 МЛН
The $0 Home Server
16:53
Kalos Likes Computers
Рет қаралды 819 М.
Self Hosting your OWN VPN is EASY and FREE using Wireguard in Docker
14:41
Easiest Way to Install WireGuard VPN!
14:16
Techdox
Рет қаралды 9 М.
How To Build Your Own Wireguard VPN Server in The Cloud
36:15
Lawrence Systems
Рет қаралды 172 М.
How to Make Your Own VPN (And Why You Would Want to)
25:54
Wolfgang's Channel
Рет қаралды 2,2 МЛН
WireGuard installation and configuration - on Linux
17:55
Christian Lempa
Рет қаралды 182 М.
Self Hosted WireGuard VPN on OpenBSD
26:46
Mental Outlaw
Рет қаралды 86 М.
Build your OWN WireGuard VPN! Here's how
12:21
Jeff Geerling
Рет қаралды 325 М.
50 YouTubers Fight For $1,000,000
41:27
MrBeast
Рет қаралды 208 МЛН