Connect your deployed PostgreSQL database to pgAdmin

Pasindu Chamod Madusha
3 min readFeb 10, 2024

--

Have you ever wondered how to seamlessly manage your data or create tables in your deployed database, just like you do on your local server? Well, it’s possible, and I’m here to guide you through the process.

First things first, you’ll need to deploy your database onto a server. Whether you choose Render, AWS, or any other resource, the steps remain relatively similar. If you’re facing any hurdles during this stage, don’t worryI’ve got a separate article covering the deployment process in detail.https://medium.com/@epcm18/deploying-a-postgresql-database-on-render-80b6115785a1

For this demonstration, I’ll be using PostgreSQL as my database of choice, deployed on Render. Once your database is up and running, it’s time to connect it to pgAdmin for streamlined management. Let’s dive in.

To begin, head over to your deployment service provider’s dashboard. Once there, navigate to the section dedicated to managing your database deployments. Here’s an example of how it appears in Render:

Render Dashboard

After accessing the deployment section, you’ll find information related to your database deployments. Scroll down until you reach the section labeled “Connections.” Here, you’ll encounter a couple of URLs. Simply copy the external URL provided in this section.

Setting Up pgAdmin

Now, launch pgAdmin on your local device. From the top bar menu, navigate to the “Object” menu. Then, select “Create” and choose “Server Group” from the dropdown.

paAdmin Dashboard

You’ll encounter a popup prompting you to assign a name to your server group. Once you’ve provided a name, the newly created server group will appear in the left column of the pgAdmin dashboard.

New Server Group

Next, right-click on the server group you just created, then select “Refresh” from the dropdown menu. After that, click on “Server” from the options presented. This action will trigger a new popup where you can input the necessary data to connect to your database. Enter a name for your server and then go to the “connection” tab.

Create New Server

In the connection tab, you’ll require the URL copied from your deployed database. This URL can be divided into several parts: postgres://username:password@hostname/db-region-postgres.render.com/Database. From this link, exclude the hostname/db-region-postgres.render.com section and paste it into the "Host name/address" field. Set the port to 5432. For the "Maintenance Database," copy the database name part from the URL. Use your username for the "Username" field, and for the "Password," simply copy it from your dashboard.

Configuration

Now, navigate to the “Parameters” tab. Here, locate the “SSL mode” option and set it to “require”.

Parameters Setting-up

Click “Save,” and your new database server will be created. You’ll notice that the new database also appears when you expand the left column under the deployment server group. From here, you can create and edit data entities just as you would with your local database. If somehow this gives you an error just set “SSL mode” to “prefer”.

--

--