> ## Documentation Index
> Fetch the complete documentation index at: https://gcore-doc-1046.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Manage a PostgreSQL server

## Create a server

This guide describes how to create a PostgreSQL server.

### Before you begin

Before you begin, make sure you have enough quotas to create a PostgreSQL cluster.

1\. Go to **Cloud Management**, then **Quotas Viewer** and select the region.

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1046/Cf8gHikmtl4aL2hb/images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-10.png?fit=max&auto=format&n=Cf8gHikmtl4aL2hb&q=85&s=05815af63916f41be4eeb9144f028162" alt="manage postgresql" width="1392" height="501" data-path="images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-10.png" />
</Frame>

2\. On the **Database Service** tab, select the number of PostgreSQL clusters you need and specify the reason in the field on the right.

3\. Click **Send request**.

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1046/Cf8gHikmtl4aL2hb/images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-20.png?fit=max&auto=format&n=Cf8gHikmtl4aL2hb&q=85&s=6609083f80757cc8dfe35c287a78144c" alt="manage postgresql send quotas request" width="1470" height="803" data-path="images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-20.png" />
</Frame>

Your request will be processed within fifteen minutes and the number of quotas will be increased.

### Create a server

1\. In the Cloud menu, choose the Database for PostgreSQL tab and click **Create PostgreSQL server**.

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1046/Cf8gHikmtl4aL2hb/images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-30.png?fit=max&auto=format&n=Cf8gHikmtl4aL2hb&q=85&s=8cf222c7e65ab2a7f6bef6e9fdb241fc" alt="manage postgresql create a server" width="4616" height="2812" data-path="images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-30.png" />
</Frame>

2\. Choose the region where you want to host your PostgreSQL server.

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1046/Cf8gHikmtl4aL2hb/images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-40.png?fit=max&auto=format&n=Cf8gHikmtl4aL2hb&q=85&s=18e3910709e8ab444d5d01b02ccfe458" alt="manage postgresql choose region" width="622" height="386" data-path="images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-40.png" />
</Frame>

