For AI agents: the complete documentation index is available at https://docs.ovhcloud.com/de/llms.txt, the full documentation bundle is available at https://docs.ovhcloud.com/de/llms-full.txt, and this page is available as Markdown at https://docs.ovhcloud.com/de/guides/public-cloud/databases/postgresql-prepare-for-incoming-connections.md.

Configure incoming connections of a Public Cloud Databases for PostgreSQL service

Als Markdown ansehen

Find out how to configure your PostgreSQL instance to accept incoming connections

Objective

Public Cloud Databases allow you to focus on building and deploying cloud applications while OVHcloud takes care of the database infrastructure and maintenance in operational conditions.

This guide explains how to configure your PostgreSQL instance to accept incoming connections.

Requirements

  • A Public Cloud project in your OVHcloud account
  • A PostgreSQL database running on your OVHcloud Public Cloud Databases (this guide can help you to meet this requirement)

OVHcloud Control Panel Access

  • Direct link:
  • Navigation path: Public Cloud > Select your project > Databases

Instructions

Configure your PostgreSQL instance to accept incoming connections

Before making a connection, we need to verify that our PostgreSQL instance is correctly configured.

Click on Databases in the left-hand navigation bar and select your PostgreSQL instance.

Step 1: Verify your user roles and password

Select the Users tab. Verify that you have a user with sufficient rights and a configured password. If you don't remember the user's password, you can either create a new user or regenerate the password of an existing user. Be careful! By doing so you will need to update all the places where you already use this user/password pair.

This first user avnadmin comes with the following privileges:

  LOGIN
  NOSUPERUSER
  INHERIT
  CREATEDB
  CREATEROLE
  REPLICATION

We rely on official PostgreSQL roles and privileges. You can manage them yourself via CLI or code. So far, user grants and privileges management are not supported via the OVHcloud Control Panel or the OVHcloud API.

See the Manage users, roles and privileges guide for the scope of the replication privilege, the default behaviour of a new user and the usual GRANT commands. The official PostgreSQL documentation describes all available roles.

To reset the avnadmin password, click on the ... on the right of the user, then on Reset password.

User actions menu

To create a new user, click on Add user, fill the form, then click on the Create User.

Create User

Once created or updated, the user must have the READY status in the OVHcloud Control Panel.

Warning

Creating a user does not give it access to your data. The user can connect to the database, but has no read or write privileges on your tables until you grant them in SQL.

Step 2: Authorise incoming connections from the PostgreSQL client

By default, a Public Cloud Databases service does not accept any connection from the outside world. This helps prevent intrusive connection attempts.

Warning

As long as no IP address is authorised, your service is unreachable, even though it appears as available in the OVHcloud Control Panel: connection attempts fail, usually with a timeout and no explicit error message on the client side.

Select the Configuration tab, then locate the IPs section.

Enter an IP address or a CIDR block in the IP address or IP/mask field, add a description to identify its origin, then click Add. In our example, we enter 203.0.113.10/32.

Two shortcuts are available above the input field:

  • Current IP: adds the public IP address from which you are browsing the OVHcloud Control Panel. Convenient for a development workstation, provided your address is static.
  • OVHcloud Data Platform IP: adds the addresses required for OVHcloud Data Platform services to reach your database.
Add an IP
Warning

You can enter 0.0.0.0/0 to allow connections from any address. Your service then becomes reachable from the entire Internet, and only the username/password pair protects your data. Reserve this for tests, and prefer restricted CIDR blocks or the vRack private network for production environments.

Info

A dynamic IP address changes periodically: if your workstation or outbound gateway does not have a static address, your connections will stop working without any change on your side. In that case, authorise your provider's CIDR block, or use an egress point with a static address.

Collect required information

Select the Dashboard tab to find the connection details in the Connection information section: hostname, port, protocol, SSL mode, connection URI and the CA certificate of the service.

Connection information section

Select the Databases tab to get the database name.

Databases tab

Select the Users tab to get the username.

User table

Go further

Connect using the CLI

Secure the TLS connection

Manage users, roles and privileges

Visit the Github examples repository to find how to connect to your database with several languages.

Visit our dedicated Discord channel: https://discord.gg/ovhcloud. Ask questions, provide feedback and interact directly with the team that builds our databases services.

For training or technical assistance implementing our solutions, contact your sales representative or visit our Professional Services page to request a quote and have your project analysed by our experts.

Join our community of users.

War diese Seite hilfreich?