Skip to main content
These tools provide comprehensive PostgreSQL database management capabilities, including creation, deployment, lifecycle management, and configuration.

Core Database Operations

Creates a new PostgreSQL database in Dokploy.Annotations:
  • Destructive: false
  • Idempotent: false
  • External API: true
name
string
required
The name of the PostgreSQL database.
appName
string
required
The app name for the PostgreSQL database.
databaseName
string
required
The name of the database to create.
databaseUser
string
required
The username for database access.
databasePassword
string
required
The password for database access. Must match pattern: ^[a-zA-Z0-9@#%^&*()_+\-=[\]{}|;:,.<>?~\]*$`
environmentId
string
required
The ID of the environment where the database will be created.
dockerImage
string
default:"postgres:15"
Docker image to use for PostgreSQL.
description
string
An optional description for the database.
serverId
string
The ID of the server where the database will be deployed.
Example:
{
  "name": "production-db",
  "appName": "prod-postgres",
  "databaseName": "myapp",
  "databaseUser": "admin",
  "databasePassword": "SecurePass123!",
  "environmentId": "env_abc123",
  "dockerImage": "postgres:15",
  "description": "Production PostgreSQL database"
}
Response:
{
  "message": "PostgreSQL database \"production-db\" created successfully",
  "data": {
    "postgresId": "pg_xyz789",
    "name": "production-db",
    "appName": "prod-postgres",
    "databaseName": "myapp"
  }
}
Gets a specific PostgreSQL database by its ID in Dokploy.Annotations:
  • Read-only: true
  • Idempotent: true
  • External API: true
postgresId
string
required
The ID of the PostgreSQL database to retrieve.
Example:
{
  "postgresId": "pg_xyz789"
}
Response:
{
  "message": "Successfully fetched PostgreSQL database \"pg_xyz789\"",
  "data": {
    "postgresId": "pg_xyz789",
    "name": "production-db",
    "appName": "prod-postgres",
    "databaseName": "myapp",
    "databaseUser": "admin",
    "dockerImage": "postgres:15",
    "applicationStatus": "running",
    "externalPort": 5432
  }
}
Updates an existing PostgreSQL database in Dokploy.Annotations:
  • Destructive: true
  • Idempotent: false
  • External API: true
postgresId
string
required
The ID of the PostgreSQL database to update.
name
string
The new name of the PostgreSQL database.
appName
string
The new app name of the PostgreSQL database.
databaseName
string
The new database name.
databaseUser
string
The new database username.
databasePassword
string
The new database password.
description
string
The new description for the PostgreSQL database.
dockerImage
string
default:"postgres:15"
The new Docker image for PostgreSQL.
command
string
Custom command to run the PostgreSQL database.
env
string
Environment variables for the PostgreSQL database.
memoryReservation
string
Memory reservation for the PostgreSQL database (e.g., “512m”, “1g”).
memoryLimit
string
Memory limit for the PostgreSQL database (e.g., “1g”, “2g”).
cpuReservation
string
CPU reservation for the PostgreSQL database (e.g., “0.5”, “1”).
cpuLimit
string
CPU limit for the PostgreSQL database (e.g., “1”, “2”).
externalPort
number
External port for the PostgreSQL database.
applicationStatus
enum
Application status: idle, running, done, or error.
replicas
number
Number of replicas.
Example:
{
  "postgresId": "pg_xyz789",
  "memoryLimit": "2g",
  "cpuLimit": "2",
  "externalPort": 5433
}
Response:
{
  "message": "PostgreSQL database \"pg_xyz789\" updated successfully",
  "data": {
    "postgresId": "pg_xyz789",
    "memoryLimit": "2g",
    "cpuLimit": "2",
    "externalPort": 5433
  }
}
This operation is destructive. Changing certain parameters may require redeployment.
Removes/deletes a PostgreSQL database from Dokploy.Annotations:
  • Destructive: true
postgresId
string
required
The ID of the PostgreSQL database to remove.
Example:
{
  "postgresId": "pg_xyz789"
}
This operation is destructive and cannot be undone. All data in the database will be permanently deleted.
Moves a PostgreSQL database to a different project.Annotations:
  • Destructive: true
postgresId
string
required
The ID of the PostgreSQL database to move.
targetProjectId
string
required
The ID of the project to move the database to.
Example:
{
  "postgresId": "pg_xyz789",
  "targetProjectId": "proj_new123"
}
Moving a database to a different project may affect connected applications.

Lifecycle Management

Deploys a PostgreSQL database in Dokploy.Annotations:
  • Destructive: true
  • Idempotent: false
  • External API: true
postgresId
string
required
The ID of the PostgreSQL database to deploy.
Example:
{
  "postgresId": "pg_xyz789"
}
Response:
{
  "message": "PostgreSQL database \"pg_xyz789\" deployment started successfully"
}
Starts a PostgreSQL database in Dokploy.Annotations:
  • Destructive: true
postgresId
string
required
The ID of the PostgreSQL database to start.
Example:
{
  "postgresId": "pg_xyz789"
}
Stops a PostgreSQL database in Dokploy.Annotations:
  • Destructive: true
postgresId
string
required
The ID of the PostgreSQL database to stop.
Example:
{
  "postgresId": "pg_xyz789"
}
Stopping the database will make it unavailable to connected applications.
Reloads a PostgreSQL database in Dokploy.Annotations:
  • Destructive: true
postgresId
string
required
The ID of the PostgreSQL database to reload.
appName
string
required
The app name of the PostgreSQL database.
Example:
{
  "postgresId": "pg_xyz789",
  "appName": "prod-postgres"
}
Rebuilds a PostgreSQL database in Dokploy.Annotations:
  • Destructive: true
postgresId
string
required
The ID of the PostgreSQL database to rebuild.
Example:
{
  "postgresId": "pg_xyz789"
}
Rebuilding will recreate the database container. Ensure data is persisted via volumes.

Configuration Management

Changes the status of a PostgreSQL database.Annotations:
  • Destructive: true
postgresId
string
required
The ID of the PostgreSQL database.
applicationStatus
enum
required
The new status: idle, running, done, or error.
Example:
{
  "postgresId": "pg_xyz789",
  "applicationStatus": "running"
}
Saves external port configuration for a PostgreSQL database.Annotations:
  • Destructive: true
postgresId
string
required
The ID of the PostgreSQL database.
externalPort
number
required
External port for the PostgreSQL database. Set to null to disable external access.
Example:
{
  "postgresId": "pg_xyz789",
  "externalPort": 5432
}
Disable External Access:
{
  "postgresId": "pg_xyz789",
  "externalPort": null
}
Saves environment variables for a PostgreSQL database in Dokploy.Annotations:
  • Destructive: true
  • Idempotent: false
  • External API: true
postgresId
string
required
The ID of the PostgreSQL database to save environment for.
env
string
Environment variables to save for the PostgreSQL database.
Example:
{
  "postgresId": "pg_xyz789",
  "env": "POSTGRES_INITDB_ARGS=--encoding=UTF8\nPGDATA=/var/lib/postgresql/data/pgdata"
}
Response:
{
  "message": "Environment variables for PostgreSQL database \"pg_xyz789\" saved successfully"
}

Common Workflows

Creating and Deploying a PostgreSQL Database

// Step 1: Create the database
{
  "tool": "postgres-create",
  "input": {
    "name": "myapp-db",
    "appName": "myapp-postgres",
    "databaseName": "appdata",
    "databaseUser": "appuser",
    "databasePassword": "SecurePass123!",
    "environmentId": "env_abc123"
  }
}

// Step 2: Deploy the database
{
  "tool": "postgres-deploy",
  "input": {
    "postgresId": "pg_xyz789"
  }
}

// Step 3: Configure external access
{
  "tool": "postgres-saveExternalPort",
  "input": {
    "postgresId": "pg_xyz789",
    "externalPort": 5432
  }
}

Updating Resource Limits

{
  "tool": "postgres-update",
  "input": {
    "postgresId": "pg_xyz789",
    "memoryLimit": "4g",
    "memoryReservation": "2g",
    "cpuLimit": "2",
    "cpuReservation": "1"
  }
}

Build docs developers (and LLMs) love