PostgreSQL database

Installation

Defguard Core uses a PostgreSQLarrow-up-right database for storage, so if you do not have it installed and configured yet, you can do so in this section. For this tutorial, we need to create a user with superuser privileges and a database.

First, install the PostgreSQL package:

On Debian/Ubuntu:

apt install postgresql postgresql-contrib

On Fedora/Red Hat:

dnf install postgresql-server

Also, check the PostgreSQL installation documentationarrow-up-right for Fedora.

On FreeBSD:

pkg install postgresql18-server postgresql18-contrib

Also, check the PostgreSQL installation documentationarrow-up-right for FreeBSD.

On NetBSD:

pkg_install postgresql18-server postgresql18-contrib

Also, check the PostgreSQL installation documentationarrow-up-right for NetBSD.

Configuration

Here is a brief guide on how to create a dedicated database user and a database for Defguard Core.

First, issue this command to create a new database user named defguard. The command will prompt for a password for the new user.

Then, create a new database named defguard and assign the user defguard as its owner.

circle-info

At this point, it might be useful to store the database connection details in the .pgpass file. The file format and its usage are described in the PostgreSQL documentationarrow-up-right.

Last updated

Was this helpful?