Set-up a FREE VPN Server in 10 minutes with DigitalOcean

Katherine Petalio-Amar
5 min readNov 2, 2022
Photo by Petter Lagson on Unsplash

In this tutorial you will learn how to set up Free VPN on DigitalOcean using OpenVPN.

Prerequisite

  • DigitalOcean Account (If you don’t have you can create one and click my referral link to have a free $200 dollar credit)
  • OpenVPN App (You can download it here)

Create new Droplet

On your DigitalOcean account click Create button, just click it and select Droplet on the list.

On the next page select your Data Centers, you can select any region you like.

You will also need to select Image (this is not literally a picture, it’s a cloud term for OS, BuiltIn Application that can run on your server). On this part select Marketplace tab you will see a search bar in here. Now search for OpenVPN and select it.

You also need to select Server Size, for this tutorial we will be using the lowest possible server size.

Droplet TypeShared CPU

CPU Option Regular with SSD

Price$6/mo

Once you have selected your server size, you need to set up Server Authentication. You can choose between SSH Key or Password but I recommend you to use SSH Key which is more secure.

If you are not familiar with SSH Key, there is an instruction once you click Add SSH Key.

Finalize your details, you can change the hostname to any name you like. Then just click Create Droplet, this will now create your VPN Server.

Set up OpenVPN Configuration

Once your droplet has been created, you need to configure your VPN. You need to connect to your VPN Server via SSH, to do this you need to know the IP Address of your server, you can see it on your droplet details.

Now, open your terminal and access your server via SSH. Just enter the following command, and change <serverIPAddress> to your server IP Address.

$ ssh root@<serverIPAddress>

There would be some question on your first login, just read it carefully and answer the question.

On first login you will be ask to to accept the License Agreement of OpenVPN Access Server.
Just enter yes, to continue.

Will this be the primary Access Server node?
Just click enter for default.

Please specify the network interface and IP address to be used by the Admin Web UI:
Just click enter for default.

Please specify the port number for the Admin Web UI:
Just click enter for default.

Please specify the TCP port number for the OpenVPN Daemon:
Just click enter for default.

Should client traffic be routed by default through the VPN?
Just click enter for default.

Should client DNS traffic be routed by default through the VPN?
Just click enter for default.

Use local authentication via internal DB?
Just click enter for default.

Should private subnets be accessible to clients by default?
Just click enter for default.

Do you wish to login to the Admin UI as “openvpn”?
Just click enter for default.

Please specify your Activation key (or leave blank to specify later):
Just click enter for empty or you can add you activation key for OpenVPN if you have.

After configuration is complete please take note of your Admin UI and Client UI URLS, you will be needing it to connect to your VPN.

After initializing OpenVPN you need to set password for your openvpn account. Just enter the following command to set your password:

$ sudo passwd openvpn

And just hit enter, this will asked you to set your password.

Connect to VPN

Once you already setup your password you can now connect to your VPN. Open you OpenVPN App, at add your credentials.

On URL enter your Client UI Url. It will also ask for Username and Password. Upon first login, you will see an SSL certificate warning. This is normal. Just click accept, here are more details about SSL certificates.

After you added your VPN profile to your OpenVPN App, just toggle the switch connection button.

Once you are connected, go to https://whatismyipaddress.com/ this should display the IP Address of your VPN Server.

If it does not display your Server IP Address, go through again with your set up.

Note: Free VPN Connection is only up to two (2), if you need more than 2 connection you need to apply for activation key on OpenVPN.

Reference:

If you have any questions, feel free to use the comment section below. I will try my best to help and solve any further issues. 😉

--

--

Katherine Petalio-Amar

I'm a Software Developer with experience in Web Development and Mobile App Development and a bit knowledgeable in Server Management.