---
title: Charmhub | Deploy PgBouncer using Charmhub - The Open Operator Collection
description: Deploy the latest version of PgBouncer on any cloud.
url: https://charmhub.io/pgbouncer/docs/e-interfaces
---

# PgBouncer

[Canonical](https://charmhub.io/publisher/data-platform "View all packages from Canonical")

* [Canonical](https://charmhub.io/publisher/data-platform "View all packages from Canonical")
* [Databases](https://charmhub.io/?filter=databases)

Platform:

24.04

22.04

20.04

18.04

16.04

1/stable 1092

```
juju deploy pgbouncer --channel 1/stable
```

[Learn to deploy on juju >](https://juju.is/docs/juju/manage-applications)

---

#### Relevant links

* [Homepage](https://ubuntu.com/data/postgresql)

---

#### Contacts

##### Maintainers

+ [Canonical Data Platform](mailto:data-platform@lists.launchpad.net)

* [Submit a bug](https://github.com/canonical/pgbouncer-operator/issues)

---

Share your thoughts on this charm with the community on discourse.

[Join the discussion](https://discourse.charmhub.io/)

# Interfaces/endpoints

PgBouncer supports modern [‘postgresql\_client’](https://github.com/canonical/charm-relation-interfaces) interface. Applications can easily connect PgBouncer using [‘data\_interfaces’](https://charmhub.io/data-platform-libs/libraries/data_interfaces) library from [‘data-platform-libs’](https://github.com/canonical/data-platform-libs/).

### [Modern `postgresql_client` interface (`database` endpoint):](https://charmhub.io/pgbouncer/docs/e-interfaces#p-28383-modern-postgresql_client-interface-database-endpoint)

Adding a relation is accomplished with `juju relate` (or `juju integrate` for Juju 3.x) via endpoint `database`. Read more about [Juju relations (integrations)](https://juju.is/docs/olm/relations). Example:

```
# Deploy Charmed PostgreSQL and PgBouncer clusters
juju deploy postgresql -n 3 --channel 14/stable
juju deploy pgbouncer -n 3 --channel 1/stable

# Deploy the relevant charms, e.g. postgresql-test-app
juju deploy postgresql-test-app

# Relate all applications
juju integrate postgresql pgbouncer
juju integrate pgbouncer postgresql-test-app:database

# Check established relation (using postgresql_client interface):
juju status --relations

# Example of the properly established relation:
# > Integration provider     Requirer                          Interface              Type     Message
# > pgbouncer:database       postgresql-test-app:database      postgresql_client      regular
# > postgresql:database      pgbouncer:backend-database        postgresql_client      regular
# > ...
```

See all the charm interfaces [here](https://charmhub.io/pgbouncer/integrations).

---
