> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/server/getting-started/installation/database-setup/database-instance/postgresql.md).

# PostgreSQL

Install PostgreSQL on Windows, create a dedicated owner role, and create a Devolutions Server instance on PostgreSQL with the Devolutions Server Console.

Devolutions Server supports ***PostgreSQL*** 14 or later as its database engine, alongside SQL Server. The PostgreSQL server can be self-hosted, or a managed service that grants the `SUPERUSER` attribute. This page covers an installation on Windows with IIS, through the Devolutions Server Console. On Linux, see [Install Devolutions Server for Linux](https://docs.devolutions.net/server/knowledge-base/how-to-articles/install-devolutions-server-for-linux.md). With Docker, see [Devolutions Server Docker deployment](https://docs.devolutions.net/server/knowledge-base/how-to-articles/devolutions-server-docker-deployment.md).

The following limitations apply to PostgreSQL:

* The account that creates the database schema must have the `SUPERUSER` attribute.
* A single owner role is used for all the connections. The least-permission accounts for the scheduler and the web application are available on SQL Server only.
* Integrated Windows authentication and Microsoft Entra authentication are not supported. The connection uses a username and a password.
* The automatic SQL Server Express installation of the Devolutions Server Console does not apply. The PostgreSQL server must be installed beforehand.

For the other requirements, see [System requirements](https://docs.devolutions.net/server/overview-of-devolutions-server/system-requirements.md).

## Install PostgreSQL

1. Go to [postgresql.org](https://www.postgresql.org/) and click on ***Download***, then on ***Windows***.
2. Choose PostgreSQL 14 or later. Under ***Platform support***, make sure the version supports your Windows version.
3. Click on ***Download the installer***. On the EDB download page, download the ***Windows x86-64*** installer of the PostgreSQL version to install.
4. Run the downloaded installer and click on ***Next*** on the welcome page.
5. In ***Installation Directory***, select the path and click on ***Next***.
6. In ***Select Components***, keep all the components selected: ***PostgreSQL Server***, ***pgAdmin 4***, ***Stack Builder***, and ***Command Line Tools***. Click on ***Next***. The ***Command Line Tools*** include `pg_dump` and `pg_restore`, used by the Devolutions Server backup job.
7. In ***Data Directory***, select the path and click on ***Next***.
8. In ***Password***, enter and confirm a password for the database superuser (`postgres`). Click on ***Next***.
9. In ***Port***, keep the default port and click on ***Next***.
10. In ***Advanced Options***, keep the ***Locale*** set to ***DEFAULT*** and click on ***Next***.
11. Review the ***Pre Installation Summary*** and click on ***Next***, then click on ***Next*** again in ***Ready to Install***.
12. Once the installation is done, open ***pgAdmin 4***.
13. Select the PostgreSQL server, enter the password of the `postgres` user, and click on ***OK***. The server connects and its databases appear in the tree.

## Create a dedicated owner role

Create a dedicated role for Devolutions Server. The Devolutions Server Console uses this role to create the database, to create its schema, and for all the connections.

{% hint style="warning" %}
The role must have the `SUPERUSER` attribute to create the database schema. The schema creation modifies PostgreSQL type casts, which only a superuser can do.
{% endhint %}

1. In ***pgAdmin 4***, right-click on the PostgreSQL server and click on ***Query Tool***.
2. Run the following query:

   ```sql
   CREATE ROLE dvls_owner WITH LOGIN SUPERUSER PASSWORD '<password>';
   ```

After the instance is created, the schema upgrades and the normal operation of Devolutions Server do not require the `SUPERUSER` attribute. To limit the privileges of the role, remove the attribute. The role remains the owner of the database:

```sql
ALTER ROLE dvls_owner NOSUPERUSER;
```

## Create the Devolutions Server instance

{% hint style="info" %}
Before creating the instance, make sure that:

* The Devolutions Server Console is installed on the server.
* The PostgreSQL server is running, and its connection information is known: ***Host name/address***, ***Port***, the owner role, and its password. In ***pgAdmin 4***, the host and port are in the ***Connection*** tab of the server properties.
  {% endhint %}

1. In the Devolutions Server Console, click on ***New*** – ***IIS Web Server*** – ***Advanced installation***. The basic installation also offers ***PostgreSQL*** in its ***Database engine*** list.
2. On the ***Setting database information*** page, set ***Database engine*** to ***PostgreSQL***. The list contains ***Microsoft SQL Server***, ***PostgreSQL***, and ***SQLite***. With ***PostgreSQL***, a ***Port*** field appears with the default value `5432`, and the ***Authentication Type*** list is hidden.
3. In ***Host***, enter the PostgreSQL server name, or `localhost` when PostgreSQL is installed on the same machine.
4. In ***Port***, enter the port set during the PostgreSQL installation.
5. In ***Database***, enter the name of the Devolutions Server database.
6. In ***Username*** and ***Password***, enter the owner role and its password.
7. Click on ***Advanced Settings***.
8. Set the ***SSL mode*** of the connection: ***Disable***, ***Allow***, ***Prefer*** (default), ***Require***, ***Verify CA***, or ***Verify full***.
9. Click on ***OK***.
10. Click on ***Advanced Credentials*** to review the accounts used for ***Management Tools***, ***Scheduler Service***, and ***Web Application***. They are filled with the credentials entered on the page. On PostgreSQL, all three use the owner role: ***Apply Least Permissions*** is not available.
11. Click on ***Test Connection***. The result confirms the ***Connection to PostgreSQL***.
12. Click on ***Next***.
13. In ***General information***, enter a ***Server name*** and click on ***Next***.
14. In ***Select installation file***, choose the ***Installation source*** and click on ***Next***.
15. In ***IIS settings***, set the ***Website***, ***Access URI***, ***Installation folder***, and ***Application pool***, then click on ***Next***. See the [advanced installation](https://docs.devolutions.net/server/getting-started/installation/devolutions-server-instance-creation.md#advanced-installation) for more information about these settings.
16. In ***Create an administrator user***, enter the ***Username***, ***Password***, ***Confirm Password***, and ***Email*** of the administrator account, then click on ***Next***.
17. In ***Scheduler service***, choose the ***Service account*** and click on ***Next***.
18. In ***Recovery kit***, set the recovery kit options and click on ***Next***.
19. Review the ***Summary*** and click on ***Install***.
20. Once the installation succeeds, click on ***OK***.

The Devolutions Server web interface opens in the default browser. Sign in with the administrator account created in the wizard.

## Back up the PostgreSQL database

The built-in backup job of the [Backup manager](https://docs.devolutions.net/server/web-interface/administration/backup/backup-manager.md) backs up a PostgreSQL database with `pg_dump` and validates the backup with `pg_restore`. These tools must be available on the Devolutions Server host:

* Devolutions Server finds them in the `PATH`. On Windows, it also finds them in `%ProgramFiles%\PostgreSQL\<version>\bin`, where the PostgreSQL installer places them.
* To use other binaries, set the `DVLS_PG_DUMP_PATH` and `DVLS_PG_RESTORE_PATH` environment variables to their full paths.
* The major version of `pg_dump` must be equal to or newer than the major version of the PostgreSQL server. Otherwise, the backup fails.

The backup job does not include the encryption keys. Back them up separately.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.devolutions.net/server/getting-started/installation/database-setup/database-instance/postgresql.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
