Connecting to DuckDB on Layerbase Cloud

Layerbase Cloud runs DuckDB behind a PostgreSQL-compatible endpoint for analytics workloads that need a hosted SQL connection.

Best for: Ad hoc analytics, small data warehouses, CSV/Parquet workflows, and teams that want DuckDB without managing a server.

1

Open your database in the dashboard

Go to /cloud, click the database you just created, and the connection panel shows the host, port, username, password, and a ready-to-paste connection string for the engine.

Copy the Postgres-style DuckDB URL from Quick Connect.

2

TLS is required, on by default

Append ?sslmode=require and sslnegotiation=direct when your client requires it.

PostgreSQL-compatible proxy on port 5432

3

Use any standard client

DuckDB works with the normal client family for that engine. Start with the dashboard snippet, then move the same URL and credentials into your app environment.

If your client has separate direct, pooled, TLS, or HTTP options, prefer the exact variant shown in Quick Connect.

bashDuckDB
psql "postgresql://layerbase:password@your-host.cloud.layerbase.dev:5432/duck1?sslmode=require&sslnegotiation=direct"

DuckDB notes

  • Use PostgreSQL-compatible tools for the connection, then write DuckDB SQL.
  • For embedded-only analytics, local DuckDB may still be simpler.