# Run your own private cloud with dess in AWS

dess is the self-hosted option for secondary servers of an atSign, and a great tool for developers to debug their applications! If you're not sure what an atSign is check it out [here](https://atsign.com/what-is-an-sign/)! You can run several secondary servers on a single instance of dess, as each secondary scales to use 6MB of ram or less.

dess is an acronym which stands for:

d. Distributed e. Edge s. Secondary s. Server

## Pre-requisites

* Registered atSign(s) to setup (get free/paid from [here](https://my.atsign.com/go) )
    
* An AWS account (sign up/in [here](https://aws.amazon.com) )
    
* A Fully Qualified Domain Name (FQDN)
    

### 1\. Registering your atSign

This topic is already well documented! Please follow the guidance of [The atPlatform FAQs](https://atsign.com/faqs/) and register via [the registrar site](https://my.atsign.com/go).

### 2\. Sign-up for AWS account

If you are new to AWS, signing up for an account is free! The cost of running dess is about $10/month. You can create your account [here](https://aws.amazon.com) and as of June 6th, 2021 there is a “free tier” available which was used during the original making of this guide which can be found on [atsign.dev](https://atsign.dev/docs/guides/dess-setup/dess-aws/).

![aws-free-trial.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1634753486373/8NqOo5nXjX.png align="left")

Follow the instructions on screen.

![aws-sign-up.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1634753505424/62GzdgYSF.png align="left")

Once you are done with registration, you will be able to login to your [aws console](http://aws.amazon.com/console).

Make sure that you select the correct region in the top right corner.

![aws-region.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1634753520823/M9ttqipBx.png align="left")

Select the region that is geographically closest to your location for best performance.

You are now setup on AWS and ready to prepare dess.

### 3\. Register your own fully qualified domain name (FQDN)

This step can be performed at a variety of sites, all with different pricing models. You can use sites like [Go Daddy](http://www.godaddy.com), [Namecheap](https://www.namecheap.com/), and many others. However, since we have AWS account, we can use it to register our domain through the Route 53 service.

In your AWS console navigate to services in top left corner and select `Route 53`.

#### a) Register domain name with AWS.

In your AWS console search for `Route 53`.

![aws-route53.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1634753543280/8mypOjFFn.png align="left")

You can start looking for your domain directly from here:

![image-20210726083635919.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1634753567018/De0K8li7Tw.png align="left")

Based on the domain name you search, AWS will give you similar options, and their pricing. As I am looking for the best deal, the .link domain seems like a good option at a cost of 5$ / year.

In my case 4atsign.link is free and I will register it by clicking “Add to cart” and continue.

![clip_image002.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1634753587931/p1PtNEq0h.jpeg align="left")

Fill out DNS registration form:

![clip_image004.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1634753608099/DsiyRvBml.jpeg align="left")

Continue review details and order. At this point if all is fine you should see your domain request pending:

![clip_image006.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1634753623593/cZa1nKDTp.jpeg align="left")

This can take some time so why don’t we move on to next step!

### 4\. Preparing AWS instance

Now since I am new to AWS, the easiest way to get started is by using the LightSail service from service catalog. This will enable you to deploy small system which is more then capable of handling dess at pre-set price.

![clip_image002-16272842283471.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1635178602223/_9xJOf70x.jpeg align="left")

Welcome to LightSail:

![clip_image004-16272842283482.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1635178622540/gNZc1gtWY.jpeg align="left")

First step is to create new instance. Fortunately, we have big orange button that can do just that!

There are several options we are presented at this moment. Since I am living in Europe I select “**Frankfurt, Zone A** (eu-central-1a)” as my instance location. Instance region will dictate how well will your instance response based on your geographical location. People located in India should selects APAC region where as people in US should select North America region. You can leave availability zone set as default.

![clip_image006-16272842283483.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1635178681600/JI1iVh6pz.jpeg align="left")

Next up will be selection of operating system we want to deploy. We know that dess works well with Ubuntu 20.04 LTS so let's select just that.

![clip_image008.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1635178712967/48WTgq7Ue.jpeg align="left")

You are presented with a couple more options, but unless you know what you are doing leave these as is.

![clip_image010.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1635178730584/hHG4uMghX.jpeg align="left")

Now let’s select an instance plan. dess is relatively light weight so for testing purposes I will select the first instance plan for $3.5/Month. This will provide us with 512 MB of RAM, 1vCPU, 20GB of storage and 1TB of data transfer. This is more than enough to run our dess.

![clip_image012.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1635178777770/7tP2tmEho.jpeg align="left")

Lastly we have to name our instance. This is the name you will be presented with in your dashboard.

![clip_image014.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1635178814636/wtElonVVEO.jpeg align="left")

Last but not least is to press “Create instance”:

![clip_image015.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1635178830794/QjXTB826K.png align="left")

After a couple of seconds you should be re-routed to your dashboard and see your instance up and running:

![clip_image016.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1635178845273/WuI1SAN4f.png align="left")

### 5\. Preparing your instance for network access

#### a) Assignment of Static IP

Next up, is to provide our instance with a static IP and linking our domain to it.

When you click on your instance name, it will take you to the management console, which should look like this:

![clip_image002-16272853840264.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1635178877152/nDEsjCjbI.jpeg align="left")

This is where you control hardware, connectivity and if needed can delete your instance.

Lets configure a static IP address for your new instance. Navigate to Networking and click on Create static IP:

![clip_image003.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1635178901218/ISRGI8l4n.png align="left")

Our region and instance is selected, so the only thing left is to name our static IP. I selected the name atsign-static, but it can be any name you like.

![clip_image005.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1635178925342/sxV62JwDs.jpeg align="left")

Let's hit create:

![clip_image007.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1635178938269/6baa3-fvP.jpeg align="left")

And voila, we now have a static IP address on the internet and it will not change. Now we can link our domain name with it.

![clip_image009.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1635178951751/--HBvSO4H.jpeg align="left")

When you click on your instance name and navigate to Networking, the static IP is now assigned.

![clip_image011.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1635178977958/WnWom-8TI.jpeg align="left")

#### b) Assignment of Domain name to your static IP

We can now move on to linking our static IP address to our domain. This is done via the AWS console which can be accessed in the top right of Lightsail.

![clip_image001.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1635178990770/ItDgCjBw3.png align="left")

Verify your email used for registering domain:

By now you should receive a verification email that will confirm registration of your domain. Click this link before moving on.

Linking domain with your static address:

Let's navigate to “Route 53” from Services menu.

![clip_image003.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1635179028154/v1BquqEpx.jpeg align="left")

From your dashboard click on “Domain” which will take you to the “Registered Domains” tab.

![clip_image005-16272854399076.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1635179047271/HacTw9Mah.jpeg align="left")

Here you can click on your registered domain which will take you to overview page with domain status and contacts.

![clip_image007-16272854399087.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1635179075160/4Y0fv3i2F.jpeg align="left")

Click on “Manage DNS”:

![clip_image009-16272854399088.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1635179098880/GQb-3CYCA.jpeg align="left")

And click on your domain name.

This will show you your DNS records for your domain. We now need to link A type record to your domain linking it to IP address of your instance.

This is done simply by typing your static IP address from previous step into field “Value” and clicking Create record:

![clip_image011-16272854399089.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1635179116863/lXHuuQpjQ.jpeg align="left")

If everything goes well you should see following in your domain dashboard:

![clip_image013.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1635179128949/veFgi8hDG.jpeg align="left")

To test if you are successful open command line and ping your domain. You should see your instance static IP address. It will not respond which is normal due to IPv4 firewall. It is actually good thing!

![clip_image014.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1635179143299/jwCUqx4cC.png align="left")

At this point we have created a DNS record we will use to link our dess. We created an instance name which will be running our dess and we have opened a port range which is exposed to the internet and we can communicate with the atSign root server and our apps.

#### c) Setting up Firewall

Next up, we need to make sure we have ports open for our dess to communicate with the root server and our apps. In Section networking go to section “IPv4 Firewall” and click “+ Add rule”. Our rule will be “Custom” on TCP protocol with Port range in a number higher than 1024. In my case, I have selected port range 8000-8010. This will enable me to run up to 10 atSigns in parallel.

![clip_image002-16272854074665.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1635179164229/wrL50Jqqf.jpeg align="left")

Click create and verify that your new rule is in list:

![clip_image002-16272854074665.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1635179164229/wrL50Jqqf.jpeg align="left")

### 6\. Instance setup and dess deployment

Open your [LightSail console](https://lightsail.aws.amazon.com/)

By now you should see your instance in “Running state”

![clip_image002-162728546025210.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1635179196090/oLX4HhULZ.jpeg align="left")

Open it and on the tab Connect click on “Connect using SSH”

![clip_image003-162728546025211.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1635179209059/ef1C4-HGT.png align="left")

You should be presented by a new window with command line:

![clip_image005-162728546025212.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1635179222535/EUXedcXqs.jpeg align="left")

Before we do anything else, we should update the system:

```plaintext
sudo apt update && sudo apt upgrade
```

This might take some time, but it will make sure we have latest repository information and the system is up-to-date.

Next make sure curl is installed, we will use curl to pull the dess installation file:

```plaintext
sudo apt install curl
```

Finally, run the dess installer:

```plaintext
curl -fsSL https://getdess.atsign.com | sudo bash
```

Once the installer is finished you should be prompted like so:

```plaintext
Dess installed, please move on to the sudo dess-create command.
```

### 7\. Registration of atSign in your private dess

At this step, you should already have your atSign registered at http://atsign.com. If not **go do it!**

I have registered my own free atSign (@ 44likelycanary) which I will link to my dess.

In your instance console, navigate to dess folder.

We now need to create the service that will host our atSign by executing the dess-create command:

```plaintext
$ sudo dess-create @44likelycanary 4atsign.link 8000 <email address> likelycanary
```

To make it more understandable:

I will be registering my atSign **@44likelycanary**.

I will be using my domain **4atsign.link** which I have registered through AWS.

I am using port **8000** which I have opened in my instance firewall.

My registration email address is **&lt;email address&gt;** (this email is used to sign the SSL certificates).

The last **likelycanary** is the name that docker will use to track the service.

If everything is successful you should see output like this:

![clip_image004-162728549379914.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1635179270876/maXkG1601.jpeg align="left")

At this moment your atSign is registered on your dess.

## 8\. Activation of atSign

Next up we need to activate it

Login to your dashboard [here](https://my.atsign.com/dashboard)

Open “my atSigns”

![clip_image001-162728550968115.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1635179311802/XBr0ZWmVj.png align="left")

Open “managed” of atSign you are registering”

![clip_image003-162728550968116.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1635179533975/ZypX-cJs2.jpeg align="left")

Navigate to Advance settings:

![clip_image005-162728550968117.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1635179593518/J7zHzKeUo.jpeg align="left")

If you have already activated your atSign you will be prompted to erase all your data first

![clip_image007-162728550968118.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1635179623471/-1-VQA8Io.jpeg align="left")

Once done you are able to link your atSign with your private dess. Use your domain and port number with which you have created service on your cloud instance and press Activate.

![clip_image009-162728550968119.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1635179637637/1LpmwUyra.jpeg align="left")

You should see that your atSign is being activated in your dashboard:

![clip_image011-162728550968120.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1635179657985/9ZmdlZGOf.jpeg align="left")

This can take several minutes so go get a cup of coffee, some tea maybe, stretch your body and pray you haven’t made any mistakes!

Once the activation process completes you are welcomed by green Activated.

![clip_image013-162728550968121.jpeg](https://cdn.hashnode.com/res/hashnode/image/upload/v1635179694031/P8Y-G4OyC.jpeg align="left")

You can now open atBuzz or atWavi and register your atSign via QR code and generate your keys!

**CONGRATULATIONS YOU'RE FINISHED!**
