Set Up Your Own VPN Server the Fastest and Easiest Way! (2 Minutes)

Hello!
Today we will look at how to set up an IPSEC VPN Server that you can use with the L2TP protocol, which is supported on all operating systems and is one of the easiest VPN connection types.
We will quickly set up our IPSEC VPN Server using Docker technology and start using it.
Don't worry, the 2 minutes include the Docker installation too ;)
The installation below was done on a Debian server.
For the VPN configuration to work, make sure UDP ports 500 and 4500 are open. If they are not, grant the necessary permissions before installing.
To make the installation as fast as possible and sit back while it runs, we will first create a "bash" file, give it permissions, then run it and simply watch :)
Now start your timers :)
#Oncelikle her zamanki gibi tam yetki alalım
sudo su
#Nano kullanarak "vpn.sh" isimli bir dosya oluşturalım
nano vpn.sh
In the editor that opens, copy all of the code lines below into the "vpn.sh" file and save it.
To save: after copying the code, press "CTRL+X" on your keyboard, then press "Y" and "Enter".
You can edit the VPN configuration details before copying; you can change the fields marked "(Degistirilebilir)" ("changeable")
If you already have Docker installed, don't forget to delete the code lines between ###--DOCKER--KURULUM--###!!
Code to copy:
#!/bin/bash
###--DOCKER--KURULUM--###
sudo apt update
sudo apt install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
sudo apt update
apt-cache policy docker-ce
sudo apt install -y docker-ce
###--DOCKER--KURULUM--###
#Calisma temizligi acisindan yeni bir dizin olusturuyoruz ve oraya geciyoruz
mkdir vpn
cd vpn
sleep 1s
#VPN Konfigurasyon dosyamizi olusturuyoruz
cat > vpn.env << EOF
######
# Asagidaki degiskenleri kendinize gore tanimlayabilir veya hicbir degisiklik yapmaya bilirsiniz.
# - Değerlerin etrafına "" veya "" koymayın.
# - Bu özel karakterleri değerler içinde KULLANMAYIN: \ "'
#L2PT için benzersiz anahtarimiz olusturuyoruz
VPN_IPSEC_PSK=90p3348tghm3457yt8r83g25lp6p4lq331
#VPN Girisi için kullanici adi ve sifre olusturma
VPN_USER=vpn
VPN_PASSWORD=password
#VPN Serverimiz için DNS server ayarlama. Asagidaki ayarlama CloudFlare DNS bilgileri kullanilmistir. Gunumuz icin en hizli cevap veren DNS server...
VPN_DNS_SRV1=1.1.1.1
VPN_DNS_SRV2=1.0.0.1
# (Zorunlu degil) Ek VPN kullanicilari tanimlayin
# - Kullanici adlari ve sifreler bosluklara ggre ayrilmalidir
# - Tum VPN kullanicilari ayni benzersiz anahtarini(sir) paylasacak
# - Ek kullanici eklemek icin asagiyi duzenleyin
# VPN_ADDL_USERS=additional_username_1 additional_username_2
# VPN_ADDL_PASSWORDS=additional_password_1 additional_password_2
######
EOF
#Docker calistirma islemi
docker run --name ipsec-vpn-server --env-file ./vpn.env --restart=always -p 500:500/udp -p 4500:4500/udp -v /lib/modules:/lib/modules:ro -d --privileged hwdsl2/ipsec-vpn-server
#5 saniyelik mola verip, VPN Serverin tam anlamiyla calismasini bekliyoruz...
sleep 5s
#VPN serverimizin calistigini ve sunucu bilgilerini kontrol ediyoruz
docker logs ipsec-vpn-server
After saving our "vpn.sh" file, the next step is to give it permissions and run it:
#Dosyayi tum kullanicilar icin calistirma yetkisi verelim
chmod +x vpn.sh
#Ve artik isin en keyifli yerine geldik. Calistiralim!
./vpn.sh
That's all there is to it :) Depending on your server and how fast you work, you can complete the installation in under 2 minutes.

If you get output like the one above, you can now stop wondering whether your information is being stolen while you use a free VPN.
By setting up your L2TP configuration, you can easily connect to your VPN Server!
Enjoy...