Skip to main content
PostgreSQL 14 is available as an on-demand service for your pods.

Install

instapod services add my-app --service postgresql --wait
Installation takes approximately 8–15 seconds.

Credentials

instapod services creds my-app --service postgresql
FieldValue
Hostlocalhost
Port5432
Usernameinstapod
Password(auto-generated)
Databaseinstapod

Connecting from Your Application

Python (psycopg2)

import psycopg2

conn = psycopg2.connect(
    host='localhost',
    port=5432,
    user='instapod',
    password='YOUR_PASSWORD',
    dbname='instapod'
)

Python (SQLAlchemy)

from sqlalchemy import create_engine

engine = create_engine('postgresql://instapod:YOUR_PASSWORD@localhost:5432/instapod')

Node.js

const { Pool } = require('pg');

const pool = new Pool({
  host: 'localhost',
  port: 5432,
  user: 'instapod',
  password: 'YOUR_PASSWORD',
  database: 'instapod'
});

PHP (PDO)

$pdo = new PDO(
    'pgsql:host=localhost;port=5432;dbname=instapod',
    'instapod',
    'YOUR_PASSWORD'
);

Command Line Access

SSH into your pod and use psql:
instapod ssh my-app
psql -U instapod -d instapod

Configuration

PostgreSQL runs with development-friendly defaults:
  • Listens on localhost:5432 only
  • Default encoding: UTF-8
  • Peer authentication for local socket, password for TCP