Setup your own personal VPN server hosted on DigitalOcean with a single command.
Checkout repo and launch:
git clone https://github.com/GeorgiyDemo/digitalocean_vpn
cd digitalocean_vpn
python3 main.py
Read below how to get YOUR_TOKEN, YOUR_FINGERPRINT and KEY_DIR. First is needed to create/destroy droplets by your account, ssh fingerprint and directory is to be able to access created droplet using SSH
Once script is finished, you need to download .ovpn file via wget or web:
wget -O "ready.ovpn" --no-check-certificate https://IP:8080/
- Visit https://cloud.digitalocean.com/settings/api/tokens
- Click on "Generate new token" (or skip if you already have it)
- Copy generated token
- Replace "YOUR_TOKEN" string in main.py
- Generate new keys:
ssh-keygen -t RSA
- Default KEY_DIR is $HOME/.ssh/, but you can replace it by your own
- Visit https://cloud.digitalocean.com/settings/security
- Click on "Add ssh key" (or skip if you already have it)
- Copy ssh key fingerprint
- Replace "YOUR_FINGERPRINT" string in main.py
If you want to modify vpn just replace line 61 in main.py
os.system('ssh -i '+key_dir+' root@'+droplet_ip+' "yum install git -y && git clone https://github.com/georgiydemo/VPN && cd VPN && chmod +x docker.sh && ./docker.sh"')
MIT - Do whatever you want, attribution is nice but not required