---
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/t-setup-environment
---

# 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/)

# Environment Setup

This is part of the [PgBouncer Tutorial](https://charmhub.io/pgbouncer/docs/tutorial). Please refer to this page for more information and the overview of the content.

## [Minimum requirements](https://charmhub.io/pgbouncer/docs/t-setup-environment#p-28367-minimum-requirements)

Before we start, make sure your machine meets [the following requirements](https://charmhub.io/pgbouncer/docs/r-requirements).

## [Multipass environment](https://charmhub.io/pgbouncer/docs/t-setup-environment#p-28367-multipass-environment)

[Multipass](https://multipass.run/) is a quick and easy way to launch virtual machines running Ubuntu. It uses “[cloud-init](https://cloud-init.io/)” standard to install and configure all the necessary parts automatically.

Let’s install Multipass from [Snap](https://snapcraft.io/multipass) and launch a new VM using “[charm-dev](https://github.com/canonical/multipass-blueprints/blob/main/v1/charm-dev.yaml)” cloud-init config:

```
sudo snap install multipass && \
multipass launch --cpus 4 --memory 8G --disk 30G --name my-vm charm-dev # tune CPU/RAM/HDD accordingly to your needs
```

*Note: all ‘multipass launch’ params are [described here](https://multipass.run/docs/launch-command)*.

Multipass [list of commands](https://multipass.run/docs/multipass-cli-commands) is short and self-explanatory, e.g. show all running VMs:

```
multipass list
```

As soon as new VM started, enter inside using:

```
multipass shell my-vm
```

*Note: if at any point you’d like to leave Multipass VM, enter `Ctrl+d` or type `exit`*.

All the parts have been pre-installed inside VM already, like LXD and Juju (the files ‘/var/log/cloud-init.log’ and ‘/var/log/cloud-init-output.log’ contain all low-level installation details). Let’s bootstrap Juju to use local LXD. We will call it “overlord”, but you can give it any name you’d like:

```
juju bootstrap localhost overlord
```

The controller can work with different models; models host applications such as PgBouncer. Set up a specific model for Charmed PostgreSQL+PgBouncer named ‘tutorial’:

```
juju add-model tutorial
```

You can now view the model you created above by entering the command `juju status` into the command line. You should see the following:

```
Model    Controller  Cloud/Region         Version  SLA          Timestamp
tutorial overlord    localhost/localhost  3.1.6    unsupported  23:20:53+01:00

Model "admin/tutorial" is empty.
```

---
