Learn how to configure your PostgreSQL instance to accept incoming connections.
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.
Requirements
- A Public Cloud project in your OVHcloud account
- Access to the OVHcloud Control Panel
- A PostgreSQL database running on your OVHcloud Cloud Databases (this guide can help you to meet this requirement)
Instructions
Configure your PostgreSQL instance to accept incoming connections
Before making a connection, we must verify that our PostgreSQL instance is correctly configured.
Log in to your OVHcloud Control Panel and open your database via the Public Cloud
and Databases
menus.
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.
Please read the official PostgreSQL documentation to select the right roles for your use case.
To reset the avnadmin password, click on the more options ...
to the right of the user, then on Reset password
.
To create a new user, click on + Add User
, fill out the form, and click the Create User
button.
Once created or updated, the user has to be ready and have the status "READY" in the Control Panel.
Step 2: Authorize incoming connections from the PostgreSQL client
In this step, select the Configuration
tab (Access Control List). By default, a Cloud Database does not accept any form of connection from the outside world. This way, we can help prevent intrusive connection attempts.
In the IPs section and enter the IP of your pgAdmin environment. Click the add +
button.
When finished, click Save changes
.
If you want to allow connections from the outside, you can enter the IP 0.0.0.0/0. Please use it carefully.
Collect required information
Select the Dashboard
tab to find the required login credentials in the Connection information section.
Select the Databases
tab to get the database name.
Select the Users
tab to get the username.
Go further
Visit the GitHub examples repository to find out how to connect to your database with several languages.
For more information and tutorials, please see our other Managed Databases & Analytics or Platform as a Service guides. You can also explore the guides for other OVHcloud products and services.