# Installation Guide with Azure (Advanced)

Step by step journey using Azure Virtual Machines 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 Azure account - </span>[Link](https://docs.finmars.com/books/installation-guide-with-azure-advanced/page/register-azure-account)
- <span style="white-space: pre-wrap;">Create Virtual Machine (VM) - </span>[Link](https://docs.finmars.com/books/installation-guide-with-azure-advanced/page/create-virtual-machine)
- <span style="white-space: pre-wrap;">Install Finmars Platform - </span>[Link](https://docs.finmars.com/books/installation-guide-with-azure-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 Azure 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>[https://azure.microsoft.com/en-us/](https://azure.microsoft.com/en-us/)<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>****“Get Started with Azure”****<span style="white-space: pre-wrap;"> button at the top right.</span>
4. <span style="white-space: pre-wrap;">Go to </span>****Pay as you go****<span style="white-space: pre-wrap;"> and press </span>****Sign Up****
5. ****Create new Microsoft Account or link Existing one****
    - Type your email address.
6. ****Choose a password****
    - Make a password you can remember.
    - Re-type it to confirm.
7. ****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”****.
8. ****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”****.
9. ****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.
10. ****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”****.
11. ****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 Azure account! 🎉  
You can log into the Azure Portal 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)

# Create Virtual Machine

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

1. ****Sign in to Azure****
    - <span style="white-space: pre-wrap;">Open your browser and go to </span>[https://portal.azure.com/](https://portal.azure.com/).
    - Enter your Azure email and password or Log in with your Microsoft Account.
2. ****Open Virtual Machines****
    - <span style="white-space: pre-wrap;">At the top, click the search box and type </span>****Virtual machines****.
    - <span style="white-space: pre-wrap;">Click </span>****Virtual machines****<span style="white-space: pre-wrap;"> under “Services.”</span>
3. ****Launch a new instance****
    - <span style="white-space: pre-wrap;">Click the </span>****Create****<span style="white-space: pre-wrap;"> button and pick </span>****Virtual Machine****.
4. ****Pick your Resource Group (or create New One)****
5. ****Pick Region (or leave default)****
6. ****Name your instance****
    - <span style="white-space: pre-wrap;">In the </span>****Virtual machine name****<span style="white-space: pre-wrap;"> box, type </span>****finmars-platform-vm****.
7. ****Choose Image (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****.
8. ****Select instance Size (2 vCPU, 8 GiB RAM)****
    - <span style="white-space: pre-wrap;">Find and click </span>****B2ms****<span style="white-space: pre-wrap;"> (it has 2 vCPU and 8 GiB).</span>
9. ****Create or select key pair****
    - <span style="white-space: pre-wrap;">Choose </span>****Username - azureuser****.
    - <span style="color: rgb(41, 40, 39); background-color: rgb(255, 255, 255);">SSH public key source</span><span style="white-space: pre-wrap;"> - Generate new key pair</span>
    - <span style="white-space: pre-wrap;">Key pair name - </span>****finmars-platform-vm-key****<span style="white-space: pre-wrap;"> - </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>
10. ****Select Inbound Ports****
    - <span style="white-space: pre-wrap;">Turn on checkbox </span>****SSH****
    - <span style="white-space: pre-wrap;">Turn on checkbox </span>****HTTPS****
    - Turn on checkbox ****HTTP****
    - <span style="white-space: pre-wrap;">Click </span>****Next: Disks****
11. ****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="color: rgb(41, 40, 39); background-color: rgb(255, 255, 255);">OS disk size</span>)
    - <span style="white-space: pre-wrap;">Keep the volume type as </span>****Premium SSD****
    - <span style="white-space: pre-wrap;">Click </span>****Next: Networking****
12. ****Networking****
    - <span style="white-space: pre-wrap;">Public IP: New Public IP </span>****finmars-platform-vm-ip****
13. ****Review and Create****
    - Check all your settings.
    - <span style="white-space: pre-wrap;">Click </span>****Review + Create****.
14. ****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>
15. ****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
        ```
16. When your Virtual Machine is created, go to Virtual Machine Details Page in Azure Portal
    - <span style="white-space: pre-wrap;">On Sidebar, go to </span>****Networking****.
    - <span style="white-space: pre-wrap;">Open </span>****Network Settings****
    - <span style="white-space: pre-wrap;">You should see </span>****Network Security Group****
    - <span style="white-space: pre-wrap;">Press </span>****Create Port Rule****<span style="white-space: pre-wrap;"> button (Inbound Port Rule)</span>
    - Follow this configuration:
        - Source: Any
        - Source Port Ranges: \*
        - Destination: Any
        - Service: Custom
        - <span style="white-space: pre-wrap;">Destination Port Ranges: </span>****8888**** <span style="color: rgb(224, 62, 45);">This is important</span>
        - Protocol: TCP
        - Action: Allow
        - Priority: 420
        - <span style="color: rgb(41, 40, 39); background-color: rgb(255, 255, 255);">Name</span>: Allow8888Inbound
    - <span style="white-space: pre-wrap;">Then press </span>****Add****<span style="white-space: pre-wrap;"> button</span>

<span style="white-space: pre-wrap;">Your Virtual Machine 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. ****Go to your DNS Provider****
2. ****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 VM 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 VM 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.”****
3. ****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 VM public IP.
    - <span style="white-space: pre-wrap;">Click </span>****“Create records.”****
4. ****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-azure-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

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 Docker****  
    ```bash
    sudo apt update
    sudo apt install -y ca-certificates curl gnupg lsb-release ntp
    
    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. ****Install Make****  
    ```bash
    sudo apt install -y make git
    ```
4. ****Create the finmars folder****  
    ```bash
    sudo mkdir -p /opt/finmars
    sudo chown $USER:$USER /opt/finmars
    ```
5. ****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 .
    ```
6. ****Create Storage folder****  
      
    ```bash
    mkdir ./storage
    sudo chown -R 1000:1000 ./storage
    ```
7. ****Configure env****  
    ```bash
    make generate-env
    ```
8. ****(Optional) Check created env** `<strong class="editor-theme-bold editor-theme-code">cat .env</strong>`**  
    ```bash
    REALM_CODE=realm00000
    BASE_API_URL=space00000
    SECRET_KEY=2e849ee2
    JWT_SECRET_KEY=f0d51adba17320c742fb1f046122ce1a8e22ca679bf7c7df28aa873ed5ca3d7a
    ENCRYPTION_KEY=a594c6607a48629884753fe0a6b5a907c6d8be8d63e4c274c67be040c276b1c4
    
    DOMAIN_NAME=ap-finmars.finmars.com
    CSRF_COOKIE_DOMAIN=ap-finmars.finmars.com
    CSRF_TRUSTED_ORIGINS=https://ap-finmars.finmars.com
    
    PROD_APP_HOST=https://ap-finmars.finmars.com
    APP_HOST=https://ap-finmars.finmars.com
    PROD_API_HOST=https://ap-finmars.finmars.com
    API_HOST=https://ap-finmars.finmars.com
    
    KEYCLOAK_REALM=finmars
    KEYCLOAK_SERVER_URL=https://ap-finmars-auth.finmars.com
    KEYCLOAK_URL=https://ap-finmars-auth.finmars.com
    PROD_KEYCLOAK_URL=https://ap-finmars-auth.finmars.com
    
    NUXT_APP_BASE_URL=/
    
    DB_HOST=db
    DB_PORT=5432
    DB_NAME=finmars_dev
    DB_USER=finmars_dev
    DB_PASSWORD=e21717b7ba0d4287dcdc292edc3c2164
    
    KC_DB_URL_HOST=db_keycloak
    KC_DB_PORT=5432
    KC_DB_USERNAME=keycloak
    KC_DB_PASSWORD=5de8131f84d79b68ba47d25a922dae92
    KC_DB_URL_DATABASE=keycloak
    
    RABBITMQ_HOST=rabbitmq
    
    REDIS_HOST=redis
    
    USE_FILESYSTEM_STORAGE=True
    
    SERVER_TYPE=local
    DEBUG=False
    USE_DEBUGGER=False
    DJANGO_LOG_LEVEL=INFO
    PROFILER=False
    ENABLE_DEV_DOCUMENTATION=False
    
    EDITION_TYPE=community
    
    ADMIN_USERNAME=test
    ADMIN_PASSWORD=test
    REDIRECT_PATH="/realm00000/space00000/a/#!/dashboard"
    
    MAIN_DOMAIN_NAME=ap-finmars.finmars.com
    AUTH_DOMAIN_NAME=ap-finmars-auth.finmars.com
    ```
9. ****Release certs****  
    ```bash
    make init-cert
    ```
    
    You should see something like this as successful result:  
    [![Screenshot 2025-06-11 at 20.37.55.png](https://docs.finmars.com/uploads/images/gallery/2025-06/scaled-1680-/screenshot-2025-06-11-at-20-37-55.png)](https://docs.finmars.com/uploads/images/gallery/2025-06/screenshot-2025-06-11-at-20-37-55.png)
10. ****Init keycloak****  
    ```bash
    make init-keycloak
    ```
    
    You should see something like this as successful result:  
    [![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)
11. ****Run database migrations****  
    ```bash
    make migrate
    ```
    
    You should see something like this as successful result:  
    [![Screenshot 2025-06-11 at 20.54.27.png](https://docs.finmars.com/uploads/images/gallery/2025-06/scaled-1680-/screenshot-2025-06-11-at-20-54-27.png)](https://docs.finmars.com/uploads/images/gallery/2025-06/screenshot-2025-06-11-at-20-54-27.png)
12. ****Start all services****  
    ```bash
    make up
    ```
    
    You should see something like this and other logs as successful result:  
      
    [![Screenshot 2025-06-11 at 21.03.52.png](https://docs.finmars.com/uploads/images/gallery/2025-06/scaled-1680-/screenshot-2025-06-11-at-21-03-52.png)](https://docs.finmars.com/uploads/images/gallery/2025-06/screenshot-2025-06-11-at-21-03-52.png)

<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>