---
name: databases-for-postgresql-getting-started
title: Getting started with Databases for PostgreSQL
description: This tutorial guides you through the steps to quickly start by using Databases for PostgreSQL by provisioning an instance, setting up pgAdmin, setting your admin password, and setting up logging and monitoring.
last-updated: 2026-05-21
---

> ## Documentation Index
> The table of contents for this documentation set is at https://cloud.ibm.com/docs/databases-for-postgresql?format=markdown
> The index for all IBM Cloud docs is at: https://cloud.ibm.com/docs/llms.txt
> Use these files to discover more information as needed.

# Getting started with Databases for PostgreSQL
{: #getting-started}
{: toc-content-type="tutorial"}
{: toc-services=""}
{: toc-completion-time="30m"}

This tutorial guides you through the steps to quickly start by using Databases for PostgreSQL by provisioning an instance, setting up pgAdmin, setting your admin password, and setting up logging and monitoring.

Follow these steps to complete the tutorial: {: ui}

* [Before you begin](#prereqs)
* [Step 1: Provision through the console](#provision_instance_ui)
* [Step 2: Set your admin password through the console](#admin_pw)
* [Step 3: Set up pgAdmin](#pgadmin)
* [Step 4: Set up context-based restrictions](#postgresql_cbr)
* [Step 5: Connect IBM Cloud Monitoring](#connect_monitoring_ui)
* [Step 6: Connect IBM Cloud&reg; Activity Tracker Event Routing](#activity_tracker_ui)
* [Next Steps](#next_steps)
{: ui}

Follow these steps to complete the tutorial: {: cli}

* [Before you begin](#prereqs)
* [Step 1: Provision through the CLI](#provision_instance_cli)
* [Step 2: Set your admin password through the CLI](#admin_pw)
* [Step 3: Set up pgAdmin](#pgadmin)
* [Step 4: Set up context-based restrictions](#postgresql_cbr)
* [Step 5: Connect IBM Cloud Monitoring](#connect_monitoring_cli)
* [Step 6: Connect IBM Cloud&reg; Activity Tracker Event Routing}](#activity_tracker_cli)
* [Next Steps](#next_steps)
{: cli}

Follow these steps to complete the tutorial: {: api}

* [Before you begin](#prereqs)
* [Step 1: Provision through the API](#provision_instance_api)
* [Step 2: Set your admin password](#admin_pw)
* [Step 3: Set up pgAdmin](#pgadmin)
* [Step 4: Set up context-based restrictions](#postgresql_cbr)
* [Step 5: Connect IBM Cloud Monitoring](#connect_monitoring_api)
* [Step 6: Connect IBM Cloud&reg; Activity Tracker Event Routing](#activity_tracker_api)
* [Next Steps](#next_steps)
{: api}

Follow these steps to complete the tutorial: {: terraform}

* [Before you begin](#prereqs)
* [Step 1: Provision through Terraform](#provision_instance_tf)
* [Step 2: Set your admin password](#admin_pw)
* [Step 3: Set up pgAdmin](#pgadmin)
* [Step 4: Set up context-based restrictions](#postgresql_cbr)
* [Step 5: Connect IBM Cloud Monitoring](#connect_monitoring_tf)
* [Step 6: Connect IBM Cloud&reg; Activity Tracker Event Routing](#activity_tracker_tf)
* [Next Steps](#next_steps)
{: terraform}


## Before you begin
{: #prereqs}

* You need an [IBM Cloud account](https://cloud.ibm.com/registration){: external}.

## Step 1: Provision through the console
{: #provision_instance_ui}
{: ui}

1. Log in to the IBM Cloud console.
1. Click the [**Databases for PostgreSQL service**](https://cloud.ibm.com/databases/databases-for-postgresql/create){: external} in the **catalog**.

1. In **Service details**, configure the following:
    - **Service name** - The name can be any string and is the name that is used on the web and in the CLI to identify the new deployment.
    - **Resource group** - If you are organizing your services into [resource groups](https://cloud.ibm.com/docs/account?topic=account-account_setup&format=markdown), specify the resource group in this field. Otherwise, you can leave it at default. For more information, see [Managing resource groups](https://cloud.ibm.com/docs/account?topic=account-rgs&format=markdown).
    - **Location** - The deployment's public cloud region.
1. **Resource allocation** - Specify the initial RAM, disk, and cores for your databases. The minimum sizes of memory and disk are selected by default. With dedicated cores, your resource group is given a single-tenant host with a minimum reserve of CPU shares. Your deployments are then allocated the number of cores that you specify. *Once provisioned, disk cannot be scaled down.*
1. In **Service configuration**, configure the following:
    - **Database version** [Set only at deployment]{: tag-red} - The deployment version of your database. To ensure optimal performance, run the preferred version. The latest minor version is used automatically. For more information, see [Database versioning policy](https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-versioning-policy&format=markdown){: external}.
    - **Encryption** - If you use [Key Protect](https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-key-protect&interface=ui&format=markdown), an instance and key can be selected to encrypt the deployment's disk. If you do not use your own key, the deployment automatically creates and manages its own disk encryption key.
    - **Endpoints** [Set only at deployment]{: tag-red} - Configure the [Service endpoints](https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-service-endpoints&format=markdown) on your deployment.

    After you configure the appropriate settings, click **Create** to start the provisioning process. The Databases for PostgreSQL **Resource list** page opens.

1. Click **Create**. The Cloud Databases **Resource list** page opens.

1. When your instance is provisioned, click the instance name to view more information.

## Step 1: Provision through the CLI
{: #provision_instance_cli}
{: cli}

You can provision a Databases for PostgreSQL instance through the CLI. If you don't already have it, you need to install the [IBM Cloud CLI](https://www.ibm.com/cloud/cli){: external}.

1. Log in to IBM Cloud with the following command:
{: #step2_login_qsg}

    ```sh
    ibmcloud login
    ```
    {: pre}

    If you use a federated user ID, it's important that you switch to a one-time passcode (`ibmcloud login --sso`), or use an API key (`ibmcloud --apikey key` or `@key_file`) to authenticate. For more information about how to log in using the CLI, see [General CLI (ibmcloud) commands](https://cloud.ibm.com/docs/cli?topic=cli-ibmcloud_cli&format=markdown#ibmcloud_login) under `ibmcloud login`.

1. Create a Databases for PostgreSQL instance.
{: #step3_es_instance}

    Select one of the following methods:

    * To create an instance from the CLI on the Enterprise plan, run the following command:

        ```sh
        ibmcloud resource service-instance-create <INSTANCE_NAME> <SERVICE_NAME> <SERVICE_PLAN_NAME> <LOCATION> <SERVICE_ENDPOINTS_TYPE> <RESOURCE_GROUP>
        ```
        {: codeblock}

   The fields in the command are described in the table that follows.

   | Field | Description | Flag |
   |-------|------------|------------|
   | `NAME` [Required]{: tag-red} | The instance name can be any string and is the name that is used on the web and in the CLI to identify the new deployment. |  |
   | `SERVICE_NAME` [Required]{: tag-red} | Name or ID of the service. For Databases for PostgreSQL, use `databases-for-postgresql`. |  |
   | `SERVICE_PLAN_NAME` [Required]{: tag-red} | Standard plan (`standard`) |  |
   | `LOCATION` [Required]{: tag-red} | The location where you want to deploy. To retrieve a list of regions, use the `ibmcloud regions` command. |  |
   | `SERVICE_ENDPOINTS_TYPE` | Configure the [Service endpoints](https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-service-endpoints&format=markdown) of your deployment, either `public` or `private`. |  |
   | `RESOURCE_GROUP` | The Resource group name. The default value is `default`. | -g |
   | `--parameters` | JSON file or JSON string of parameters to create service instance | -p |
   {: caption="Basic command format fields" caption-side="top"}

   You see a response like:

   ```text
   Creating service instance INSTANCE_NAME in resource group default of account    USER...
   OK
   Service instance INSTANCE_NAME was created.

   Name:                INSTANCE_NAME
   ID:                  crn:v1:bluemix:public:databases-for-postgresql:us-east:a/   40ddc34a846383BGB5b60e:dd13152c-fe15-4bb6-af94-fde0af5303f4::
   GUID:                dd13152c-fe15-4bb6-af94-fde0af56897
   Location:            LOCATION
   State:               provisioning
   Type:                service_instance
   Sub Type:            Public
   Service Endpoints:   private
   Allow Cleanup:       false
   Locked:              false
   Created at:          2023-06-26T19:42:07Z
   Updated at:          2023-06-26T19:42:07Z
   Last Operation:
                        Status    create in progress
                        Message   Started create instance operation
   ```
   {: codeblock}

1. To check provisioning status, use the following command:

   ```sh
   ibmcloud resource service-instance <INSTANCE_NAME>
   ```
   {: pre}

   When complete, you see a response like:

   ```text
   Retrieving service instance INSTANCE_NAME in resource group default under account USER's Account as USER...
   OK

   Name:                  INSTANCE_NAME
   ID:                    crn:v1:bluemix:public:databases-for-postgresql:us-east:a/40ddc34a953a8c02f109835656860e:dd13152c-fe15-4bb6-af94-fde0af5303f4::
   GUID:                  dd13152c-fe15-4bb6-af94-fde5654765
   Location:              <LOCATION>
   Service Name:          databases-for-postgresql
   Service Plan Name:     standard
   Resource Group Name:   default
   State:                 active
   Type:                  service_instance
   Sub Type:              Public
   Locked:                false
   Service Endpoints:     private
   Created at:            2023-06-26T19:42:07Z
   Created by:            USER
   Updated at:            2023-06-26T19:53:25Z
   Last Operation:
                          Status    create succeeded
                          Message   Provisioning PostgreSQL with version 12 (100%)
   ```
   {: codeblock}

1. (Optional) Deleting a service instance
   Delete an instance by running a command like this one:

   ```sh
   ibmcloud resource service-instance-delete <INSTANCE_NAME>
   ```
   {: pre}

### Connect to your database with the CLI
{: #connecting-cli}

Find the appropriate commands to connect to your database from the CLI in [Cloud Databases CLI Reference](https://cloud.ibm.com/docs/databases-cli-plugin?topic=databases-cli-plugin-cdb-reference&format=markdown) and [Connecting with psql](https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-connecting-psql&format=markdown).

The `ibmcloud cdb deployment-connections` command handles everything that is involved in creating a CLI connection. For example, to connect to a deployment named "example-postgres", use a command like:

```sh
ibmcloud cdb deployment-connections example-postgres --start
```
{: pre}

The command prompts for the admin password and then runs the `psql` CLI to connect to the database. To install the Cloud Databases plug-in, see [Connecting with psql documentation here](https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-connecting-psql&format=markdown).

### The `--parameters` parameter
{: #flags-params-service-endpoints}
{: cli}

The `service-instance-create` command supports a `-p` flag, which allows JSON-formatted parameters to be passed to the provisioning process. Some parameter values are Cloud Resource Names (CRNs), which uniquely identify a resource in the cloud. All parameter names and values are passed as strings.

For example, if a database is being provisioned from a particular backup and the new database deployment needs a total of 9 GB of memory across three members, then the command to provision 3 GBs per member looks like:

```sh
ibmcloud resource service-instance-create databases-for-postgresql <SERVICE_NAME> standard us-south \
-p \ '{
  "backup_id": "crn:v1:blue:public:databases-for-postgresql:us-south:a/54e8ffe85dcedf470db5b5ee6ac4a8d8:1b8f53db-fc2d-4e24-8470-f82b15c71717:backup:06392e97-df90-46d8-98e8-cb67e9e0a8e6",
  "members_memory_allocation_mb": "3072"
}'
```
{: .pre}

## Step 1: Provision through the resource controller API
{: #provision_instance_api}
{: api}

Follow these steps to provision by using the [resource controller API](https://cloud.ibm.com/apidocs/resource-controller/resource-controller){: external}.

1. Obtain an [IAM token from your API token](https://cloud.ibm.com/apidocs/resource-controller/resource-controller#authentication){: external}.
1. You need to know the ID of the resource group that you would like to deploy to. This information is available through the [IBM Cloud CLI](https://cloud.ibm.com/docs/cli?topic=cli-ibmcloud_commands_resource&format=markdown#ibmcloud_resource_groups).

   Use a command like:
   ```sh
   ibmcloud resource groups
   ```
   {: pre}

1. You need to know the region that you would like to deploy into.

   To list all of the regions that deployments can be provisioned into from the current region, use the [Cloud Databases CLI plug-in](https://cloud.ibm.com/docs/databases-cli-plugin?topic=databases-cli-plugin-cdb-reference&format=markdown){: external}.

   The command looks like:

   ```sh
   ibmcloud cdb regions --json
   ```
   {: pre}


   Once you have all the information, [provision a new resource instance](https://cloud.ibm.com/apidocs/resource-controller/resource-controller#create-resource-instance){: external} with the IBM Cloud resource controller.

   ```sh
   curl -X POST \
     https://resource-controller.cloud.ibm.com/v2/resource_instances \
     -H 'Authorization: Bearer <>' \
     -H 'Content-Type: application/json' \
       -d '{
       "name": "my-instance",
       "target": "blue-us-south",
       "resource_group": "5g9f447903254bb58972a2f3f5a4c711",
       "resource_plan_id": "databases-for-postgresql-standard"
     }'
   ```
   {: .pre}

   The parameters `name`, `target`, `resource_group`, and `resource_plan_id` are all required.
   {: required}

## List of additional parameters
{: #provisioning-parameters-api}
{: api}

* `backup_id`- A CRN of a backup resource to restore from. The backup must be created by a database deployment with the same service ID. The backup is loaded after provisioning and the new deployment starts up that uses that data. A backup CRN is in the format `crn:v1:<...>:backup:<uuid>`. If omitted, the database is provisioned empty.
* `version` - The version of the database to be provisioned. If omitted, the database is created with the most recent major and minor version.
* `disk_encryption_key_crn` - The CRN of a KMS key ([Key Protect](https://cloud.ibm.com/docs/key-protect?topic=key-protect-about&format=markdown)), which is then used for disk encryption. A KMS key CRN is in the format `crn:v1:<...>:key:<id>`.
* `backup_encryption_key_crn` - The CRN of a KMS key (for example, [[Key Protect](https://cloud.ibm.com/docs/key-protect?topic=key-protect-about&format=markdown)), which is then used for backup encryption. A KMS key CRN is in the format `crn:v1:<...>:key:<id>`.

   To use a key for your backups, you must first [enable the service-to-service delegation](https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-key-protect&format=markdown#byok-for-backups).
   {: note}

* `members_memory_allocation_mb` -  Total amount of memory to be shared between the database members within the database. For example, if the value is "6144", and there are three database members, then the deployment gets 6 GB of RAM total, giving 2 GB of RAM per member. If omitted, the default value is used for the database type is used.
* `members_disk_allocation_mb` - Total amount of disk to be shared between the database members within the database. For example, if the value is "30720", and there are three members, then the deployment gets 30 GB of disk total, giving 10 GB of disk per member. If omitted, the default value for the database type is used.
* `members_cpu_allocation_count` - Enables and allocates the number of specified dedicated cores to your deployment. For example, to use two dedicated cores per member, use `"members_cpu_allocation_count":"2"`. If omitted, the default value "Shared CPU" uses compute resources on shared hosts.
* `service_endpoints` - The [Service endpoints](https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-service-endpoints&format=markdown) supported on your deployment, `public` or `private`. This is a required parameter.

## Step 1: Provision through Terraform
{: #provision_instance_tf}
{: terraform}

Use Terraform to manage your infrastructure through the [`ibm_database` Resource for Terraform](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/database){: external}. Alternatively, you can use Terraform IBM Modules to manage your infrastructure through [Terraform IBM Modules for Databases for PostgreSQL](https://registry.terraform.io/modules/terraform-ibm-modules/icd-postgresql/ibm/latest){: external}.

### Using APIs
{: #using_apis}
{: api}

Use the [Cloud Databases API](https://cloud.ibm.com/apidocs/cloud-databases-api/cloud-databases-api-v5#introduction){: external} to work with your Databases for PostgreSQL instance. The resource controller API is used to [provision an instance](#provision_instance_api).

## Step 2: Set the admin password
{: #admin_pw}

### The admin user
{: #admin_pw_admin_user}

When you provision a Databases for PostgreSQL deployment, an admin user is automatically created.

Set the admin password before using it to connect.
{: important}

When you provision a new deployment in IBM Cloud, you are automatically given an `admin` user to access and manage PostgreSQL. Once you [set the admin password](https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-user-management&interface=ui&format=markdown#user-management-set-admin-password-ui), use it to connect to your deployment.

When `admin` creates a resource in a database, like a table, `admin` owns that object. Resources that are created by `admin` are not accessible by other users, unless you expressly grant permissions to them.

The biggest difference between the `admin` user and any other users you add to your deployment is the [`pg_monitor`](https://www.postgresql.org/docs/current/default-roles.html){: .external} and [`pg_signal_backend`](https://www.postgresql.org/docs/current/default-roles.html){: .external} roles. The `pg_monitor` role provides a set of permissions that makes the admin user appropriate for monitoring the database server. The `pg_signal_backend` role provides the admin user the ability to send signals to cancel queries and connections that are initiated by other users. It is not able to send signals to processes owned by superusers.

You can also use the `admin` user to grant these two roles to other users on your deployment.

To expose the ability to cancel queries to other database users, grant the `pg_signal_backend` role from the `admin` user. Use a command like:

```sql
GRANT pg_signal_backend TO joe;
```
{: .pre}

To allow the user `joe` to cancel backends, grant `pg_signal_backend` to all the users with the `ibm-cloud-base-user` role with a command like:

```sql
GRANT pg_signal_backend TO "ibm-cloud-base-user";
```
{: .pre}

This privilege allows the user or users to terminate any connections to the database.
{: important}

To set up a specific monitoring user, `mary`, use a command like:

```sql
GRANT pg_monitor TO mary;
```
{: .pre}

Grant `pg_signal_backend` to all the users with the `ibm-cloud-base-user` role with a command like:

```sql
GRANT pg_monitor TO "ibm-cloud-base-user";
```
{: .pre}

### Setting the admin password in the UI
{: #user-management-set-admin-password-ui}
{: ui}

Set your Admin Password through the UI by selecting your instance from the Resource List in the [IBM Cloud Dashboard](https://cloud.ibm.com/){: external}. Then, select **Settings**. Next, select *Change Database Admin Password*.

### Set the admin password through the CLI
{: #admin_pw_set_cli}
{: cli}

Use the `cdb user-password` command from the IBM Cloud CLI Cloud Databases plug-in to set the admin password.

For example, to set the admin password for a deployment named `example-deployment`, use the following command:

```sh
ibmcloud cdb user-password example-deployment admin <newpassword>
```
{: pre}

### Set the admin password through the API
{: #admin_pw_set_api}
{: api}

The Foundation Endpoint that is shown in the Overview Deployment Details section of your service provides the base URL to access this deployment through the API. Use it with the [Set specified user's password](https://cloud.ibm.com/apidocs/cloud-databases-api/cloud-databases-api-v5#changeuserpassword){: external} endpoint to set the admin password.

```sh
curl -X PATCH `https://api.{region}.databases.cloud.ibm.com/v5/ibm/deployments/{id}/users/admin` \
-H `Authorization: Bearer <>` \
-H `Content-Type: application/json` \
-d `{"password":"newrootpasswordsupersecure21"}` \
```
{: pre}

### Set the admin password through Terraform
{: #admin_pw_set_tf}
{: terraform}

To set the Admin password, use the API:

The Foundation Endpoint that is shown in the Overview Deployment Details section of your service provides the base URL to access this deployment through the API. Use it with the [Set specified user's password](https://cloud.ibm.com/apidocs/cloud-databases-api/cloud-databases-api-v5#changeuserpassword){: external} endpoint to set the admin password.

```sh
curl -X PATCH `https://api.{region}.databases.cloud.ibm.com/v5/ibm/deployments/{id}/users/admin` \
-H `Authorization: Bearer <>` \
-H `Content-Type: application/json` \
-d `{"password":"newrootpasswordsupersecure21"}` \
```
{: pre}

You can also use the CLI:

Use the `cdb user-password` command from the IBM Cloud CLI Cloud Databases plug-in to set the admin password.

For example, to set the admin password for a deployment named `example-deployment`, use the following command:

```sh
ibmcloud cdb user-password example-deployment admin <newpassword>
```
{: pre}

To set the admin password through the UI, follow these steps:

Set your admin password through the UI by selecting your instance from the Resource List in the [IBM Cloud Dashboard](https://cloud.ibm.com/){: external}. Then, select **Settings**. Next, select *Change Database admin password*.

## Step 3: Set up pgAdmin
{: #pgadmin}

pgAdmin runs as a server and you connect to it through a browser. When the server is started, it runs on localhost, at default `http://127.0.0.1:53113/browser/`.

When you first open pgAdmin, you get a prompt for setting a primary password. This password is different from your instance's password as it is used specifically for pgAdmin to store passwords to your PostgreSQL servers or PostgreSQL instance.

The *Dashboard* panel has a *Welcome* screen. From the *Quick links*, click *Add new server*.

On your instance's *Overview* page, there is an *Endpoints* panel with all the relevant connection information.

Back in pgAdmin, provide pgAdmin with the information it needs to connect to your instance.

First, complete the *Connection* information,
- For *Host name/address*, use the *Hostname* of your instance.
- For the *Port*, use the *Port* of your instance.
- The *Maintenance database* remains `postgres`.
- For *Username* and *Password*, use the `admin` credentials that you set after provisioning your instance. You can choose for pgAdmin to save the password.
- The *Role* and *Service* fields can be left empty.

Then, configure the *SSL* settings.
- Copy the certificate information from the [*Endpoints* panel](https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-connection-strings&format=markdown) in your instance's `Dashboard overview` page.
- Save the certificate to a file. (You can use the name that is provided in the download, or your own file name.)
- Set the *SSL mode* field to *Verify-Full*.
- In the *Root certificate* field, select the file where you saved your instance's certificate.

Back on the *General* tab, give your instance a name and add any comments that you want to describe or identify your instance in pgAdmin.

If the *Connect now?* field is checked, pgAdmin attempts to connect to your instance when you click the **Save** button.

### Use pgAdmin
{: #using-pgadmin}

Once pgAdmin connects, your instance appears in the *Servers* list and you get a *Dashboard* with information and statistics.

In the list of databases in the *Browser*, there is both the `postgres` database, which you are connected to, and the `ibmclouddb` database, which is the default database for all Databases for PostgreSQL deployments. Click `ibmclouddb` to connect to it and expand the information about it.

Use pgAdmin to view, administer, and manage your data and databases in your Databases for PostgreSQL instance. For more information, see [pgAdmin documentation](https://www.pgadmin.org/docs/pgadmin4/latest/index.html).

Administrative features that require a superuser are not available through pgAdmin because there is no superuser access available to users of a Databases for PostgreSQL deployment.
{: .tip}

## Step 4: Set up context-based restrictions
{: #postgresql_cbr}

Context-based restrictions give account owners and administrators the ability to define and enforce access restrictions for IBM Cloud&reg; resources based on the context of access requests. Access to Cloud Databases resources can be controlled with context-based restrictions and Identity and Access Management (IAM) policies.

To set up context-based restrictions for your Databases for PostgreSQL instance, follow the steps at [Protecting Cloud Databases resources with context-based restrictions](https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-cbr&format=markdown){: external}.

## Step 5: Connect IBM Cloud Monitoring through the console
{: #connect_monitoring_ui}
{: ui}

You can use IBM Cloud Monitoring to get operational visibility into the performance and health of your applications, services, and platforms. IBM Cloud Monitoring provides administrators, DevOps teams, and developers full stack telemetry with advanced features to monitor and troubleshoot, define alerts, and design custom dashboards.

For more information about how to use Monitoring with Databases for PostgreSQL, see [Monitoring integration](https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-monitoring&format=markdown).


## Step 5: Connect IBM Cloud Monitoring through the CLI
{: #connect_monitoring_cli}
{: cli}

You can use IBM Cloud Monitoring to get operational visibility into the performance and health of your applications, services, and platforms. IBM Cloud Monitoring provides administrators, DevOps teams, and developers full stack telemetry with advanced features to monitor and troubleshoot, define alerts, and design custom dashboards.

For more information about how to use Monitoring with Databases for PostgreSQL, see [Monitoring integration](https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-monitoring&format=markdown).

You cannot connect IBM Cloud Monitoring by using the CLI. Use the console to complete this task. For more information, see [Monitoring integration](https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-monitoring&format=markdown).
{: note}

## Step 5: Connect IBM Cloud Monitoring through the API
{: #connect_monitoring_api}
{: api}

You can use IBM Cloud Monitoring to get operational visibility into the performance and health of your applications, services, and platforms. IBM Cloud Monitoring provides administrators, DevOps teams, and developers full stack telemetry with advanced features to monitor and troubleshoot, define alerts, and design custom dashboards.

For more information about how to use Monitoring with Databases for PostgreSQL, see [Monitoring integration](https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-monitoring&format=markdown).

You cannot connect IBM Cloud Monitoring by using the CLI. Use the console to complete this task. For more information, see [Monitoring integration](https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-monitoring&format=markdown).
{: note}

## Step 5: Connect IBM Cloud Monitoring through Terraform
{: #connect_monitoring_tf}
{: terraform}

You can use IBM Cloud Monitoring to get operational visibility into the performance and health of your applications, services, and platforms. IBM Cloud Monitoring provides administrators, DevOps teams, and developers full stack telemetry with advanced features to monitor and troubleshoot, define alerts, and design custom dashboards.

For more information about how to use Monitoring with Databases for PostgreSQL, see [Monitoring integration](https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-monitoring&format=markdown).

You cannot connect IBM Cloud Monitoring by using the CLI. Use the console to complete this task. For more information, see [Monitoring integration](https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-monitoring&format=markdown).
{: note}

## Step 6: Connect IBM Cloud Activity Tracker Event Routing
{: #activity_tracker_ui}
{: ui}

IBM Cloud&reg; Activity Tracker Event Routing allows you to view, manage, and audit service activity to comply with corporate policies and industry regulations. Activity Tracker Event Routing records user-initiated activities that change the state of a service in IBM Cloud. Use Activity Tracker Event Routing to track how users and applications interact with the Databases for PostgreSQL service.

To get up and running with Activity Tracker Event Routing, see [Getting started with IBM Cloud&reg; Activity Tracker Event Routing](https://cloud.ibm.com/docs/atracker?topic=atracker-getting-started&format=markdown){: external}.

Activity Tracker Event Routing can have only one instance per location. To view events, you must access the web UI of the IBM Cloud&reg; Activity Tracker Event Routing service in the same location where your service instance is available.

For more information about events specific to Databases for PostgreSQL, see [Activity tracking events](https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-at_events&format=markdown).

Events are formatted according to the Cloud Auditing Data Federation (CADF) standard. For further details of the information they include, see [CADF standard](https://cloud.ibm.com/docs/atracker?topic=atracker-event&format=markdown){: external}.


## Step 6: Connect IBM Cloud Activity Tracker Event Routing through the CLI
{: #activity_tracker_cli}
{: cli}

IBM Cloud&reg; Activity Tracker Event Routing allows you to view, manage, and audit service activity to comply with corporate policies and industry regulations. Activity Tracker Event Routing records user-initiated activities that change the state of a service in IBM Cloud. Use Activity Tracker Event Routing to track how users and applications interact with the Databases for PostgreSQL service.

To get up and running with Activity Tracker Event Routing, see [Getting Started with Activity Tracker Event Routing](https://cloud.ibm.com/docs/atracker?topic=atracker-getting-started&format=markdown){: external}.

Activity Tracker Event Routing can have only one instance per location. To view events, you must access the web UI of the Activity Tracker Event Routing service in the same location where your service instance is available. For more information, see [Launch the web UI](https://cloud.ibm.com/docs/activity-tracker?topic=activity-tracker-getting-started&format=markdown#gs_step4){: external}.

For more information about events specific to Databases for PostgreSQL, see [Activity tracking events](https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-at_events&interface=api&format=markdown).

Events are formatted according to the Cloud Auditing Data Federation (CADF) standard. For further details of the information they include, see [CADF standard](https://cloud.ibm.com/docs/atracker?topic=atracker-event&format=markdown){: external}.

You cannot connect Activity Tracker Event Routing by using the CLI. Use the console to complete this task. For more information, see [Activity tracking events](https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-at_events&interface=api&format=markdown).
{: note}

## Step 6: Connect IBM Cloud&reg; Activity Tracker Event Routing through the API
{: #activity_tracker_api}
{: api}

IBM Cloud Activity Tracker Event Routing allows you to view, manage, and audit service activity to comply with corporate policies and industry regulations. Activity Tracker Event Routing records user-initiated activities that change the state of a service in IBM Cloud. Use Activity Tracker Event Routing to track how users and applications interact with the Databases for PostgreSQL service.

To get up and running with Activity Tracker Event Routing, see [Getting Started with Activity Tracker Event Routing]/docs/atracker?topic=atracker-getting-started){: external}.

Activity Tracker Event Routing can have only one instance per location. To view events, you must access the web UI of the Activity Tracker Event Routing service in the same location where your service instance is available. For more information, see [Launch the web UI](https://cloud.ibm.com/docs/activity-tracker?topic=activity-tracker-getting-started&format=markdown#gs_step4){: external}.

For more information about events specific to Databases for PostgreSQL, see [Activity tracking events](https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-at_events&interface=api&format=markdown).

Events are formatted according to the Cloud Auditing Data Federation (CADF) standard. For further details of the information they include, see [CADF standard](https://cloud.ibm.com/docs/atracker?topic=atracker-event&format=markdown){: external}.

You cannot connect Activity Tracker Event Routing by using the API. Use the console to complete this task. For more information, see [Activity tracking events](https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-at_events&interface=api&format=markdown).
{: note}

## Step 6: Connect IBM Cloud Activity Tracker Event Routing through Terraform
{: #activity_tracker_tf}
{: terraform}

IBM Cloud&reg; Activity Tracker Event Routing allows you to view, manage, and audit service activity to comply with corporate policies and industry regulations. Activity Tracker Event Routing records user-initiated activities that change the state of a service in IBM Cloud. Use Activity Tracker Event Routing to track how users and applications interact with the Databases for PostgreSQL service.

To get up and running with Activity Tracker Event Routing, see [Getting Started with Activity Tracker Event Routing](https://cloud.ibm.com/docs/atracker?topic=atracker-getting-started&format=markdown){: external}.

Activity Tracker Event Routing can have only one instance per location. To view events, you must access the web UI of the Activity Tracker Event Routing service in the same location where your service instance is available. For more information, see [Launch the web UI](https://cloud.ibm.com/docs/activity-tracker?topic=activity-tracker-getting-started&format=markdown#gs_step4){: external}.

For more information about events specific to Databases for PostgreSQL, see [Activity tracking events](https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-at_events&interface=api&format=markdown).

Events are formatted according to the Cloud Auditing Data Federation (CADF) standard. For further details of the information they include, see [CADF standard](https://cloud.ibm.com/docs/atracker?topic=atracker-event&format=markdown){: external}.

You cannot connect Activity Tracker Event Routing by using the API. Use the console to complete this task. For more information, see [Activity tracking events](https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-at_events&interface=api&format=markdown).
{: note}

## Next steps
{: #next-steps}

- If you are using Databases for PostgreSQL for the first time, see the [official Databases for PostgreSQL documentation](https://www.postgresql.org/docs/){: external}.
- Secure your deployment by adding [context-based restrictions](https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-cbr&interface=ui&format=markdown).
- Connect your deployment to [IBM Cloud Log Analysis](https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-logging&interface=ui&format=markdown) and [IBM Cloud Monitoring](https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-monitoring&interface=ui&format=markdown) for observability and alerting.

- Connect to and manage your databases and data with Databases for PostgreSQL's CLI tool [`psql`](https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-connecting-psql&format=markdown).

- Looking for more tools on managing your databases? Connect to your instance with the following tools:
    - [IBM Cloud CLI](https://cloud.ibm.com/docs/cli?topic=cli-install-ibmcloud-cli&format=markdown){: external}
    - [Cloud Databases CLI plug-in](https://cloud.ibm.com/docs/databases-cli-plugin?topic=databases-cli-plugin-cdb-reference&format=markdown){: external}
    - [Cloud Databases API](https://cloud.ibm.com/apidocs/cloud-databases-api){: external}

- If you plan to use Databases for PostgreSQL for your applications, see:
    - [Connecting an external application](https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-external-app&format=markdown)
    - [Connecting an IBM Cloud application](https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-ibmcloud-app&format=markdown)

- To ensure the stability of your applications and your databases, see:
    - [High availability](https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-postgresql-ha-dr&format=markdown)
    - [Performance](https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-performance&format=markdown)