PgBouncer

Canonical Publisher

Platform:

Ubuntu
24.04 22.04 20.04 18.04 16.04
Channel Revision Published Runs on
latest/stable 5 17 Jan 2022
Ubuntu 20.04 Ubuntu 18.04 Ubuntu 16.04
1/stable 1017 23 Jun 2026
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
1/stable 1019 23 Jun 2026
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
1/stable 1020 23 Jun 2026
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
1/stable 1018 23 Jun 2026
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
1/stable 1022 23 Jun 2026
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
1/stable 1021 23 Jun 2026
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
1/candidate 1092 02 Sep 2026
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
1/candidate 1093 02 Sep 2026
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
1/candidate 1090 02 Sep 2026
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
1/candidate 1091 02 Sep 2026
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
1/candidate 1083 02 Sep 2026
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
1/candidate 1084 02 Sep 2026
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
1/beta 1092 02 Sep 2026
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
1/beta 1093 02 Sep 2026
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
1/beta 1090 02 Sep 2026
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
1/beta 1091 02 Sep 2026
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
1/beta 1083 02 Sep 2026
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
1/beta 1084 02 Sep 2026
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
1/edge 1093 02 Sep 2026
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
1/edge 1092 02 Sep 2026
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
1/edge 1091 02 Sep 2026
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
1/edge 1090 02 Sep 2026
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
1/edge 1084 01 Sep 2026
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
1/edge 1083 01 Sep 2026
Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
juju deploy pgbouncer --channel 1/stable

Environment Setup

This is part of the PgBouncer Tutorial. Please refer to this page for more information and the overview of the content.

Minimum requirements

Before we start, make sure your machine meets the following requirements.

Multipass environment

Multipass is a quick and easy way to launch virtual machines running Ubuntu. It uses “cloud-init” standard to install and configure all the necessary parts automatically.

Let’s install Multipass from Snap and launch a new VM using “charm-dev” 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.

Multipass list of 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.

Help improve this document in the forum (guidelines). Last updated 1 year, 8 months ago.