How PostgreSQL runs on osModa
1
NixOS declarative

One line in config. Atomic install and rollback.

2
pgvector for RAG

Embedding storage and semantic search built in.

3
Watchdog monitored

osmoda-watch auto-restarts on crash.

Deploy with PostgreSQLFrom $14.99/mo · full root SSH

PostgreSQL on osModa

Install PostgreSQL on your dedicated NixOS server with a single configuration line. Use it for structured agent memory, lead databases, CRM data, conversation history, and user profiles. Add pgvector for embedding storage and semantic search to power RAG pipelines. osmoda-watch monitors PostgreSQL and auto-restarts on crash. NixOS atomic rollbacks protect against bad configuration changes. Plans start at $14.99/month.

PostgreSQL is the most advanced open-source relational database, trusted by companies worldwide for production workloads. For AI agents, PostgreSQL serves as the persistent memory layer: storing conversation history, tracking user interactions, managing agent state, and providing the structured data that agents query and modify. With pgvector, PostgreSQL also becomes a vector database for storing embeddings and performing similarity searches, making it a single-database solution for both structured and semantic data. Running PostgreSQL on a dedicated osModa server means your database has guaranteed CPU, RAM, and disk I/O with no noisy neighbors.

TL;DR

  • • Install PostgreSQL with one NixOS config line: services.postgresql.enable = true
  • • pgvector extension for embedding storage and semantic search — single DB for structured + vector data
  • • osmoda-watch monitors PostgreSQL and auto-restarts on crash; NixOS atomic rollbacks protect config changes
  • • Dedicated server resources — no noisy neighbors affecting query performance from $14.99/mo

Install PostgreSQL on osModa

NixOS makes PostgreSQL installation declarative and atomic.

  1. 1

    SSH into your osModa server

    Use the IP and SSH key from your osModa dashboard. You have full root access.

  2. 2

    Add PostgreSQL to NixOS configuration

    Edit /etc/nixos/configuration.nix and add services.postgresql.enable = true. Optionally configure the PostgreSQL version, authentication rules, and extensions like pgvector. NixOS handles the rest declaratively.

  3. 3

    Install pgvector (optional)

    Add pgvector to your PostgreSQL extensions in the NixOS config. After rebuilding, connect to PostgreSQL and run CREATE EXTENSION vector. You can now create tables with vector columns for embedding storage.

  4. 4

    Rebuild and verify

    Run nixos-rebuild switch. NixOS atomically installs PostgreSQL, creates the data directory, and starts the service. Connect with psql to verify. osmoda-watch automatically monitors the new PostgreSQL process.

  5. 5

    Set up scheduled backups

    Use osmoda-routines to schedule pg_dump backups. Configure a cron expression for daily or hourly backups. Store backups locally or transfer to external storage.

PostgreSQL Use Cases for AI Agents

How teams use PostgreSQL with their osModa agents.

Conversation Memory

Store conversation history with full-text search. Agents recall past interactions, maintain context across sessions, and provide personalized responses based on user history.

pgvector RAG

Store document embeddings and perform similarity search for Retrieval Augmented Generation. HNSW and IVFFlat indexes for fast approximate nearest neighbor queries.

Lead Databases

Sales agents store leads, track interactions, score prospects, and manage pipelines. PostgreSQL's JSONB column type handles flexible lead metadata alongside structured fields.

Agent State Management

Track agent workflows, task queues, and operational state. PostgreSQL LISTEN/NOTIFY enables real-time event-driven agent coordination without external message brokers.

Frequently Asked Questions

How do I install PostgreSQL on osModa?

Since osModa runs NixOS, you install PostgreSQL by adding it to your NixOS configuration file (configuration.nix). Add services.postgresql.enable = true and run nixos-rebuild switch. NixOS installs PostgreSQL, creates the data directory, and starts the service. This declarative approach means your database configuration is version-controlled and reproducible.

Does osmoda-watch monitor PostgreSQL?

Yes. osmoda-watch monitors all processes running on your server, including PostgreSQL. If PostgreSQL crashes due to memory pressure, disk issues, or software errors, osmoda-watch detects the failure and restarts the service automatically. Your agents experience a brief interruption rather than permanent downtime.

Can I use pgvector for RAG embeddings?

Yes. pgvector is a PostgreSQL extension that adds vector similarity search. Install it via NixOS configuration alongside PostgreSQL. Store embedding vectors generated by OpenAI, Anthropic, or any embedding model, and perform similarity searches for RAG retrieval. pgvector supports exact and approximate nearest neighbor search with IVFFlat and HNSW indexes.

How do I back up PostgreSQL on osModa?

Multiple approaches work on osModa. Use pg_dump for logical backups, which you can schedule with osmoda-routines (cron). Use pg_basebackup for physical backups of the entire database cluster. The agentd daemon also handles server-level backups that include PostgreSQL data directories. All methods benefit from the dedicated storage on your osModa server.

What happens if I deploy a bad PostgreSQL configuration?

NixOS atomic rollbacks protect you. If you change your PostgreSQL configuration, run nixos-rebuild switch, and the new configuration fails, you can instantly roll back to the previous working configuration with nixos-rebuild switch --rollback. The previous PostgreSQL version and configuration are preserved in the NixOS store.

How much storage does PostgreSQL get on osModa?

Storage depends on your plan: Solo has 40 GB, Pro has 80 GB, Team has 160 GB, and Scale has 320 GB. PostgreSQL shares this storage with the OS, your agent code, and other services. For most agent databases (conversation history, user profiles, vector embeddings), Solo or Pro provides sufficient storage. Contact support if you need additional storage.

Run PostgreSQL on Dedicated NixOS Infrastructure

Your agents need a reliable database. PostgreSQL on osModa gives you declarative installation, pgvector for RAG, watchdog auto-restart, and NixOS atomic rollbacks. Dedicated resources, no noisy neighbors. From $14.99/month.

Last updated: March 2026