Duncan McClean

How to create your own VPN server with DigitalOcean

Published 5 months ago

Recently I needed to create a VPN so I could watch a free episode of the West Wing. Originally I thought of using NordVPN but they wanted me to pay for a year upfront which isn't something I really want to do.

Then I had a thought: why don't I just create an Open VPN server with DigitalOcean? It would let me really easily spin up a server and then destroy it again after I've finished watching.

So that's exactly what I ended up doing. I thought I'd document it here in case I need to do it in the future or it's helpful for someone else.

1. Create a DigitalOcean account if you haven't already (that's a referral link, you'll get some nice credit and I'll get some nice credit, win win!)

2. Go to the Marketplace page and search for OpenDNS & PiHole. Click the big blue button to create your new server.

3. In the creation page, you can select where you'd like the server to be located and the size of server you want. After you're done, create the server. It'll take a few minutes to provision.

4. Once provisioned, you'll see an IPv4 address. You can then SSH into it.

5. When you SSH in, run cat /root/client.ovpn and copy and paste the output of the file contents into a new file

6. Save the new file with the .ovpn file extension.

7. If you don't already have it, download the OpenVPN Connect app for your computer.

8. Open the OpenVPN file with the OpenVPN Connect app

9. You should now be located inside your DigitalOcean droplet. To check your VPN is working and you're connected properly, go to https://whatismyipaddress.com/