# Deploying Kali on AWS

![Deploying Kali on AWS](https://cdn.hashnode.com/res/hashnode/image/upload/v1680983307000/f488ee0f-e927-4b53-80bd-f8ddd6eedbd4.jpeg)

Here's how you can deploy kali on AWS for free under the free tier (for a year). as long as you stay under the usage guidelines. I did this so I could have a quick and dirty VM I can make use of when I'm not at my desk! Lezgo!

Prerequisites
-------------

*   Free verified AWS account

Deployment
----------

Head to the AWS Management Console and search for `EC2`. EC2 is amazon's version of a VPS.

![Deploying Kali on AWS](https://cdn.hashnode.com/res/hashnode/image/upload/v1680983308163/c209e1c9-57ef-4d8c-8d8f-3e20e4fc75e2.png)

Once there, hit `Launch Instance` on the dashboard as shown below.

![Deploying Kali on AWS](https://cdn.hashnode.com/res/hashnode/image/upload/v1680983310042/dcee05fd-6e3a-4810-bf87-8397f909f40b.png)

Next hit `AWS Marketplace`. This would show us a list of "ready to deploy" VMs that we can choose from.

![Deploying Kali on AWS](https://cdn.hashnode.com/res/hashnode/image/upload/v1680983311543/76aa6dc6-31c7-4c13-a24c-1d706904eeb0.png)

Then, search for `kali` and hit `select`. Make sure you select the option that says `Free tier eligible`.

![Deploying Kali on AWS](https://cdn.hashnode.com/res/hashnode/image/upload/v1680983312967/e982d487-5cbf-41ff-b6fb-c3d1a410c4d4.png)

Once selected and verified, hit continue.

![Deploying Kali on AWS](https://cdn.hashnode.com/res/hashnode/image/upload/v1680983314089/6b20d1bb-231a-406c-8fb6-d29a4c69b6fe.png)

At the `Instance Type` page, make sure to choose `t2.micro` which lets us use the free tier.

![Deploying Kali on AWS](https://cdn.hashnode.com/res/hashnode/image/upload/v1680983315893/8fb49b06-be94-407f-843b-f4d772f26c7b.png)

\[OPTIONAL\] Configure the Security Group to your liking. I'm adding a rule to allow all traffic as this machine will be behind a proxy for my use case.

    Type - All traffic => any traffic flow in or out of the VM
    Protocol - All => Any kind of traffic going to or coming from the VM
    Port Range - 0-65535 => Allow all ports
    Source - 0.0.0.0/0 => Rules with source of 0.0.0.0/0 allow all IP addresses to access your instance

![Deploying Kali on AWS](https://cdn.hashnode.com/res/hashnode/image/upload/v1680983317736/24118d81-b5e1-4406-8bc3-5f246f008c20.png)

Once configured, hit Review and launch. AWS will require you to create a new ssh key pair to deploy the machine. Once created, remember to download the keypair before proceeding.

![Deploying Kali on AWS](https://cdn.hashnode.com/res/hashnode/image/upload/v1680983318848/17d990de-85fb-4f3d-a6f2-8708ff0071c3.png)

![Deploying Kali on AWS](https://cdn.hashnode.com/res/hashnode/image/upload/v1680983320385/0dbc6cb6-40bd-42a0-a17b-e458c4198e2a.png)

Once the Instance State turns to `Running` we are all set!

![Deploying Kali on AWS](https://cdn.hashnode.com/res/hashnode/image/upload/v1680983321443/500d8039-6409-401d-9657-b54a7fe862cd.png)

To verify that the system is up and running lets `SSH` into it.

    ssh user@host -i cloudKali.pem

![Deploying Kali on AWS](https://cdn.hashnode.com/res/hashnode/image/upload/v1680983322729/86552c71-4908-47b9-bf36-41edf4b8f3a6.png)

All good! we now have a kali Linux on the cloud for absolutely free!

VM Configuration
----------------

A GUI would definitely be better than a CLI for the use case! Let's go ahead and set up a desktop environment together with VNC so we can access this over the web or even a VNC viewer later on.

Let's go ahead and install XFCE and the VNC server.

    ┌──(kali㉿kali)-[~]
    └─$ sudo apt-get install xfce4 xfce4-goodies tightvncserver -y

![Deploying Kali on AWS](https://cdn.hashnode.com/res/hashnode/image/upload/v1680983324131/520523cc-bb52-4918-ba00-f4d4d8b44ee2.png)

Once that's completed, let's install the desktop base.

    ┌──(kali㉿kali)-[~]
    └─$ sudo apt-get install gnome-core kali-defaults kali-root-login desktop-base -y

![Deploying Kali on AWS](https://cdn.hashnode.com/res/hashnode/image/upload/v1680983325583/12193a52-d23d-4a77-868a-3e9f69f20adb.png)

When prompted to configure gdm3, pick `lightdm` as the default display manager as shown below. As the name suggests, this is gonna be lighter on our system.

![Deploying Kali on AWS](https://cdn.hashnode.com/res/hashnode/image/upload/v1680983326951/95621749-3fa8-41df-af23-c8870fcab599.png)

Now that that's done, let's configure the `tightvncserver`.

    ┌──(kali㉿kali)-[~]
    └─$ tightvncserver          

![Deploying Kali on AWS](https://cdn.hashnode.com/res/hashnode/image/upload/v1680983328032/137c4c50-27dc-4e5e-8792-6c5b7b290252.png)

That's it. We're done configuring VNC and the GUI Desktop. Go ahead and onboard this VM to your favorite VNC viewers. I'll be onboarding it to my web-based VNC client that I have deployed on a proxy server. Once onboarded, you should be able to connect to the instance without any issues!

On PC
-----

![Deploying Kali on AWS](https://cdn.hashnode.com/res/hashnode/image/upload/v1680983329282/505b9e1a-b6f4-405c-a3db-e45e879adcab.png)

On Mobile
---------

![Deploying Kali on AWS](https://cdn.hashnode.com/res/hashnode/image/upload/v1680983331639/d7000d97-1d25-4f13-940f-6c25ce5e16d6.png)

Pretty cool! Hope this helps someone out there :)
