Custom External Database

Firezone uses Postgresql DB as its primary data store.

Compatibility

Firezone should work fine on Postgres versions 12 and above, but we recommend using the latest stable version whenever possible. If you find an issue with your particular version of Postgres, please open a GitHub issue .

In general, Firezone should also work fine using external Postgres-based database services like Amazon RDS. See the configuration section below for more information configuring Firezone with an external DB.

Configuring Firezone to use an external database can be complicated and error-prone. We recommend using the bundled Postgres for Omnibus-based deployments or the official Postgres Docker image for Docker-based deployments if possible.

Configure Firezone to Connect

The Firezone Docker image uses the following environment variables to connect to the DB (fields in bold required):

NameDescriptionFormatDefault
DATABASE_ENCRYPTION_KEYThe base64-encoded symmetric encryption key used to encrypt and decrypt sensitive fields.base64-encoded StringNone -- must be generated on install
DATABASE_HOSTDatabase hostIP or hostnamepostgres
DATABASE_PORTDatabase portInteger5432
DATABASE_NAMEName of databaseStringfirezone
DATABASE_USERUserStringpostgres
DATABASE_PASSWORDPasswordStringpostgres
DATABASE_POOLSize of the Firezone connection poolInteger10
DATABASE_SSLWhether to connect to the database over SSLBooleanfalse
DATABASE_SSL_OPTSMap of options to send to the :ssl_opts option when connecting over SSL. See Ecto.Adapters.Postgres documentationJSON-encoded String{}
DATABASE_PARAMETERSMap of parameters to send to the :parameters option when connecting to the database. See Ecto.Adapters.Postgres documentation.JSON-encoded String{}

For more information, see the environment variable reference .

The official postgres docker image can be configured by setting environment variables for the container. See the Postgres image documentation for more details.