{
  "manifest_version": "1",
  "slug": "postgres",
  "title": "PostgreSQL",
  "headline": "Self-host PostgreSQL",
  "description": "Run PostgreSQL 18 with pgvector on an exe.dev VM. Nightly tested backups, a private web admin, SSH tunnels, and imports from Heroku or Railway.",
  "category": "databases",
  "tags": [
    "postgresql",
    "pgvector",
    "database",
    "heroku postgres alternative",
    "backups",
    "adminer"
  ],
  "url": "https://exe.dev/deploy/postgres",
  "markdown_url": "https://exe.dev/deploy/postgres.md",
  "upstream": {
    "website": "https://www.postgresql.org",
    "source": "https://github.com/postgres/postgres",
    "docs": "https://www.postgresql.org/docs/18/",
    "license": "PostgreSQL License"
  },
  "example_vm_name": "my-postgres",
  "time": "10 minutes",
  "stack": [
    {
      "name": "PostgreSQL 18",
      "detail": "From the PostgreSQL project's apt repository, tuned for the VM",
      "port": 5432,
      "data": "/var/lib/postgresql/18/main"
    },
    {
      "name": "pgvector 0.8",
      "detail": "Vector similarity search, enabled in your app's database"
    },
    {
      "name": "Adminer 6",
      "detail": "Web admin, behind exe.dev login and an email allowlist",
      "port": 8000
    },
    {
      "name": "Nightly backups",
      "detail": "Every database and role, 14 nights kept",
      "data": "~/postgres/backups"
    }
  ],
  "access": [
    {
      "url": "https://my-postgres.exe.xyz/",
      "who": "private",
      "what": "Adminer, signed in as the database superuser"
    }
  ],
  "delivers": [
    "PostgreSQL 18 with pgvector, started at boot and sized for the VM's memory.",
    "An `app` database and role, with its DATABASE_URL in `~/postgres/app.env`.",
    "Adminer at the VM's private URL, open only to the owner's exe.dev email.",
    "Nightly backups of every database and role, one restored and checked."
  ],
  "owner_runs_after": [
    "ssh my-postgres.exe.xyz cat postgres/app.env",
    "ssh -N -L 5433:localhost:5432 my-postgres.exe.xyz"
  ],
  "deployable": true,
  "deploy": {
    "new_vm_url": "https://exe.dev/new?prompt=Set%20up%20PostgreSQL%20on%20this%20VM%20by%20following%20the%20exe.dev%20recipe%20at%20https%3A%2F%2Fexe.dev%2Fdeploy%2Fpostgres.md%20from%20top%20to%20bottom.%0A%0AThe%20recipe%27s%20example%20VM%20name%20is%20my-postgres.%20This%20VM%27s%20name%20is%20the%20output%20of%20%60hostname%60%3A%20use%20it%20wherever%20the%20recipe%20writes%20my-postgres.%20Skip%20the%20step%20that%20creates%20the%20VM%3B%20you%20are%20on%20it.%0A%0AYou%20are%20done%20when%20all%20of%20these%20are%20true.%20Check%20each%20one%20yourself%3A%0A-%20PostgreSQL%2018%20with%20pgvector%2C%20started%20at%20boot%20and%20sized%20for%20the%20VM%27s%20memory.%0A-%20An%20%60app%60%20database%20and%20role%2C%20with%20its%20DATABASE_URL%20in%20%60~%2Fpostgres%2Fapp.env%60.%0A-%20Adminer%20at%20the%20VM%27s%20private%20URL%2C%20open%20only%20to%20the%20owner%27s%20exe.dev%20email.%0A-%20Nightly%20backups%20of%20every%20database%20and%20role%2C%20one%20restored%20and%20checked.%0A%0ARead%20the%20whole%20recipe%2C%20including%20the%20closed%20details.%20For%20initial%20setup%2C%0Afollow%20%22Install%20by%20hand%22%20from%20top%20to%20bottom%3A%20PostgreSQL%20and%20pgvector%2C%0Atuning%2C%20the%20app%20database%2C%20Adminer%20on%20port%208000%2C%20the%20backup%20timer%2C%20and%0Athe%20scratch-cluster%20restore%20test.%20The%20walkthrough%20sections%20are%20for%20the%0Aowner%20afterwards%3A%20don%27t%20import%20data%2C%20set%20up%20Tailscale%20or%20Docker%20access%2C%0Aor%20run%20the%20Restore%20or%20Update%20instructions%20during%20initial%20setup.%0ANever%20overwrite%20an%20existing%20~%2Fpostgres%2F%2A.env%20file.%20Drop%20only%20the%0Ascratch%20cluster%20the%20restore%20test%20creates.%0AAllow%20only%20the%20owner%27s%20email%20in%20Adminer%2C%20read%20from%20the%20reflection%0Aintegration%3B%20if%20that%20fails%2C%20ask%20the%20owner%20for%20it.%20Check%20Adminer%20on%0Alocalhost%20with%20no%20email%2C%20a%20wrong%20email%2C%20and%20the%20owner%27s%20email.%0ALeave%20the%20VM%20private%20and%20do%20not%20reboot.%20Don%27t%20paste%20passwords%20into%20the%0Achat%3B%20say%20they%20are%20in%20~%2Fpostgres%2Fapp.env.%0A%0AFinish%20with%20the%20URLs%20I%20should%20open%20and%20these%20commands%2C%20which%20only%20I%20can%20run%2C%20from%20my%20own%20computer%20%28with%20this%20VM%27s%20name%20in%20them%29%3A%0A%20%20ssh%20my-postgres.exe.xyz%20cat%20postgres%2Fapp.env%0A%20%20ssh%20-N%20-L%205433%3Alocalhost%3A5432%20my-postgres.exe.xyz%0A",
    "terminal": "curl -fsSL https://exe.dev/deploy/postgres/prompt.txt | ssh exe.dev new --prompt=/dev/stdin",
    "prompt": "Set up PostgreSQL on this VM by following the exe.dev recipe at https://exe.dev/deploy/postgres.md from top to bottom.\n\nThe recipe's example VM name is my-postgres. This VM's name is the output of `hostname`: use it wherever the recipe writes my-postgres. Skip the step that creates the VM; you are on it.\n\nYou are done when all of these are true. Check each one yourself:\n- PostgreSQL 18 with pgvector, started at boot and sized for the VM's memory.\n- An `app` database and role, with its DATABASE_URL in `~/postgres/app.env`.\n- Adminer at the VM's private URL, open only to the owner's exe.dev email.\n- Nightly backups of every database and role, one restored and checked.\n\nRead the whole recipe, including the closed details. For initial setup,\nfollow \"Install by hand\" from top to bottom: PostgreSQL and pgvector,\ntuning, the app database, Adminer on port 8000, the backup timer, and\nthe scratch-cluster restore test. The walkthrough sections are for the\nowner afterwards: don't import data, set up Tailscale or Docker access,\nor run the Restore or Update instructions during initial setup.\nNever overwrite an existing ~/postgres/*.env file. Drop only the\nscratch cluster the restore test creates.\nAllow only the owner's email in Adminer, read from the reflection\nintegration; if that fails, ask the owner for it. Check Adminer on\nlocalhost with no email, a wrong email, and the owner's email.\nLeave the VM private and do not reboot. Don't paste passwords into the\nchat; say they are in ~/postgres/app.env.\n\nFinish with the URLs I should open and these commands, which only I can run, from my own computer (with this VM's name in them):\n  ssh my-postgres.exe.xyz cat postgres/app.env\n  ssh -N -L 5433:localhost:5432 my-postgres.exe.xyz\n",
    "prompt_url": "https://exe.dev/deploy/postgres/prompt.txt"
  },
  "updated": "2026-10-17",
  "verified": "2026-10-17",
  "related": [
    "django",
    "rails",
    "migrate-heroku",
    "n8n",
    "claude-code",
    "openclaw"
  ],
  "alternatives": [
    "Heroku Postgres",
    "Supabase",
    "Neon",
    "Railway",
    "Amazon RDS"
  ]
}
