Custom image (experimental)

Using a custom PostgreSQL image can allow users to install custom dependencies on their PostgreSQL server. For example, a user may be using PL/Python and wants to use a specific pip module that is not installed by default.


Custom image is an experimental feature and may be unstable. A user could send an invalid image such as incorrect architecture, PostgreSQL version, wrong base image, etc. Tembo Cloud may be unable to pull your custom image if the tag disappears, or if Tembo Cloud is rate limited by the provided image registry. While Tembo Cloud will seek to keep this feature working, Tembo Cloud may ship changes that break this feature. Some other features, for example status reporting, may not work properly when using custom images.

Please reach out to Tembo support ( if you would like to use this feature in production.

Please contribute to Tembo Documentation by finding the ‘Edit this page on GitHub’ link at the bottom of this page.

Building an image to use with Tembo Cloud

  1. Determine the image base

Build a container image based FROM the Tembo Cloud image. Find Tembo Cloud postgres image versions here, or fetch it from the API, like this, after generating an API token.

export TEMBO_TOKEN=<your token>
export TEMBO_ORG=<your organization id>
export TEMBO_INST=<your instance id>

curl -X 'GET' \
  "$TEMBO_ORG/instances/$TEMBO_INST" \
  -H "Authorization: Bearer $TEMBO_TOKEN" \
  | jq '.image'

Note that when fetching from the API, you will get back an image hosted in a private registry, so find the matching image tag on our public registry at

For example, from the API we may have found this image For that image, here is a sample Dockerfile:


# Example installing the "pandas" library in pip
RUN pip install pandas
  1. Build your image, and upload it to a registry

Next, we need to build our image and upload it to a container registry. Please refer to the Dockerhub documentation.

Here is an example of building and uploading to Quay:

docker build -t< your Quay organization >/standard-cnpg:15-custom-image-example .
docker push< your Quay organization >/standard-cnpg:15-custom-image-example

Configuring a custom PostgreSQL image via the Tembo Cloud API

  1. Generate an API token

  2. Set the following environment variables:

export TEMBO_TOKEN=<your token>
export TEMBO_ORG=<your organization id>
export TEMBO_INST=<your instance id>
  1. Patch your existing Tembo instance with new configuration values using the Tembo Cloud Platform API:
curl -X 'PATCH' \
  "$TEMBO_ORG/instances/$TEMBO_INST" \
  -H "accept: application/json" \
  -H "Authorization: Bearer $TEMBO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "experimental": {
    "image": "< your custom image here >"

Now, when you connect to your instance, it will have the custom dependencies available. For example:

CREATE FUNCTION use_pandas() RETURNS void AS $$
import pandas
$$ LANGUAGE plpython3u;

SELECT use_pandas();


chevron right arrow