---
updatedAt: 2026-09-29T11:33:03.000Z
agentTools:
  siteIndex: https://docs.jfrog.com/llms.txt
  projectIndex: https://docs.jfrog.com/installation/llms.txt
---

# Artifactory PostgreSQL Database Creation

Create the PostgreSQL user and database for JFrog Artifactory using SQL commands for both standard superuser and restricted superuser (e.g., AWS RDS) environments.

Use the commands below to create an Artifactory user and database with appropriate permissions. Modify the relevant values to match your specific environment.

**Create an Artifactory User and Database as a superuser**

```sql
-- Replace <REPLACE_WITH_DB_PASSWORD> with a quoted password before running this script.
CREATE USER artifactory WITH PASSWORD <REPLACE_WITH_DB_PASSWORD>;
CREATE DATABASE artifactory WITH OWNER=artifactory ENCODING='UTF8';
GRANT ALL PRIVILEGES ON DATABASE artifactory TO artifactory;
```

**Create an Artifactory user and database with a restricted superuser (such as rds\_superuser used by AWS RDS)**

```sql
-- Replace <REPLACE_WITH_DB_PASSWORD> with a quoted password before running this script.
CREATE USER artifactory WITH PASSWORD <REPLACE_WITH_DB_PASSWORD>;
ALTER ROLE artifactory WITH CREATEDB;

## Connect with the new user
\c <current-database> artifactory

## Create a new database and grant full privileges
CREATE DATABASE artifactory WITH OWNER=artifactory ENCODING='UTF8';
GRANT ALL PRIVILEGES ON DATABASE artifactory TO artifactory;
```

<Callout icon="❗" theme="warning">
  **Replace the placeholder password**

  These examples use a placeholder instead of a runnable default password. Replace `<REPLACE_WITH_DB_PASSWORD>` with a strong password of your own choosing before running either script, and use that same password when you set `shared.database.password` in [system.yaml](artifactory-system-yaml) (or the supported environment-variable override). Do not leave the placeholder in a production setup.
</Callout>

Verify that the script is correct for your environment — including the database name, username, host restrictions, and granted privileges — and run it to create the database.

<Callout icon="📘" theme="info">
  **Artifactory Privileges**

  You must give Artifactory full privileges on the database.
</Callout>

## Related Topics

* [PostgreSQL for Artifactory](postgresql-for-artifactory)
* [Enable PostgreSQL Connectivity from Remote Servers](enable-postgresql-connectivity-from-remote-servers)
* [Configure Artifactory to Use PostgreSQL](configure-artifactory-to-use-postgresql)
* [Enable TLS Encryption for PostgreSQL](enable-tls-encryption-for-postgresql)
* [Database Setup Workflow](database-setup-workflow)