Installing the Backend System

Follow these instructions to install, build, and verify the backend system.

System Requirements

To operate the backend system, you must have one of the following:

  • A 64-bit Mac OS (Intel or ARM)
  • A 64-bit Linux machine (Ubuntu or Debian)


I. Update the Environment

  1. Open a Terminal window; if using Linux or Mac.

  2. If you are using Linux, make sure your environment system packages are up to date.

    sudo apt update
    sudo apt upgrade

II. Install Java 17

  1. Install the OpenJDK package.

    Go to Download the kit based on your system requirements. Install the JDK.


    sudo apt install -y openjdk-17-jdk-headless unzip
  2. Verify that you have successfully installed version 17.

    java -version

    Make sure it is:

    java version "17.0.8" 2023-07-18 LTS Java(TM) SE Runtime Environment (build 17.0.8+9-LTS-211) Java HotSpot(TM) 64-Bit Server VM (build 17.0.8+9-LTS-211, mixed mode, sharing)

III. Install Docker and Docker Compose

  1. Download Docker Desktop to get all the necessary packages for this installation:

  2. Open the Docker Desktop.

  3. Confirm successful installation.


    docker info


    sudo docker --version
    sudo systemctl status docker  `

VI. Clone Backend System

  1. If you do not have Git, install it using the instruction here: Git - Installing Git (

  2. If you wish to iterate and develop on the backend, please fork the repo and then clone it from your own account. You can find steps to fork here:

  3. Download the latest implementation of the Samsung Health Stack backend system from GitHub.

    git clone

The folder in which you cloned the backend-system will be referred to as <install_path> within this document.

V. Firebase Service

  1. If you do not have an account, create a Firebase account and a project with default settings by visiting: Firebase (

  2. Go to the [Firebase console](Firebase console) and select your project.

  3. Click on the gear icon in the top left corner to access your project settings.

  4. Click on the Service accounts tab.

  5. Click the Generate new private key button to generate a new service account key file (we used Node.js on our Mac test).

    NOTE: You don't need to follow any further instructions on Firebase at this point - all you had to do was generate the key.

  6. Return to the terminal and create a Firebase service-account-key.json file.

    cd backend-system/platform
    touch service-account-key.json
  7. Update the service-account-key.json file with the private key generated in step 5 so service-account-key.json looks like the key you created/downloaded from Firebase.

  8. .gitignore this service-account-key.json file as it includes sensitive info about your Firebase account.


Method 1: Using Docker Compose


  1. Download from

  2. Extract the files and place them at the level of backend-system. Your file structure should look as follows for <install_path>:


II. Database (Optional)

  1. If you don't want to use our provided sample database, following the Configuring the Database page instructions if you want to connect to the running Postgres container.

  2. (Optional) Update PostgreSQL root user password and SMTP relay server host, username, port, and password. We use SMTP service to send account invitation/activation/password reset emails.

    MAIL_USER_PASSWORD= <new-value-here>
  3. (Required if performing Step 2) Sync password with Trino PostgreSQL catalog file downloaded located at: <install_path>/trino/etc/catalog/postgresql/
    connection-password= <new-value-here>

III. Compile

  1. Move into the backend-system directory.

    cd backend-system
  2. Compile and package the backend-related microservices:

    Mac & Linux:

    ./gradlew clean
    ./gradlew build -x detekt