# Governance App Deployment on Linux with Load Balancer

The Governance Apps allow enterprises to create mini-apps that leverage customized forms to conduct surveys and campaigns for governance activities.

This article explains the Governance App deployment process in a Linux environment, including prerequisites and configuration steps.

## Prerequisites

* **Sudo Access**\
  Required to create and manage the `gov-app` systemd service file.
* **Internet Access**\
  Needed to download the `application.yaml` file.\
  \&#xNAN;*If internet access is unavailable, ensure `application.yaml` is already present in the `governance` folder.*
* **Java**
  * Java 1.8 is required.
  * Verify installation with:

    ```bash
    java -version
    ```
* **Memory Requirements**\
  Minimum 2 GB RAM.
* **Load Balancer (Optional)**\
  When using a load balancer, configure the domain name and SSL certificates in the same manner as for the main OvalEdge application.

## Installation Steps

### Governance App Installation

* **Create Governance Folder**

  * Open a terminal window.
  * Navigate to the OvalEdge home directory.
  * Create a folder named **governance** by running the following command

  ```bash
  mkdir ~/governance
  ```
* **Download YAML Configuration File**\
  Obtain `application.yaml` from the provided the following [link](https://ovaledge.s3.us-west-1.amazonaws.com/OvalEdge+Clients/Gov-App/Ubuntu/Gov-app-domain/application.yaml).
* **Update Configuration File**
  * Add database connection details.
  * Supported credential providers:
    * **Default (credentialProvider: default)** → credentials stored directly in YAML

      <figure><img src="/files/OMgOiMIb4a83g3hBWsNm" alt=""><figcaption></figcaption></figure>
    * **AWS Secrets Manager (credentialProvider: aws)** → provide secret keys for `jdbcstring`, `username`, and `password`\
      &#x20;<br>

      <figure><img src="/files/ioR3hmJUIUNizF6OJxWJ" alt=""><figcaption></figcaption></figure>

      <figure><img src="/files/Oexu3kCPPImVp0xFUpnC" alt=""><figcaption></figcaption></figure>
    * **Azure Key Vault (credentialProvider: azure)** → provide secret keys for `jdbcstring`, `username`, and `password`&#x20;

      <figure><img src="/files/R6q61JQbyw0dF0CRWryZ" alt=""><figcaption></figcaption></figure>

      <figure><img src="/files/SQ8xIBpW7CafXJ9AOJ5b" alt=""><figcaption></figcaption></figure>
* **Create Credentials Folder**

  ```bash
  mkdir ~/governance/credentials
  ```

  Update the path to this folder in `application.yaml`.<br>

  <figure><img src="/files/hFSpuafijv3nsDs03CnA" alt=""><figcaption></figcaption></figure>
* **Place Governance App JAR File**\
  Copy `oe-gov-app.jar` into the `governance` folder.

### Service Setup

* **Create Service File**\
  Navigate to `/etc/systemd/system/` and create `oe-gov.service`:

  ```bash
  cd /etc/systemd/system
  vi oe-gov.service
  ```

  Add the following content:<br>

  ```ini
  [Unit]
  Description=OE Governance App

  [Service]
  ExecStart=/usr/bin/java -jar <gov-app-jar-path>/oe-gov-app.jar --spring.config.location=<gov-app-yaml-path>
  WorkingDirectory=/home/ovaledge/governance/
  User=ovaledge
  Restart=always

  [Install]
  WantedBy=multi-user.target
  ```

  <figure><img src="/files/wTX9r8eRGmtcz6xNTe0z" alt=""><figcaption></figcaption></figure>
* **Enable and Start Service**

  ```bash
  sudo systemctl enable oe-gov
  sudo systemctl start oe-gov
  sudo systemctl status oe-gov
  ```

### Integration with OvalEdge

* **Update Oasis Properties**\
  In the OvalEdge installation directory, edit `extprop/oasis.properties` and configure the Governance App URL:<br>

  ```properties
  governance.app.url=https://<domain>:<port>
  ```

  <figure><img src="/files/1oIHSo9anrmMCxuzzGG4" alt=""><figcaption></figcaption></figure>
* **Restart Tomcat**

  ```bash
  sudo systemctl restart <tomcat-service-name>
  ```

### Verification

* Access the health endpoint to verify service status:<br>

  ```
  https://<domain>/actuator/health
  ```

  <figure><img src="/files/LRPMs0ckmSn5SVIA2pJs" alt=""><figcaption></figcaption></figure>
* In OvalEdge:
  * Log in as an administrator.
  * Navigate to **Administration > System Settings > Others**.
  * Locate the **Gov App Key** setting and update its value with the Governance App domain name.<br>

    <figure><img src="/files/Z8UJMXG67Wo11JCgsOwo" alt=""><figcaption></figcaption></figure>

### Troubleshooting

* **Port Conflicts**\
  Ensure the port defined in `application.yaml` is available and not blocked.
* **Log Files**\
  Use `journalctl -u oe-gov -f` to view logs if the service fails to start.
* **Configuration Issues**\
  Recheck `application.yaml` and `oe-gov.service` for errors if deployment fails.

***

Copyright © 2025, OvalEdge LLC, Peachtree Corners, GA, USA.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ovaledge.com/deployment-and-maintenance/integration/governance-app-deployment-on-linux-with-load-balancer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
