---
title: "How Does psql -h pg.neon.tech Work?"
description: "Neon's passwordless `psql -h pg.neon.tech` connects to a \"Link Proxy\", a server that speaks the Postgres wire protocol, rather than to a real Postgres instance."
url: "https://swe.quest/articles/how-does-psql-h-pg-neon-tech-work-b4339dcc3b96f63b"
canonical: "https://neon.com/blog/how-psql-pg-neon-tech-works"
source: "Neon"
published: "2024-08-14"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 3
tags: ["postgres","identity-auth","networking"]
---

# How Does psql -h pg.neon.tech Work?

A post on [Neon](https://swe.quest/sources/neon.md), published 2024-08-14, 3 min read, Deep dive. Original: [https://neon.com/blog/how-psql-pg-neon-tech-works](https://neon.com/blog/how-psql-pg-neon-tech-works)

## Summary

Neon's passwordless \`psql -h pg.neon.tech\` connects to a "Link Proxy", a server that speaks the Postgres wire protocol, rather than to a real Postgres instance. The proxy answers the client's startup message with AuthenticationOk followed by a NoticeResponse, which psql prints as a welcome message containing an auth URL. Visiting that URL opens a control-plane UI where the user picks a project and endpoint. The control plane then sends the connection details for that request ID back to the data-plane proxy, which connects to the chosen compute and relays all traffic to psql.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Identity & auth](https://swe.quest/tags/identity-auth.md) (Security)
- [Networking](https://swe.quest/tags/networking.md) (Infrastructure)

## Prerequisites

- Postgres wire protocol basics ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- psql client

## Keywords

Neon, psql, Link Proxy, Postgres protocol, NoticeResponse

## Related posts

- [psql from the browser](https://swe.quest/articles/psql-from-the-browser-f27b7186b8abd76b.md): Neon · 2024-12-11 · Easy · 3 min read · PostgreSQL, Browsers, Developer tools, Open source
  psql.sh is a browser-based emulation of Postgres's psql client, built on Neon's WebSocket proxy and serverless driver because browsers can't open raw TCP connections.
- [Live Share: Connect to in-browser PGlite with any Postgres client](https://swe.quest/articles/live-share-connect-to-in-browser-pglite-with-any-postgres-client-bc4a637942fe2ca5.md): Supabase · 2024-10-10 · Medium · 6 min read · PostgreSQL, Networking, Load balancing, WebAssembly, Browsers
  database.build (formerly postgres.new) adds Live Share, which exposes an in-browser PGlite (WASM Postgres) database via a unique connection string usable from psql, pg\_dump, ORMs or IDEs.
- [Shipping psql without psql: a pure-TypeScript Postgres client in neonctl](https://swe.quest/articles/shipping-psql-without-psql-a-pure-typescript-postgres-client-in-neonctl-621e0ac130c536d1.md): Neon · 2026-06-12 · Medium · 7 min read · PostgreSQL, TypeScript, Testing, AI for coding, Developer tools
  neonctl now embeds a pure-TypeScript reimplementation of psql that activates when no native psql is on the PATH.
- [Web-based AI SQL Playground and connecting to Postgres from the browser](https://swe.quest/articles/web-based-ai-sql-playground-and-connecting-to-postgres-from-the-browser-fa7f4eccd9643a37.md): Neon · 2023-05-19 · Medium · 5 min read · PostgreSQL, LLMs, Serverless, JavaScript
  Neon's Postgres AI Playground connects to a Postgres database directly from the browser and uses OpenAI's gpt-3.5-turbo to turn natural-language prompts into SQL.
- [Edge-compatible Serverless Driver for Postgres](https://swe.quest/articles/edge-compatible-serverless-driver-for-postgres-9b0d09c6c7a067d0.md): Neon · 2022-12-08 · Medium · 9 min read · PostgreSQL, Serverless, Networking, Cryptography, WebAssembly
  Neon's @neondatabase/serverless driver lets V8-isolate platforms like Cloudflare Workers, which lack TCP, speak the real Postgres wire protocol by tunnelling it over a WebSocket to an open-source Go proxy that relays to TCP.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
