Databases
PostgreSQL
Specific configuration for PostgreSQL.
PostgreSQL is fully supported by the Portabase agent. We use native pg_dump tools to ensure consistent and reliable backups.
Configuration
When running portabase db add, select postgresql as the database type.
Specific parameters asked:
- Database Name: The exact name of the database to backup (e.g.,
app_db). Unlike other engines, you must target a specific database.
In your databases.json (or .toml) file, configure the following block.
{
"name": "my-app-postgres",
"type": "postgresql",
"host": "postgres",
"port": 5432,
"username": "postgres",
"password": "mysecretpassword",
"database": "app_db",
"generatedId": "..."
}Specific Parameters:
- database: (Required) The exact name of the database to dump.
Docker Compose Example
Here is how to configure a PostgreSQL service alongside the agent.
services:
postgres:
image: postgres:15-alpine
container_name: my-postgres
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: mysecretpassword
POSTGRES_DB: app_db
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- portabase
agent:
image: solucetechnologies/agent-portabase:latest
# ... agent configuration ...
depends_on:
- postgres
networks:
- portabase
networks:
portabase:
external: true
volumes:
postgres_data:Note that in this example, the host (host) to enter in the agent configuration will be postgres (the service name), not localhost.