Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex Managed Service for PostgreSQL
  • Getting started
  • Access management
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes

In this article:

  • Getting started
  • Create a cluster
  • Connect to the DB
  • What's next

Getting started with Managed Service for PostgreSQL

Written by
Yandex Cloud
Improved by
Danila N.
Updated at April 22, 2025
  • Getting started
  • Create a cluster
  • Connect to the DB
  • What's next

To get started with the service:

  • Create a DB cluster.
  • Connect to the DB.

Getting startedGetting started

  1. Go to the management console and log in to Yandex Cloud or sign up if not signed up yet.

  2. If you do not have a folder yet, create one:

    1. In the management console, select the appropriate cloud from the list on the left.

    2. At the top right, click Create folder.

    3. Give your folder a name. The naming requirements are as follows:

      • It must be from 2 to 63 characters long.
      • It may contain lowercase Latin letters, numbers, and hyphens.
      • It must start with a letter and cannot end with a hyphen.
    4. Optionally, specify the description for your folder.

    5. Select Create a default network. This will create a network with subnets in each availability zone. Within this network, you will also have a default security group, inside which all network traffic will be allowed.

    6. Click Create.

  3. Assign the vpc.user role and the managed-postgresql.editor role or higher to your Yandex Cloud account. These roles allow you to create a cluster.

    Note

    If you are unable to manage roles, contact your cloud or organization administrator.

  4. You can connect to DB clusters from both inside and outside Yandex Cloud:

    • To connect from inside Yandex Cloud, create a VM in the same cloud network as the DB cluster (on Linux).

    • To connect to the cluster from the internet, request public access to hosts when creating the cluster.

    Note

    The next step assumes that you connect to the cluster from a Linux-based VM.

  5. Connect to the VM over SSH.

  6. Install the required dependencies and the PostgreSQL client:

    sudo apt update && sudo apt install -y postgresql-client
    

Create a clusterCreate a cluster

  1. In the management console, select the folder where you want to create a DB cluster.
  2. Select Managed Service for PostgreSQL.
  3. Click Create cluster.
  4. Set the cluster parameters and click Create cluster. For more information, see Creating clusters.
  5. Wait until the cluster is ready: its status on the Managed Service for PostgreSQL dashboard will change to Running and its state, to Alive. This may take some time.

Connect to the DBConnect to the DB

  1. If you are using security groups for a cloud network, configure them to enable all relevant traffic between the cluster and the connecting host.

  2. To connect to the DB server, get an SSL certificate:

    Linux (Bash)/macOS (Zsh)
    Windows (PowerShell)
    mkdir -p ~/.postgresql && \
    wget "https://storage.yandexcloud.net/cloud-certs/CA.pem" \
         --output-document ~/.postgresql/root.crt && \
    chmod 0655 ~/.postgresql/root.crt
    

    The certificate will be saved to the ~/.postgresql/root.crt file.

    mkdir $HOME\.postgresql; curl.exe -o $HOME\.postgresql\root.crt https://storage.yandexcloud.net/cloud-certs/CA.pem
    

    The certificate will be saved to the $HOME\.postgresql\root.crt file.

    Corporate policies and antivirus software can block the download of certificates. For more information, see FAQ.

  3. Use the psql command to connect:

    psql "host=c-<cluster_ID>.rw.mdb.yandexcloud.net \
          port=6432 \
          sslmode=verify-full \
          dbname=<DB_name> \
          user=<user_name> \
          target_session_attrs=read-write"
    

What's nextWhat's next

  • Read about service concepts.
  • Learn more about creating a cluster and connecting to the database.
  • Read questions and answers.

Was the article helpful?

Next
All guides
Yandex project
© 2025 Yandex.Cloud LLC