---
title: Charmhub | Deploy PgBouncer K8s using Charmhub - The Open Operator Collection
description: Deploy the latest version of PgBouncer K8s as a Kubernetes Operator on
  any cloud.
url: https://charmhub.io/pgbouncer-k8s/docs/t-setup-environment
---

# PgBouncer K8s

[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:

1/stable 593

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

[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-k8s-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 K8s Tutorial](https://charmhub.io/pgbouncer-k8s/docs/tutorial). Please refer to this page for more information and the overview of the content.

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

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

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

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

Install Multipass from [Snap](https://snapcraft.io/multipass):

```
sudo snap install multipass
```

Launch a new VM using the [charm-dev](https://github.com/canonical/multipass-blueprints/blob/main/v1/charm-dev.yaml) cloud-init config:

```
multipass launch --cpus 4 --memory 8G --disk 30G --name my-vm charm-dev
```

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

The Multipass [list of commands](https://multipass.run/docs/multipass-cli-commands) is short and self-explanatory. For example, to show all running VMs, just run the command `multipass list`.

As soon as a new VM has started, access it using

```
multipass shell my-vm
```

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

All the parts have been pre-installed inside the VM already, like MicroK8s and Juju. The files `/var/log/cloud-init.log` and `/var/log/cloud-init-output.log` contain all low-level installation details.

The Juju controller can work with different models. Models host applications such as Charmed PostgreSQL K8s + PgBouncer K8s.

Set up a specific model 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  microk8s    microk8s/localhost  3.1.6    unsupported  11:56:38+01:00

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

---
