Skip to content
Browse docs

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.

You can also download the whole set instead of copying values one at a time: the Connect dialog offers a Download .env file, ready to drop into a project under the environment variable your engine's clients expect, and a Download .txt with the labeled parameters. Both files contain the password in plain text, so keep them out of version control.

2

TLS is required, on by default

Append ?sslmode=require.

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"

DuckDB notes

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