Supported PostgreSQL Versions Artifactory supports PostgreSQL version 13.x and below (9.5 and 9.6 were EOL in 2021). Use the commands below to create an Artifactory user and database with appropriate permissions. Modify the relevant values to match your specific environment: Once you have verified that the script is correct, you need to run it to create the database and proceed with configuring the database. Artifactory Privileges We recommend providing Artifactory with full privileges on the database. When you configure Artifactory to use PostgreSQL, all the artifact information is stored in PostgreSQL while the artifact binary data is stored in the file system (under While it is possible to store BLOBs inside PostgreSQL we do not recommend it. This is important because the PostgreSQL driver does not support streaming BLOBs with unknown length to the database. Therefore, Artifactory temporarily saves deployed files to the filesystem and only then saves the BLOB to the database. Edit the database connection details in the system.yaml configuration file as follows. Available from Artifactory 7.31.10. Edit the Because Artifactory uses multiple drivers and you need to configure the connection strings for these separately. The The The following sample shows an example To enable Transport Layer Security (TLS) encryption for PostgreSQL, set the For example, in the $JFROG_HOME/artifactory/var/etc/system.yaml file: If you are using old certificates or have an AWS RDS instance that was created before July 2020, you will not have Subject Alternative Name (SAN) enabled. To resolve this issue, you will need to generate a new certificate with SAN.Creating the PostgreSQL Database
CREATE USER artifactory WITH PASSWORD 'password';
CREATE DATABASE artifactory WITH OWNER=artifactory ENCODING='UTF8';
GRANT ALL PRIVILEGES ON DATABASE artifactory TO artifactory;
Configuring Artifactory to Use PostgreSQL
$JFROG_HOME/artifactory/var/data/artifactory/filestore
).Configuring Artifactory to Use PostgreSQL Single Node
shared:
database:
type: postgresql
driver: org.postgresql.Driver
url: jdbc:postgresql://<your db url, for example: localhost:5432>/artifactory
username: artifactory
password: password
Configuring Artifactory HA to Use PostgreSQL Database in HA
system.yaml
file to update the following values.url
field under the shared
database section in the following format.jdbc:postgresql://<PostgreSQL Database 1 URL>,..., <PostgreSQL Database N URL>/artifactory?targetServerType=primary
url
field under the metadata
database section in the following format.jdbc:postgresql://<PostgreSQL Database 1 URL>,..., <PostgreSQL Database N URL>/artifactory?target_session_attrs=read-write"
system.yaml
file configuration.systemYaml:
shared:
logging:
...
database:
type: postgresql
url: "jdbc:postgresql://17.21.0.2:5432,17.21.0.3:5432/artifactory?targetServerType=primary"
driver: org.postgresql.Driver
username: "artifactory"
password: "password"
artifactory:
Database:
...
frontend:
...
access:
...
metadata:
database:
type: postgresql
url: "jdbc:postgresql://17.21.0.2:5432,17.21.0.3:5432/artifactory?target_session_attrs=read-write"
driver: org.postgresql.Driver
username: "artifactory"
password: "password"
...
Enabling TLS Encryption
sslmode
property to verify-full
in the
JDBC connector URL.shared:
database:
...
url:jdbc:postgresql://mypostgress.mydomain.com:5432/artifactory?ssl=true&sslfactory=org.postgresql.ssl.jdbc4.LibPQFactory&sslmode=verify-
full&sslrootcert=/tmp/server.crt
...
Creating an Artifactory User and Database