# Installation Guide with AWS (Advanced)

Step by step journey using AWS EC2 Ubuntu 24.04  
  
For this guide you need basic knowledge with Linux, SSH, Bash

# Getting Started

Hello!  
<span style="white-space: pre-wrap;">Welcome to Finmars, below you will find guidance of how to Install Everything </span>  
<span style="white-space: pre-wrap;">We also recommend you to obtain </span>[Finmars ID](https://id-auth.finmars.io/realms/finmars/account)

---

Here is summary of what we will achieve during this tutorial  
<span style="white-space: pre-wrap;">To complete this guide you will need </span>****Mac****<span style="white-space: pre-wrap;"> or </span>****Linux****<span style="white-space: pre-wrap;">, it will require to use </span>****Terminal****

- <span style="white-space: pre-wrap;">Register AWS account - </span>[Link](https://docs.finmars.com/books/installation-guide-with-aws-advanced/page/register-aws-account)
- <span style="white-space: pre-wrap;">Register Domain Name - </span>[Link](https://docs.finmars.com/books/installation-guide-with-aws-advanced/page/register-domain-name)
- <span style="white-space: pre-wrap;">Create Virtual Machine (VM) - </span>[Link](https://docs.finmars.com/books/installation-guide-with-aws-advanced/page/create-virtual-machine)
- <span style="white-space: pre-wrap;">Install Finmars Platform - </span>[Link](https://docs.finmars.com/books/installation-guide-with-aws-advanced/page/install-finmars-platform)
- <span style="white-space: pre-wrap;">Get to know our </span>[User Quick Start](https://docs.finmars.com/books/user-quick-start)<span style="white-space: pre-wrap;"> guide for next steps</span>

---

If you have some troubles during Installation - reach for any support channel:

- <span style="white-space: pre-wrap;">Create a </span>[Github Issue](https://github.com/finmars-platform/finmars-core/issues/new)
- <span style="white-space: pre-wrap;">Join our </span>[Discord](https://discord.gg/dJFxjwKQet)<span style="white-space: pre-wrap;"> Server</span>
- <span style="white-space: pre-wrap;">Contact us at </span><support@finmars.com>

# Register AWS Account

Here is a simple, step-by-step guide to make an AWS account:

1. ****Open your web browser****  
    (for example: Chrome, Firefox, or Edge).
2. ****Go to the AWS website****  
    <span style="white-space: pre-wrap;">Type </span>[aws.amazon.com](https://aws.amazon.com/)<span style="white-space: pre-wrap;"> in the address bar and press Enter.</span>
3. ****Start the sign-up****  
    <span style="white-space: pre-wrap;">Click the </span>****“Create an AWS Account”****<span style="white-space: pre-wrap;"> button at the top right.</span>
4. ****Enter your email and name****
    - In the first box, type your email address.
    - In the box below, type a name for your account (you can use your name or any name you like).
5. ****Choose a password****
    - Make a password you can remember.
    - Re-type it to confirm.
6. ****Fill in your contact details****
    - <span style="white-space: pre-wrap;">Select </span>****“Professional”****<span style="white-space: pre-wrap;"> or </span>****“Personal”****<span style="white-space: pre-wrap;"> account.</span>
    - Type your full name, phone number, and address.
    - <span style="white-space: pre-wrap;">Click </span>****“Continue”****.
7. ****Add payment information****
    - AWS needs a credit or debit card to verify you.
    - Type your card number, month/year, and name on card.
    - <span style="white-space: pre-wrap;">Click </span>****“Verify and Add”****.
8. ****Confirm your phone number****
    - Choose your country code and type your phone number.
    - <span style="white-space: pre-wrap;">Click </span>****“Send SMS”****.
    - You’ll get a text with a code. Type that code into the box.
9. ****Pick a support plan****
    - <span style="white-space: pre-wrap;">You can choose the </span>****Free Tier****<span style="white-space: pre-wrap;"> plan (it has no monthly cost).</span>
    - <span style="white-space: pre-wrap;">Click </span>****“Continue”****.
10. ****Finish and sign in****
    - After a few minutes, AWS will finish setting up.
    - <span style="white-space: pre-wrap;">Click </span>****“Sign In to the Console”****.
    - Enter your email and password again.

You now have an AWS account! 🎉  
You can log into the AWS Console and start using services.  
  
<span style="white-space: pre-wrap;">Go to next step: </span>[Register Domain Name](https://docs.finmars.com/books/installation-guide-with-aws-advanced/page/register-domain-name)

# Register Domain Name

You can register a domain right inside AWS using Route 53. Here’s how, in simple steps:

1. ****Sign in to AWS Console****  
    <span style="white-space: pre-wrap;">Go to </span>[https://console.aws.amazon.com](https://console.aws.amazon.com)<span style="white-space: pre-wrap;"> and log in.</span>
2. ****Open Route 53****  
    In the search bar at top, type “Route 53” and click the Route 53 service.
3. ****Go to Registered Domains****  
    <span style="white-space: pre-wrap;">In the left menu, click </span>****“Registered domains.”****
4. ****Start a new registration****  
    <span style="white-space: pre-wrap;">Click the </span>****“Register domain”****<span style="white-space: pre-wrap;"> button.</span>
5. ****Search your name****
    - <span style="white-space: pre-wrap;">In the box, type the name you want (for example, </span>`<span class="editor-theme-code">mywebsite.com</span>`).
    - <span style="white-space: pre-wrap;">Click </span>****“Check”****.
6. ****Choose an available name****
    - <span style="white-space: pre-wrap;">If it’s free, click </span>****“Add to cart.”****
    - <span style="white-space: pre-wrap;">If not, try a different name or ending (like </span>`<span class="editor-theme-code">.net</span>`).
7. ****View your cart****  
    <span style="white-space: pre-wrap;">Click </span>****“Review”****<span style="white-space: pre-wrap;"> or go to the cart icon.</span>
8. ****Enter contact details****
    - AWS needs your name, address, email, and phone.
    - <span style="white-space: pre-wrap;">If you want privacy, check </span>****“Enable privacy protection.”****
    - <span style="white-space: pre-wrap;">Click </span>****“Continue.”****
9. ****Verify and purchase****
    - Review the price and years (1 year, 2 years, etc.).
    - <span style="white-space: pre-wrap;">Click </span>****“Complete order.”****
10. ****Wait for confirmation****  
    AWS will send you an email when your domain is ready. It usually takes a few minutes.
11. ****Create a Hosted Zone****<span style="white-space: pre-wrap;"> (to use your domain)</span>
    - <span style="white-space: pre-wrap;">Back in Route 53, click </span>****“Hosted zones.”****
    - <span style="white-space: pre-wrap;">Click </span>****“Create hosted zone.”****
    - <span style="white-space: pre-wrap;">Type your new domain name and click </span>****“Create.”****
12. ****Point your domain to AWS****
    - In your hosted zone, copy the “Name servers” listed.
    - If AWS registered your domain, this is set automatically.
    - If you used another registrar, paste these name servers into their DNS settings.

Now your domain is registered and ready in AWS! 🎉  
You can add records (A, CNAME, MX) in your hosted zone to make your finmars work. See it in "[Create Virtual Machine](https://docs.finmars.com/books/installation-guide-with-aws-advanced/page/create-virtual-machine)" Page

# Create Virtual Machine

<span style="white-space: pre-wrap;">Sure! Let’s make your EC2 and name it </span>****finmars-platform-vm****. Follow these steps:

1. ****Sign in to AWS****
    - <span style="white-space: pre-wrap;">Open your browser and go to </span>[console.aws.amazon.com](https://console.aws.amazon.com).
    - Enter your AWS email and password.
2. ****Open EC2****
    - <span style="white-space: pre-wrap;">At the top, click the search box and type </span>****EC2****.
    - <span style="white-space: pre-wrap;">Click </span>****EC2****<span style="white-space: pre-wrap;"> under “Services.”</span>
3. ****Launch a new instance****
    - <span style="white-space: pre-wrap;">Click the blue </span>****Launch instances****<span style="white-space: pre-wrap;"> button.</span>
4. ****Name your instance****
    - <span style="white-space: pre-wrap;">In the </span>****Name tag****<span style="white-space: pre-wrap;"> box, type </span>****finmars-platform-vm****.
5. ****Choose AMI (Ubuntu 24.04)****
    - <span style="white-space: pre-wrap;">Scroll or search for </span>****Ubuntu Server 24.04 LTS****.
    - Pick 64-bit (x86) (should be default)
    - <span style="white-space: pre-wrap;">Click </span>****Select****.
6. ****Select instance type (2 vCPU, 8 GiB RAM)****
    - <span style="white-space: pre-wrap;">Find and click </span>****t3.large****<span style="white-space: pre-wrap;"> (it has 2 vCPU and 8 GiB).</span>
7. ****Create or select key pair****
    - <span style="white-space: pre-wrap;">Choose </span>****Create a new key pair****.
    - <span style="white-space: pre-wrap;">Name it (e.g. </span>****finmars-platform-vm-key****).
    - <span style="white-space: pre-wrap;">Click </span>****Create Key Pair****<span style="white-space: pre-wrap;"> and save the </span>`<span class="editor-theme-code">.pem</span>`<span style="white-space: pre-wrap;"> file safely. - </span><span style="color: rgb(224, 62, 45);">Do not Lose this file, if you lose it, you will not able to connect to your VM again</span>
8. ****Configure instance details****
    - <span style="white-space: pre-wrap;">Under </span>****Subnet****, pick one (any is fine).
    - Subnet - Default is ok (or do accordingly to your network configuration)
    - <span style="white-space: pre-wrap;">Turn </span>****Auto-assign Public IP****<span style="white-space: pre-wrap;"> to </span>****Enable****. (If already enabled - OK)
    - <span style="white-space: pre-wrap;">Turn on checkbox </span>****Allow SSH traffic from****
    - <span style="white-space: pre-wrap;">Turn on checkbox </span>****Allow HTTPS traffic from the internet****
    - <span style="white-space: pre-wrap;">Turn on checkbox </span>****Allow HTTP traffic from the internet****
    - Leave the rest as default.
    - <span style="white-space: pre-wrap;">Click </span>****Next: Add Storage****.
9. ****Add storage (256 GiB)****
    - <span style="white-space: pre-wrap;">Change the size from </span>****8****<span style="white-space: pre-wrap;"> to </span>****256****<span style="white-space: pre-wrap;"> in the root volume row.</span>
    - <span style="white-space: pre-wrap;">Keep the volume type as </span>****gp3****<span style="white-space: pre-wrap;"> or </span>****gp2****.
10. ****Review and launch****
    - Check all your settings.
    - <span style="white-space: pre-wrap;">Click </span>****Launch Instance****.
11. ****Wait for your VM****
    - <span style="white-space: pre-wrap;">Click </span>****View Instances****.
    - <span style="white-space: pre-wrap;">Wait until its status is </span>****running****<span style="white-space: pre-wrap;"> and checks pass.</span>
12. ****Connect to your VM****
    - <span style="white-space: pre-wrap;">Select the instance named </span>****finmars-platform-vm****.
    - <span style="white-space: pre-wrap;">Click </span>****Connect****.
    - Follow the instructions, for example:  
        ```
        # Move your Download key file to secure folder (~/Downloads not recommended)
        
        # if this first connect 
        chmod 400 "finmars-platform-vm.pem"
        ssh -i ./finmars-platform-vm.pem ubuntu@<Public-IP>
        
        
        # if this first connect
        # Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
        # yes
        ```

<span style="white-space: pre-wrap;">Your EC2 named </span>****finmars-platform-vm****<span style="white-space: pre-wrap;"> is ready! 🎉</span>

---

  
Now you need to assign your Public IP of your freshly created VM to subdomain of your domain.

1. ****Sign in to AWS****  
    <span style="white-space: pre-wrap;">Go to </span>[console.aws.amazon.com](https://console.aws.amazon.com)<span style="white-space: pre-wrap;"> and log in.</span>
2. ****Open Route 53****  
    <span style="white-space: pre-wrap;">In the top search bar, type </span>****Route 53****, then click the service.
3. ****Go to Hosted Zones****  
    <span style="white-space: pre-wrap;">In the left menu, click </span>****“Hosted zones.”****
4. ****Select your domain****  
    <span style="white-space: pre-wrap;">Find and click the zone named your\_domain.tld (for example, </span>`<span class="editor-theme-code">example.com</span>`).
5. ****Create the first record****
    - <span style="white-space: pre-wrap;">Click </span>****“Create record.”****
    - <span style="white-space: pre-wrap;">In </span>****Record name****<span style="white-space: pre-wrap;">, type </span>`<span class="editor-theme-code">finmars</span>`<span style="white-space: pre-wrap;"> (so full name is </span>`<span class="editor-theme-code">finmars.example.com</span>`). - It is Record for Actual Finmars Platform
    - <span style="white-space: pre-wrap;">For </span>****Record type****<span style="white-space: pre-wrap;">, choose </span>****A – IPv4 address****.
    - <span style="white-space: pre-wrap;">In </span>****Value****<span style="white-space: pre-wrap;">, type your EC2 public IP (for example, </span>`<span class="editor-theme-code">203.0.113.25</span>`<span style="white-space: pre-wrap;">). You can find it in EC2 details </span>
    - <span style="white-space: pre-wrap;">Leave </span>****TTL****<span style="white-space: pre-wrap;"> as default (300).</span>
    - <span style="white-space: pre-wrap;">Click </span>****“Create records.”****
6. ****Create the second record****
    - <span style="white-space: pre-wrap;">Click </span>****“Create record”****<span style="white-space: pre-wrap;"> again.</span>
    - <span style="white-space: pre-wrap;">In </span>****Record name****<span style="white-space: pre-wrap;">, type </span>`<span class="editor-theme-code">finmars-auth</span>`<span style="white-space: pre-wrap;">(so full name is </span>`<span class="editor-theme-code">finmars-auth.example.com</span>`). - It is Record for Single-Sign-On (SSO) Finmars
    - <span style="white-space: pre-wrap;">For </span>****Record type****<span style="white-space: pre-wrap;">, choose </span>****A – IPv4 address****.
    - <span style="white-space: pre-wrap;">In </span>****Value****, type the same EC2 public IP.
    - <span style="white-space: pre-wrap;">Click </span>****“Create records.”****
7. ****Wait a few minutes****  
    DNS needs a little time to spread out. After about 5 minutes, both
    - `<span class="editor-theme-code">finmars.example.com</span>`
    - `<span class="editor-theme-code">finmars-auth.example.com</span>`  
        will go to your VM’s public IP.

<span style="white-space: pre-wrap;">That’s it! Now both sub-domains point to your </span>****finmars-platform-vm****<span style="white-space: pre-wrap;"> server.</span>

You can verify it by run following command in Terminal (On Mac or Linux)  
  
`<span class="editor-theme-code">dig finmars.example.com</span>`  
`<span class="editor-theme-code">dig finmars-auth.example.com</span>`

  
Output should be like:

```bash
; <<>> DiG 9.10.6 <<>> finmars.example.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39082
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;finmars-platform-vm.finmars.com. IN	A

;; ANSWER SECTION:
finmars.example.com. 300 IN	A	203.0.113.25

;; Query time: 12 msec
;; SERVER: 192.168.178.1#53(192.168.178.1)
;; WHEN: Wed Jun 11 20:10:02 CEST 2025
;; MSG SIZE  rcvd: 76
```

---

  
  
<span style="white-space: pre-wrap;">Now go to next step: </span>[Install Finmars Platform](https://docs.finmars.com/books/installation-guide-with-aws-advanced/page/install-finmars-platform)

# Install Finmars Platform

#### Here is a Full Guide to install Finmars on your Ubuntu VM:

Complete time of full installation is less than 30 minutes, by the end of it you will get a Finmars Platform Installed on your Linux Server

<span style="white-space: pre-wrap;">Prerequisite: You need to open your Terminal and navigate to the directory that contains your key-pair (.pem file) that was created in </span>["Create VM" step of installation guide](https://docs.finmars.com/books/installation-guide-with-aws-advanced/page/create-virtual-machine)

1. **Connect to your VM**  
    Example:  
    ```
    # if this first connect 
    chmod 400 finmars-platform-vm.pem
    
    ssh -i ./finmars-platform-vm.pem ubuntu@<Public-IP>
    
    # if this first connect
    # Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
    # yes
    ```
2. **Install dependencies**  
    ```bash
    sudo apt update
    sudo apt install -y ca-certificates curl gnupg lsb-release ntp make git
    
    wget -qO- https://get.docker.com/ | sh
    
    sudo usermod -aG docker $USER
    newgrp docker
    ```
    
    To check if Docker installed:  
    `<span class="editor-theme-code">docker version</span>`  
    Should output:  
    ```
    Client: Docker Engine - Community
     Version:           28.2.2
    ...
    ```
3. **Create the finmars folder**  
    ```bash
    sudo mkdir -p /opt/finmars
    sudo chown $USER:$USER /opt/finmars
    ```
4. **Clone the Finmars Platform Community Edition repository from Github**  
    See [https://github.com/finmars-platform/finmars-community-edition](https://github.com/finmars-platform/finmars-community-edition) repository  
    ```bash
    cd /opt/finmars
    git clone https://github.com/finmars-platform/finmars-community-edition.git .
    ```
5. **Install Finmars Community Edition**  
    ```f#
    make install
    ```
    
    You should see something like this as successful result[You should see something like this as successful result:  ](https://docs.finmars.com/uploads/images/gallery/2025-06/screenshot-2025-06-11-at-20-37-55.png)[![Screenshot 2025-06-11 at 20.39.07.png](https://docs.finmars.com/uploads/images/gallery/2025-06/scaled-1680-/screenshot-2025-06-11-at-20-39-07.png)](https://docs.finmars.com/uploads/images/gallery/2025-06/screenshot-2025-06-11-at-20-39-07.png)
6. **Start all services**  
    ```bash
    make up
    ```

<span style="white-space: pre-wrap;">To Verify that is everything running </span>

`<span class="editor-theme-code">docker ps</span>`

And you should see something like:

[![Screenshot 2025-06-11 at 21.08.45.png](https://docs.finmars.com/uploads/images/gallery/2025-06/scaled-1680-/screenshot-2025-06-11-at-21-08-45.png)](https://docs.finmars.com/uploads/images/gallery/2025-06/scaled-1680-/screenshot-2025-06-11-at-21-08-45.png)

It means all the Docker Containers are running.

---

<span style="white-space: pre-wrap;">When all is done, you can Open Web Browser at </span>**finmars.example.com** and you should see **Finmars Welcome Page**

[![Screenshot 2025-06-11 at 21.11.43.png](https://docs.finmars.com/uploads/images/gallery/2025-06/scaled-1680-/screenshot-2025-06-11-at-21-11-43.png)](https://docs.finmars.com/uploads/images/gallery/2025-06/screenshot-2025-06-11-at-21-11-43.png)

<span style="white-space: pre-wrap;">After you press </span>**Login**<span style="white-space: pre-wrap;"> you will be redirected to </span>**Finmars Single-Sign-On**<span style="white-space: pre-wrap;"> (SSO) to </span>**finmars-auth.example.com**

[![Screenshot 2025-06-11 at 21.18.15.png](https://docs.finmars.com/uploads/images/gallery/2025-06/scaled-1680-/screenshot-2025-06-11-at-21-18-15.png)](https://docs.finmars.com/uploads/images/gallery/2025-06/scaled-1680-/screenshot-2025-06-11-at-21-18-15.png)

<span style="white-space: pre-wrap;">Login with your Credentials that you provided in 6) </span>**Configure env**<span style="white-space: pre-wrap;"> step. It should be yours </span>`<span class="editor-theme-code">ADMIN_USERNAME</span>`<span style="white-space: pre-wrap;"> and </span>`<span class="editor-theme-code">ADMIN_PASSWORD</span>`

<span style="white-space: pre-wrap;">After Login you will be redirected to </span>**Dashboard page**<span style="white-space: pre-wrap;"> in </span>**Finmars Platform**

[![Screenshot 2025-06-11 at 21.52.33.png](https://docs.finmars.com/uploads/images/gallery/2025-06/scaled-1680-/screenshot-2025-06-11-at-21-52-33.png)](https://docs.finmars.com/uploads/images/gallery/2025-06/screenshot-2025-06-11-at-21-52-33.png)

<span style="white-space: pre-wrap;">Congratulations you finished your </span>**Finmars Platform**<span style="white-space: pre-wrap;"> Installation </span>**Successfully**! Well Done!  
  
<span style="white-space: pre-wrap;">Get to know our </span>[User Quick Start](https://docs.finmars.com/books/user-quick-start)<span style="white-space: pre-wrap;"> guide for next steps</span>

If you have some troubles during Installation - reach for any support channel:

- <span style="white-space: pre-wrap;">Create a </span>[Github Issue](https://github.com/finmars-platform/finmars-core/issues/new)
- <span style="white-space: pre-wrap;">Join our </span>[Discord](https://discord.gg/dJFxjwKQet)<span style="white-space: pre-wrap;"> Server</span>
- <span style="white-space: pre-wrap;">Contact us at </span><support@finmars.com>  
    <span style="white-space: pre-wrap;"></span>