Set up your own VPN with OpenVPN and DigitalOcean
Tags: openvpn, beginners, vpn, security
Published: 2020-09-13 04:38:33

---
title: Set up your own VPN with OpenVPN and DigitalOcean
published: true
date: 2020-02-22 16:45:46 UTC
tags: openvpn,beginner,vpn,security
canonical_url: 
---

### What is a VPN and why you need it ?

VPN — Virtual Private Network, allows you to create a **secure** connection over the **public Internet** to **_private networks at a remote location._**

A VPN can provide protection if you are traveling or using untrusted WiFi networks as all your traffic will be going through an encrypted tunnel, it also provide some privacy bonuses since websites you connect to won’t know your starting location and IP.

![](https://cdn-images-1.medium.com/max/984/1*rp42P0KmAFhAmYi2-1L0lw.png)

### OpenVPN

[**OpenVPN**](https://openvpn.net/) is an open-source commercial software that implements virtual private network (VPN) techniques.

### Set up OpenVPN on DigitalOcean

Since we are going to host our own VPN, first we need a server, and DigitalOcean is easy to start with, you can also try AWS or Google Cloud if you want more options.

Sign Up for DigitalOcean account with the following URL to get $100 credits.

[https://m.do.co/c/7d6bf3bf13c0](https://m.do.co/c/7d6bf3bf13c0) (and yes, it’s my referral link)

#### **Step 1**  : Creating cloud server with OpenVPN enabled on DigitalOcean_

After you create your account, go straight to CREATE > DROPLETS to create a “droplet” — cloud server.

![](https://cdn-images-1.medium.com/max/268/1*p-ImmEyE7qPYPzaCqyrK3Q.png)

You don’t need to start fresh on a new Ubuntu, there’s already an image that support OpenVPN. Marketplace > choose OpenVPN Access Server.

![](https://cdn-images-1.medium.com/max/1024/1*XBV82PoyGUdttf7cNvDhKA.png)

For personal or family usage, the cheapest plan with 1TB data should be enough and it costs only 5$/month; Remember ? With my [referral](https://m.do.co/c/7d6bf3bf13c0) link you got 100$ credit.

![](https://cdn-images-1.medium.com/max/202/1*-WPCCYfWHu7M5W3o0qeIDg.png)

For region you will want to choose the closest.

For Authentication, since you are going to create your own VPN, I assume you should have fundamental technical background and care about privacy, **_please choose SSH_**. If you have not had a pair of public-private key yet, please check [ssh-keygen](https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys-on-ubuntu-1604) for Ubuntu or [PuTTy](https://www.digitalocean.com/docs/droplets/how-to/add-ssh-keys/create-with-putty/) for Window.

#### Step 2 : A little configuration

On the MANAGE panel, go to Droplets > Click on your droplet.

You may want to wait a bit if it’s showing the droplet is being created, once it’s ready, you can proceed.

1. Log on via SSH to start the setup procedure, you will be asked a number of questions that need to be answered, mostly you can just use default by pressing Enter.
2. Once that is complete, enter the command “passwd openvpn” to set a password for your Access Server.
3. Now open the address of your server in a web browser `https://your_droplet_IP/admin/`, for example: `https://123.45.67.89/admin/`
4. If you see any SSL certificate warnings, that is normal, proceed anyway.
5. Now log on with username ‘openvpn’ and the password you set.

OpenVPN Access Server is ready, you can now add more users if you want to share this VPN with friends by adding users in the User Permissions table.

#### Step 3 : Almost done, just the client left

Go to `https://your_droplet_IP`, there’s no _“/admin”_ part this time.

Download the suitable version of client for your OS.

![](https://cdn-images-1.medium.com/max/504/1*19OJGC8PMh5TLuleluutTQ.png)

After installing the client, go ahead and open it to find the Access Profile already there for you, turn it on > Enter username +passwords that you set in User Permissions table of the admin tools, THAT’S IT.

Now you can enjoy your very own self-hosted VPN.

You can double check if everything is working by [https://www.whatismyip.com](https://www.whatismyip.com) , it should point to your droplet IP.