Getting started with Managed Service for PostgreSQL
To get started with the service:
Getting started
-
Go to the management console
and log in to Nebius AI or create an account if you do not have one yet. -
You can connect to DB clusters from both inside and outside Nebius AI:
-
To connect to a DB cluster from inside Nebius AI, create a VM in the same cloud network as the DB cluster (with Linux).
-
To be able 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.
-
-
Connect to the VM via SSH.
-
Install the necessary dependencies and the PostgreSQL client:
sudo apt update && sudo apt install -y postgresql-client
Create a cluster
- In the management console, select the folder where you want to create a DB cluster.
- Select Managed Service for PostgreSQL.
- Click Create cluster.
- Set the cluster parameters and click Create cluster. This process is described in detail in Creating PostgreSQL clusters.
- Wait until the cluster is ready: its status on the Managed Service for PostgreSQL dashboard changes to Running and its state to Alive. This may take some time.
Connect to the DB
-
To connect to the DB server, get an SSL certificate:
Linux (Bash) and macOS (Zsh)Windows (PowerShell)mkdir -p ~/.postgresql && \ wget "https://storage.nemax.nebius.cloud/certs/CA.pem" \ --output-document ~/.postgresql/root.crt && \ chmod 0600 ~/.postgresql/root.crt
The certificate is saved to the
~/.postgresql/root.crt
file.mkdir $HOME\.postgresql; curl.exe -o $HOME\.postgresql\root.crt https://storage.nemax.nebius.cloud/certs/CA.pem
The certificate is saved to the
$HOME\.postgresql\root.crt
file. -
Use the
psql
command to connect:psql "host=c-<cluster ID>.rw.mdb.nemax.nebius.cloud \ port=6432 \ sslmode=verify-full \ dbname=<DB name> \ user=<user name> \ target_session_attrs=read-write"
What's next
- Read about service concepts.
- Learn more about creating a cluster and connecting to the database.
- Read questions and answers.