3\. Choose the appropriate [PostgreSQL version](/cloud/managed-database-postgresql#supported-versions).

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1046/Cf8gHikmtl4aL2hb/images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-50.png?fit=max&auto=format&n=Cf8gHikmtl4aL2hb&q=85&s=9ab14a37f375f7b66c7160151c9a30af" alt="manage postgresql select version" width="622" height="82" data-path="images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-50.png" />
</Frame>

4\. In **Compute**, select the server flavor. Optionally, you can set your own settings via text mode to enter specific database management system (DBMS) settings in the window that opens.

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1046/Cf8gHikmtl4aL2hb/images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-60.png?fit=max&auto=format&n=Cf8gHikmtl4aL2hb&q=85&s=a479e35fab0f6ec9da288c29fc991175" alt="manage postgresql select server flavor" width="824" height="205" data-path="images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-60.png" />
</Frame>

5\. In **Storage**, choose the volume type and size.

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1046/Cf8gHikmtl4aL2hb/images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-70.png?fit=max&auto=format&n=Cf8gHikmtl4aL2hb&q=85&s=e9df04422adbe03a0d96f7f5a8a520d7" alt="manage postgresql choose volume" width="622" height="166" data-path="images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-70.png" />
</Frame>

6\. (Optionally) Switch on the **Enable High availability** toggle in **PG configuration** to deploy three replicas with the same configuration to ensure that your database remains accessible even in the event of a server failure. If you turn on this feature, select the appropriate replication mode:

* Asynchronous: In asynchronous replication, servers work independently. The primary database sends the changes to the replicas and does not wait for confirmation that the changes have been applied. This mode is suitable for scenarios where data consistency with some level of delay is acceptable, though high performance is crucial.

* Synchronous: In synchronous replication, the primary database must wait for confirmation that the changes have been applied in the replica databases. The changes are replicated in real time or near-real time. It provides full protection against data loss but may have lower performance.

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1046/Cf8gHikmtl4aL2hb/images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-90.png?fit=max&auto=format&n=Cf8gHikmtl4aL2hb&q=85&s=984d4b7b19f43bce9aa3d17ad1fcedd5" alt="manage postgresql manage replication mode" width="798" height="196" data-path="images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-90.png" />
</Frame>

You can enable or disable this feature later.

7\. In **Network settings**, configure the network interface.

Choose Public network and configure the Access control list to limit the access to your server to the specified IP addresses.

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1046/Cf8gHikmtl4aL2hb/images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-100.png?fit=max&auto=format&n=Cf8gHikmtl4aL2hb&q=85&s=453cb51b3ae197a6dd7dc4a4aa302541" alt="manage postgresql manage network interface" width="829" height="410" data-path="images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-100.png" />
</Frame>

**Note** : If you add *0.0.0.0/0*, you will allow unrestricted access to all IP addresses from the Internet. We strongly recommend using this setting only temporarily and exclusively on test servers without any sensitive data.

8\. In **Authentication**, add your username.

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1046/Cf8gHikmtl4aL2hb/images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-110-v2.png?fit=max&auto=format&n=Cf8gHikmtl4aL2hb&q=85&s=75636dadd6b712dbaf5b36da639aabee" alt="manage postgresql manage authentication" width="2424" height="580" data-path="images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-110-v2.png" />
</Frame>

9\. In **Server details**, specify the server name and database name.

**Note** : The database size limit is 100 GB. This limit is for the beta stage only. If you need a more extensive database size during beta—please get in touch with [support](mailto:support@gcore.com).

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1046/Cf8gHikmtl4aL2hb/images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-120.png?fit=max&auto=format&n=Cf8gHikmtl4aL2hb&q=85&s=8ead5411554a25d42808ad93dc43d14d" alt="manage postgresql specify server details" width="622" height="250" data-path="images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-120.png" />
</Frame>

10\. Click **Create PostgreSQL server** in the window on the right-hand side.

The server will be created in a few minutes.

## Get your credentials

This guide explains how to obtain the password to start using your Postgres server and how to reset it if you forget it.

1\. Go to the **Database for PostgreSQL** tab and select the server you need.

2\. Click **Generate credentials**.

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1046/Cf8gHikmtl4aL2hb/images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-130.jpg?fit=max&auto=format&n=Cf8gHikmtl4aL2hb&q=85&s=9ddfc1de67f9764c7c22424990694663" alt="manage postgresql generate credentials" width="1030" height="390" data-path="images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-130.jpg" />
</Frame>

3\. Copy and save the password now. Once you close the window you will not be able to recover it.

**Note** : If you forget your password, you can only reset it. A new password will be generated, and the previous one will be deactivated.

4\. Click **OK**.

## Upgrade the PostgreSQL version

If your current PostgreSQL version is not the latest one, you can upgrade it.

1\. Go to the **Database for PostgreSQL** tab and select the server you need.

2\. On the **Overview** tab, click **Update** in the General info section.

**Note** : if you use the latest version, the button will be absent.

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1046/Cf8gHikmtl4aL2hb/images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-140.png?fit=max&auto=format&n=Cf8gHikmtl4aL2hb&q=85&s=5064ebff6b00c9972aadf7b85a8b3972" alt="manage postgresql update version" width="1999" height="978" data-path="images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-140.png" />
</Frame>

3\. Select the version you need from the drop-down list and click **Update**.

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1046/Cf8gHikmtl4aL2hb/images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-145.png?fit=max&auto=format&n=Cf8gHikmtl4aL2hb&q=85&s=6c7207f79e688db5c74956ac1e693114" alt="manage postgresql update version pop up" width="1026" height="516" data-path="images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-145.png" />
</Frame>

## Delete a server

1\. Go to the **Database for PostgreSQL** tab and select the server you want to delete.

2\. Click **Delete server**.

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1046/Cf8gHikmtl4aL2hb/images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-150.jpg?fit=max&auto=format&n=Cf8gHikmtl4aL2hb&q=85&s=db227eee5335db30f6766371e1237943" alt="manage postgresql delete server" width="1030" height="390" data-path="images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-150.jpg" />
</Frame>

3\. In the new window, type in *Delete* and click the **Delete server** button.

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1046/Cf8gHikmtl4aL2hb/images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-160-v2.png?fit=max&auto=format&n=Cf8gHikmtl4aL2hb&q=85&s=80b90749e8f33e602a635e75c31b7e29" alt="manage postgresql confirm deletion" width="858" height="373" data-path="images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-160-v2.png" />
</Frame>

## Connect to a PostgreSQL server

This guide explains what tools you can use to access your PostgreSQL server and how to connect using psql and pgAdmin.

### Before the beginning

Before you connect to your PostgreSQL server, make sure to do the following:

1\. Collect the connection details:

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1046/Cf8gHikmtl4aL2hb/images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-170.png?fit=max&auto=format&n=Cf8gHikmtl4aL2hb&q=85&s=afc5c973532697583b5de1f22b2e441f" alt="manage postgresql connection details" width="1305" height="621" data-path="images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-170.png" />
</Frame>

* Endpoint. You can find it in the "Connection details"
* Username. You can find it in the "Connection detais"
* Port. You can find it by copying the connection strings in the "Connection details"
* Password. You should have got it separately after creating a server. If you forgot your password, [reset it](/cloud/managed-database-postgresql/manage-postgresql-servers#get-your-credentials).

2\. Make sure your client computer is in the access control list of the PostgreSQL server. It means that the external IP address of PC which is trying to connect to PostgreSQL should be in allowlist (ACL).

3\. Determine what tool you will use to connect to your server.

* psql (Postgres Terminal Monitor): The command-line PostgreSQL client, that allows you to enter, edit, and execute SQL commands directly from your terminal or command prompt.

* Native Frontend Tools (e.g., pgaccess, pgAdmin, ApplixWare): They provide graphical user interfaces (GUIs) for PostgreSQL database management. These tools offer a more user-friendly and visual way to create and manipulate databases.

* Programming Languages (e.g., Perl, Tcl): These languages have supported interfaces for PostgreSQL. You can use these languages to write scripts or applications that connect to PostgreSQL databases programmatically. Some of the languages have convenient and powerful GUI toolkits which can help you construct custom applications. For example, pgaccess, mentioned above, is one of such applications written in Tcl/Tk.

* C Programming with LIBPQ: If you're a C programmer, you can use the LIBPQ subroutine library to write C programs that connect to PostgreSQL databases. This allows you to submit SQL commands from your C program, retrieve results, and manage database interactions programmatically. The detailed information on using LIBPQ can be found in "[The PostgreSQL Programmer's Guide](https://www.postgresql.org/docs/7.3/programmer.html)."

### Connect using the psql client

1\. [Download the PostgreSQL client](https://www.postgresql.org/download/) from the PostgreSQL website for your operating system in order to install psql.

2\. Start psql by typing the following command in your terminal:

```sh theme={null}
psql -h hostname -p port -d dbname -U username
```

Replace `hostname`, `port`, `dbname`, and `username` with your custom values.

3\. Enter the password and press **Enter**.

For more details, refer to the [PostgreSQL official documentation](https://www.postgresql.org/docs/).

### Connect using pgAdmin

1\. [Download](https://www.pgadmin.org/) and install pgAdmin to your client computer.

2\. Launch pgAdmin.

3\. On the **Dashboard** tab, choose **Add New Server**.

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1046/Cf8gHikmtl4aL2hb/images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-180.png?fit=max&auto=format&n=Cf8gHikmtl4aL2hb&q=85&s=7c7c7a0f8282bff9670d25e8a9f82071" alt="manage postgresql connect phpmyadmin 1" width="900" height="511" data-path="images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-180.png" />
</Frame>

4\. In the Create - Server dialog box that appears, type the server's name in the **General** tab and click **Save**.

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1046/Cf8gHikmtl4aL2hb/images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-190.png?fit=max&auto=format&n=Cf8gHikmtl4aL2hb&q=85&s=6acc97b4d905337294205ce73ac5d80e" alt="manage postgresql connect phpmyadmin 2" width="564" height="619" data-path="images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-190.png" />
</Frame>

5\. Go to the **Connection** tab and enter the host (endpoint,) port, username, and password in the relevant fields.

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1046/Cf8gHikmtl4aL2hb/images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-190.png?fit=max&auto=format&n=Cf8gHikmtl4aL2hb&q=85&s=6acc97b4d905337294205ce73ac5d80e" alt="manage postgresql connect phpmyadmin 3" width="564" height="619" data-path="images/docs/cloud/database-for-postgresql/manage-postgresql-servers/manage-postgresql-190.png" />
</Frame>

6\. Click **Save**.

7\. Locate the server you've added in the left-side menu and click it to access. For more details, refer to the [pgAdmin official documentation](https://www.pgadmin.org/docs/).
