Setting-up a VPN server in the cloud (AWS)
We are going to setup a vpn server in the cloud on AWS for free! I repeat for free!.
You will need a free AWS account if you dont have one signup.
First thing is to open up your web browser and navigate to aws.amazon.com to login to you aws console.
Once your all set and logged in, we start setting up the vpn.
Setup an instance that will allow us to run the vpn server.
-
Click on services and look for EC2 under Compute.
-
Scroll down and select launch instance.
You would select the amazon machine image you want from the list provided but the provided images only have the OS installed and that would take more time adding the required resources. but there is a better way.
- On the left select AWS Marketplace
Here we will have images with already prconfigured tools.
-
search for openvpn and select the
free tier eligible
tag, to avoid charges. and hit theSelect
button. (allows only 2 connections) -
Scroll down and select
continue
. on the loaded page select thefree tier eligable
instance and hit theReview and launch
button and hitlaunch
on the next page. -
Next we will need a key pair that will authorise you to access the instance. If you have one already choose an existing if you dont then select
create a new key pair
, give it a name and download then hitlaunch instances
button.be sure to remember the location of the downloaded file(filename.pem), we will need it later.
-
go to services and select EC2 and wait for it to be setup. once its set up it will show
running
. -
Right click on the instance and select connect. This will display instructions on how to connect.
-
Scroll down and copy the line with ssh comamand under
Example
. -
Launch the terminal/powershell and and move into the directory containing the downlaoded filename.pem file and paste the command.
-
Type yes and hit enter. the following propmts hit enter to retain the default settings unless you have a reason to change something.
- It will log you out and request you to login as
openvpnas
instead of root take note.use the same ssh command you used ealier to login as openvpnas. in the command look for
root
and replace it withopenvpnas
and hit enter. -
Lets set our own credentials. enter the command
sudo passwd openvpn
hit enter!. -
Navigate back to the console where the instance is select it and copy the
IPv4 Public IP
address. -
Open a new tab in the browser type https://ipv4adress:943/admin
select advanced and and select proceed.
-
Login with the credentials username: openvpn(incase you didnt change the username) and the password you created.
- Navigate to VPN settings, scroll down under
Routing
select route all internet traffic through vpn. Scroll down and save settings then hit theupdate running server
button.
Thats it for the server
Lets setup the VPN client for the different platforms.
- Open a new tab in the browser type https://ipv4adress:943. Login with the same credentials and choose your platform.
Be sure to follow the instructions for the different platforms as provided.