Skip to content

GeorgiyDemo/digitalocean_vpn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

DigitalOcean simple VPN setup ๐Ÿ

Setup your own personal VPN server hosted on DigitalOcean with a single command.

Install

Checkout repo and launch:

git clone https://github.com/GeorgiyDemo/digitalocean_vpn
cd digitalocean_vpn
python3 main.py

Requirements

Configure setup

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/ 

Obtain DigitalOcean API key

Obtain DIR and DigitalOcean SSH key fingerprint

  • 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

Tweak VPN

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"')

License

MIT - Do whatever you want, attribution is nice but not required