> ## Documentation Index
> Fetch the complete documentation index at: https://syteca.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Set Up a Remote PostgreSQL Server

> Install PostgreSQL on a remote server and configure it for Syteca Application Server. Covers postgresql.conf, pg_hba.conf, and opening port 5432 on both machines.

<Warning>
  This article applies to on-premises deployments only. Remote database configuration is not available in SaaS.
</Warning>

By default, Syteca Application Server and its PostgreSQL database can run on the same machine. If you want to host the database on a **separate server**, you need to configure PostgreSQL to accept remote connections and open port 5432 on both machines. This article walks through every step.

## Before you begin

* Identify the IP address of the Syteca Application Server. If your network uses NAT, you need the **external** IP address.
* Decide whether to allow connections from a single IP or from an entire subnet — you will enter this in `pg_hba.conf`.
* Confirm that you have administrator access to both the PostgreSQL server and the Application Server.

## Install and configure remote access

### 1. Install PostgreSQL

Download **PostgreSQL 10 or later** from the [official PostgreSQL website](https://www.postgresql.org/download/) and run the installer on the remote database server.

### 2. Configure listen addresses

On the PostgreSQL server, navigate to the data folder and open **`postgresql.conf`**:

```
C:\Program Files\PostgreSQL\<version>\data\postgresql.conf
```

Find the `listen_addresses` parameter. Set it to `*` to accept connections from any IP address, or replace `*` with the specific IP address of the Application Server:

```
listen_addresses = '*'
```

Save the file.

### 3. Allow the Application Server in pg\_hba.conf

In the same folder, open **`pg_hba.conf`**.

Under the **IPv4 local connections** section, add a new row with the following values:

| Field    | Value                                              |
| -------- | -------------------------------------------------- |
| Type     | `host`                                             |
| Database | `all`                                              |
| User     | `all`                                              |
| Address  | IP address of the Application Server / subnet mask |
| Method   | `md5`                                              |

<Note>
  If your network uses NAT, enter the **external** IP address of the Application Server in the Address field — not the internal one.
</Note>

Save `pg_hba.conf`.

### 4. Restart PostgreSQL

Restart the PostgreSQL service to apply both configuration changes. Changes to `postgresql.conf` and `pg_hba.conf` do not take effect until the service restarts.

### 5. Open port 5432 on both machines

On **both** the PostgreSQL server and the Syteca Application Server, open **Windows Firewall** and add an inbound rule that allows TCP traffic on **port 5432**.

<Frame caption="Windows Firewall inbound rule allowing TCP port 5432 for PostgreSQL remote access.">
  <img src="https://mintcdn.com/syteca/0FlD-vkHsBA1azVX/images/administration/database/postgresql-firewall-port-5432.png?fit=max&auto=format&n=0FlD-vkHsBA1azVX&q=85&s=8161ffb16d0cb311a62bc0284c3da6ea" alt="Windows Firewall new inbound rule dialog with TCP port 5432 entered for PostgreSQL remote access" width="744" height="611" data-path="images/administration/database/postgresql-firewall-port-5432.png" />
</Frame>

## Verify the connection

After completing all steps, the Syteca Application Server should be able to reach the remote PostgreSQL instance. If the connection fails, check the following:

* Port 5432 is open on **both** machines, not just one.
* The IP address in `pg_hba.conf` exactly matches the address the Application Server connects from.
* The PostgreSQL service was restarted after the configuration changes.
* If NAT is in use, the external IP address — not the internal one — is entered in `pg_hba.conf`.

## Next steps

<CardGroup cols={2}>
  <Card title="Configure PostgreSQL" icon="database" href="/docs/administration/database/creating-databases-manually#postgresql">
    Complete PostgreSQL configuration steps for Syteca Application Server.
  </Card>

  <Card title="PostgreSQL Without Superuser" icon="shield" href="/docs/administration/database/creating-databases-manually#grant-extra-privileges-syteca-7-23-and-later-only">
    Tighten security by running PostgreSQL under a non-superuser account.
  </Card>

  <Card title="Compare Database Types" icon="layers" href="/docs/administration/database/compare-databases">
    Not sure whether to use PostgreSQL or MS SQL Server? Compare both options.
  </Card>

  <Card title="Network Port Requirements" icon="network" href="/docs/get-started/requirements/network-ports">
    Full list of ports required across all Syteca components.
  </Card>
</CardGroup>
