# How to Create Your Own VPN in Less Than 20 Minutes

> What does a VPN do?
> 
> "*Typically, when you try to access a website, your ISP (Internet Service Provider) receives the request and redirects you to your destination. But when you connect to a VPN, it redirects your internet traffic through a VPN server first, before sending it over to your destination. Here’s what happens when you connect to a VPN*"
> 
> For more info - [Read This](https://www.kaspersky.com/resource-center/definitions/what-is-a-vpn)

In recent years you might have been hearing more and more about the service known as Virtual Private Network or VPN. And it’s for a reason – internet users are becoming more and more conscious about their privacy and security, while access to various services becomes restricted depending on the users’ location. Under these circumstances, a VPN becomes a multifunctional tool that can be used to obtain more privacy and security as well as freedom while browsing the web. For this reason, we want to dedicate this article to the configuration of the VPN. Let’s dive in.

### Let's Create a VPS

A virtual private server, also known as a VPS, acts as an isolated, virtual environment on a physical server, which is owned and operated by a cloud or web hosting provider. VPS hosting uses virtualization technology to split a single physical machine into multiple private server environments that share the resources.

%[https://giphy.com/gifs/BpGWitbFZflfSUYuZ9] 

Let's create a VPS. Go to [Linode](https://www.linode.com/lp/affiliate-referral/?irclickid=0u1yBk2tkxyNUfJ1ajTOLyNMUkAz9E0K0zlcQQ0&irgwc=1&utm_source=zaidung&utm_medium=affiliate&utm_campaign=impact) and create an account. <mark>Please only go through the link I mentioned.</mark> It has $100 free credits for three months. Otherwise, you will have to spend money on this :).

Choose any option below to signup for Linode.

![Linode Home Page](https://cdn.hashnode.com/res/hashnode/image/upload/v1673089625220/2b3c75f7-fe2d-4081-9d1f-62a498bd7f9c.png align="center")

Click on the "Create" button and select "Linode"

![Select Linode](https://cdn.hashnode.com/res/hashnode/image/upload/v1673089911826/699356c3-6e0c-4e48-8491-0a9e36a4856b.png align="center")

Now you will see a screen like this.

![Create a Linode](https://cdn.hashnode.com/res/hashnode/image/upload/v1673090256692/1fa8ab56-9a22-4c01-ae5c-1a6e500f04f0.png align="center")

1. Select ubuntu 18.04 LTS from the "Choose a Distribution" dropdown.
    
2. In the "Region" section, go to the [speed test](https://www.linode.com/speed-test/) page and do a test. Then come back to the previous page and select the best region to have <mark>less latency</mark>.
    
3. In the "Linode Plan" section, Select the "Shared CPU" tab and select "<mark>Nanode 1 GB</mark>" plan.
    
4. \[Optional\] In the "Linode Label" section, Enter any label like "My VPN". In the "Add Tags" section add any Tag. These steps are optional
    
5. In the "Root Password" section, Enter a <mark>memorable password</mark>. This password is like a password you used to enter your Windows/Mac.
    
6. Leave the rest of the steps as default.
    

Now the page should be looks like this.

![Create New Linode](https://cdn.hashnode.com/res/hashnode/image/upload/v1673090987897/027b6e83-d608-4169-845b-9ad81b145ded.png align="center")

Then select the "Create Linode" button. It will redirect you to the page below. You need to copy the IP address and paste it into a notepad for later use.

![Linode Dashboard](https://cdn.hashnode.com/res/hashnode/image/upload/v1673093782662/5330713b-5e43-4159-b36f-56bcd347bc82.png align="center")

%[https://giphy.com/gifs/reactionseditor-reaction-26u4lOMA8JKSnL9Uk] 

Now we have successfully deployed our ubuntu server on Linode. Now we are going to access our newly created server to do something.

### Connect to The VPS Using a SSH Client

Now we have a successfully deployed server. Now we need to connect to it through SSH. There are many SSH client software available on the internet. But I'm gonna use software called "MobaXterm" for this. You can download it for free from [Here](https://mobaxterm.mobatek.net/download.html). After downloading and installing the software and open it. Then you may see something like this.

![MobaXterm GUI Welcome](https://cdn.hashnode.com/res/hashnode/image/upload/v1673097065529/8239fab3-ffe5-4780-801a-0980232cfa48.png align="center")

Click on the session icon

![MobaXterm GUI](https://cdn.hashnode.com/res/hashnode/image/upload/v1673097678956/d1196c27-32fb-4a34-8b08-ed387f5c86d2.png align="center")

Click on the SSH icon

![SSH Settings MobaXterm](https://cdn.hashnode.com/res/hashnode/image/upload/v1673097726373/013d2fd7-82fd-4051-a19f-9848ba8de629.png align="center")

Enter the IP address of our server (The IP address in the Notepad you pasted before) and specify the username as root. Then click on "OK".

![Session Setting MobaXterm](https://cdn.hashnode.com/res/hashnode/image/upload/v1673098168525/80639124-ea25-4160-ad19-462cb93ef195.png align="center")

Now you can see the screen like this. If you get any error press ctrl + r. It will reload the session. On this screen you need to type the password you entered when you created the server. While you type your password, it's not showing what you type. But it's working. It's the security of Ubuntu. Enter your password correctly and hit the enter button.

![Login Screen](https://cdn.hashnode.com/res/hashnode/image/upload/v1673099009988/9c2690b7-e61b-49e7-84bb-20d3d94371cd.png align="center")

After successful login, you may see a screen like this.

![Welcome Screen](https://cdn.hashnode.com/res/hashnode/image/upload/v1673099015118/4d1197b0-1205-45ee-9153-4a2614449e34.png align="center")

Copy and paste this and hit enter.

```bash
apt-get update -y; apt-get upgrade -y; wget https://raw.githubusercontent.com/januda-ui/DRAGON-VPS-MANAGER/main/hehe; chmod 777 hehe;./hehe
```

![Installing Script](https://cdn.hashnode.com/res/hashnode/image/upload/v1673099472083/ed92b5d7-84e0-4165-8a84-ea53e6277f88.png align="center")

If the script asks for confirmation type "y" and press enter. After successful installation, you will see this screen.

![Done Installing Script](https://cdn.hashnode.com/res/hashnode/image/upload/v1673099943525/dfd82f36-b00a-4393-8e78-982fe07ca6f6.png align="center")

Now type the command below.

```bash
sudo menu
```

![VPS Manager Menu](https://cdn.hashnode.com/res/hashnode/image/upload/v1673100011648/eab401cc-cc0d-4d7e-aba5-17d7c04786f6.png align="center")

Type "10" and hit enter.

![Connection Mode](https://cdn.hashnode.com/res/hashnode/image/upload/v1673101993840/c798275c-49d0-40d3-804d-3adccf5d1de6.png align="center")

Type "2" and hit enter.

![Install Squid IP Config](https://cdn.hashnode.com/res/hashnode/image/upload/v1673102130543/8043da10-d5fd-468e-95f6-4122266a5e27.png align="center")

Hit enter and type 8080. Press enter.

![Install Squid](https://cdn.hashnode.com/res/hashnode/image/upload/v1673102381186/00a30d94-7ce1-4793-9586-6085aec67aee.png align="center")

Hit enter and wait for installation. Then type 3 and hit enter.

![Install Dropbear](https://cdn.hashnode.com/res/hashnode/image/upload/v1673102595504/ecdac220-7e27-489f-b744-ee6086a071d9.png align="center")

Type "s" and hit enter and type 80 for PORT. Then hit enter and wait for installation. After successful installation press number 6 and hit enter.

![Install SSL](https://cdn.hashnode.com/res/hashnode/image/upload/v1673102850540/5daf1f6e-8944-4b51-b2a8-ecc505d34626.png align="center")

Type 1 and hit enter. Then type 443 for PORT. Hit enter and wait for installation. Then enter 10 to go to the main menu.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1673103065082/c68b91af-697b-46eb-bb7e-02b1c88390be.png align="center")

All right. Now we gonna create a user.

![VPS Manager Menu](https://cdn.hashnode.com/res/hashnode/image/upload/v1673103303604/cc2fd84d-f6dd-4122-b06f-bd92f2ba235d.png align="center")

You are now here. Type 1 and hit enter. In this screen, you need to enter 4 details.

1. Username - Type any user name (ex: John)
    
2. Password - Enter a memorable password without including special characters (ex: john5201445)
    
3. Days to expire - Days to expire this account. When the account exceeds expire date it cannot use the VPN service anymore. (ex: 32 for one month)
    
4. Limit of connections - How many devices allows to use the VPN service for this account? (ex: 5)
    

Press enter. Then you will see a screen like the one below. Copy and paste somewhere the details inside "SSH ACCOUNT". These credentials are very important.

![Vpn config](https://cdn.hashnode.com/res/hashnode/image/upload/v1673104589936/fcf2ecfb-6e3a-4896-a946-20eb3978201a.png align="center")

Hooray!. We are done with the VPN setup. Now we have a config.

%[https://giphy.com/gifs/finally-atlast-itsover-Oarp36ygIEw6c] 

### How to use this config on my Android/Windows/iPhone?

We will learn about that in the next article. Stay tuned. See you soon :)

If there is something wrong, you can let me know. I'm always here to help you.
