Published in


How to Make Your Own Unlimited VPN, Only 5$/month

How to create a VPN server to use for yourself in 5 minutes, not to share with others, so you do not have to worry about slowing down the connection. I often use this VPN to access some websites that restrict Russia IP.

First, you create a Digital Ocean account with this link. This link uses my referral code, so you will get 1 month for free (it gives 100$ to use in 60 days), but if you register yourself, it will not work. If you do not use Digital Ocean, then create your own server on Google Cloud or Amazon AWS EC2, remember to open the port. I chose the Digital Ocean because it’s simple.


After registration is complete, we will create a server to install the VPN on. You go to the green Create button on the edge of the screen, select Create Droplet (droplet is essentially the definition of Digital Ocean on a virtual server, not at all).

In the next step, you choose the operating system is Ubuntu 18.04(because its stability), choose the cheapest configuration (1 CPU, 1 GB RAM, price 5$ / month), select the region that is the country you want (I usually choose Frankfurt then the time to connect to Russia will be faster), and finally give your server a name (temporarily set to my-vpn-server, that’s so simple). So with 100$ from my link, you obviously got more than 2 months free.
Note: Choose the server near your country for a better connection!

After clicking Create, you wait a bit for the server to be started. About 2 minutes later, an email will send you the server login information, in which the account name is the root and the password will be a long string.


We will then log into the server. On the interface of Digital Ocean, if you refresh the page, you will see your newly created server appear. Select it and choose Access> Launch Console.

Wait a moment, you’ll see a black screen appear. In that screen, press any key on the keyboard to activate the Terminal interface (the command line driver used with the newly created server). When asked for the login information, enter the user as root, and the password is the messy email.

Note: when entering the password, the word will not appear, but actually there is recognition there. Enter finished and press Enter.

The first time you log in, the server will ask what “Current password” is, retype the password in the email. Then the computer will ask to set a new password, you can set any password you feel familiar with.


Now that we have configured the server, we will continue installing the VPN. The installation is extremely simple, you just need to type the following command, press Enter and wait.

wget -O && sudo sh

When the installation is completed (takes about 5 minutes), the following information will appear on the screen.

Make notes about this information in Evernote or any of your note-taking apps. The Server IP part is the address of the VPN server, PSK is called the private shared key (roughly understood as another password layer of the type of VPN we use — the L2TP protocol), the username and password are clearly familiar.

Now it’s time to connect your computer and your phone to the VPN server you just created. That part hasn’t changed compared to my old post, so I’ll copy it for you to reference.


Our VPN uses L2TP + IPSec security. This is a protocol supported by many operating systems, even though it is available, you do not need to install anything. Here I only guide with 4 popular platforms, other OSs, you guys will be curious. Usually, the VPN setting will be in your settings.

Windows 10 và Windows 8.x:

  1. Right-click on the network icon in the clock bar
  2. Select Open Network and Sharing Center> Set up a new connection or network
  3. Select Use my Internet connection (VPN)
  4. Enter the IP address of your server, and the Destination name box, enter what you like. Click Create
  5. Right-click the network icon, select Open Network and Sharing Center again
  6. On the left hand panel, select Change adapter settings. Right-click on the newly created VPN> Properties
  7. Switch to the Security tab, select Layer 2 Tunneling Protocol with IPsec (L2TP / IPSec)
  8. Click the Allow button, select “Challenge Handshake Authentication Protocol (CHAP)” and uncheck the rest
  9. Click the Advanced settings button> Use preshared key for authentication> enter your VPN password (in the example above is tinhte1234)
  10. Click OK to close all windows
  11. Find the Command Prompt application, right-click it, select “Run as administrator”, then enter the below command (you can copy and paste). Reboot the computer.
REG ADD HKLM\SYSTEM\CurrentControlSet\Services\PolicyAgent /v AssumeUDPEncapsulationContextOnSendRule /t REG_DWORD /d 0x2 /f

From now on, you can connect to the VPN by clicking the network icon> selecting your VPN> Connect. You will be asked for a username and password. Use this website to check if your IP address is the same as the server and you are out of Russia.

Mac OS X

  1. Open System Preferences> Network.
  2. Click the + in the upper left corner
  3. Choose VPN
  4. Select L2TP over IPSec in the “Type” box
  5. Enter something in the Service Name box> click Create
  6. Enter the server’s IP address
  7. Enter the username of the server
  8. Click the Authentication Settings button
  9. In the User Authentication section, select the Password box, enter your password
  10. Under Machine Authentication, select the Shared Secret box, and enter password again
  11. Click OK, select the “Show VPN status in menu bar” box
  12. Select Advanced> check the Send all traffic over VPN connection box
  13. Click OK, then Apply

From now on, you can connect to the VPN by clicking the VPN icon on the menu bar (located on the top of the screen)> selecting your VPN> Connect. Use this website to check if your IP address is the same as the server and you are out of Russia.

If the first time you have not connected to the VPN, then you try a few times is okay.


  1. Run the Settings application
  2. Select More> Wireless & Networks> VPN
  3. Select “Add VPN Profile” or the + sign
  4. Enter something you like in the Name box
  5. In the Type box, select L2TP / IPSec PSK
  6. In the Server box, enter the server’s IP address
  7. In the IPsec PSK (or Pre-shared Key) box, enter your password
  8. Click Save
  9. Select the newly created VPN
  10. Enter your username and password
  11. Click Save
  12. Click Connect
  13. Use this website to check if your IP address is the same as the server and you are out of Russia.


  1. Go to Settings -> General -> VPN.
  2. Select Add VPN Configuration ….
  3. Select Type> L2TP
  4. Back, in the Description box, enter a name of something you like
  5. In the Server box, enter the server’s IP address
  6. In the Account box, enter the username of the VPN
  7. In the Password box, enter your password
  8. In the Secret box, enter the password again
  9. Select the “Send All Traffic” line, make sure the switch is green
  10. Click Done
  11. Connect to the VPN



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store