Skip to content
  • Solutions
    By Role
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    By Infrastructure
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
  • Product
    • Plesk Features
    • Plesk Editions
    • What’s new
    • Pricing
    • Roadmap
    • Lifecycle Policy
    • Extensions Catalogue
  • Pricing
  • Extensions
    Featured Extensions
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    Bundles and packs:
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack

    See all Extensions

  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
Plesk 360 login
Free Trial

Knowledge Base

How to enable remote access to PostgreSQL databases hosted in Plesk

 
centosdatabasesdebianhostedip

Question

How to enable remote access to PostgreSQL databases hosted in Plesk?

Answer

 

For Plesk on CentOS/RHEL

 

  1. Connect to the Plesk server via SSH.

  2. Modify postgresql.conf:

    2.1. Open the file /var/lib/pgsql/data/postgresql.conf in a text editor. In this example, we are using the vi editor:

    # vi /var/lib/pgsql/data/postgresql.conf

    2.2. Add the following line at the end of the file:

    listen_addresses = '*'

    2.3. Save the changes and close the file.

  3. Modify pg_hba.conf:

    3.1. Open the file /var/lib/pgsql/data/pg_hba.conf in a text editor:

    # vi /var/lib/pgsql/data/pg_hba.conf

    3.2. Add the following line at the end of the file:

    host samerole all 203.0.113.2/32 md5

    where:

      • 203.0.113.2/32 - a remote IP address from which connection is allowed. To allow connections from any IP address, specify 0.0.0.0/0.
      • md5 - authentication method, which requires the client to supply a double-MD5-hashed password for authentication. To learn more about authentication methods, visit this PostgreSQL documentation page.

    3.3. Save the changes and close the file.

  4. Restart PostgreSQL service to apply the changes:

    # service postgresql restart

 

For Plesk on Debian/Ubuntu

 

  1. Connect to the Plesk server via SSH.

  2. Get PosgreSQL release version to identify the installation path:

    # psql -V
    psql (PostgreSQL) 14.5 (Ubuntu 14.5-0ubuntu0.22.04.1)

    In this example, PosgreSQL release version is 14, so the installation path will be /etc/postgresql/14/.

  3. Modify postgresql.conf:

    3.1. Open the file /etc/postgresql/14/main/postgresql.conf in a text editor. In this example, we are using the vi editor:

    # vi /etc/postgresql/14/main/postgresql.conf

    3.2. Add the following line at the end of the file:

    listen_addresses = '*'

    3.3. Save the changes and close the file.

  4. Modify pg_hba.conf:

    4.1. Open the file /etc/postgresql/14/main/pg_hba.conf in a text editor:

    # vi /etc/postgresql/14/main/pg_hba.conf

    4.2. Add the following line at the end of the file:

    host samerole all 203.0.113.2/32 md5

    where:

      • 203.0.113.2/32 - a remote IP address from which connection is allowed. To allow connections from any IP address, specify 0.0.0.0/0.
      • md5 - authentication method, which requires the client to supply a double-MD5-hashed password for authentication. To learn more about authentication methods, visit this PostgreSQL documentation page.

    4.3. Save the changes and close the file.

  5. Restart PostgreSQL service to apply the changes:

    # service postgresql restart

 

Tweet
Share
Share
Email
0 Shares
Read the full article
Related Posts

Full Site Check now scans for Google Fonts

Read More »

Recommended OSs for Plesk

Read More »

Server Management: IP Mapping Guideline

Read More »
Knowledge Base

Unable to copy/back up a database in Plesk: mysqldump: Error 2013: Lost connection to MySQL server during query when dumping table

Read More »

How to increase the MySQL/MariaDB max_connections value?

Read More »

How to change the innodb_log_file_size value in MySQL/MariaDB 10.5?

Read More »

How to enable the MySQL/MariaDB slow query log and analyze it on a Plesk for Linux server

Read More »

Hosting Wiki

  • RESTful Web Service
  • Server Redundancy
  • Cloud Service Architecture
  • Virtualizor
  • On-Demand Services
  • PostgreSQL
  • Bare Metal Server
  • Denial of Service
  • Red Hat Virtualization
  • Virtuozzo
  • Oracle VM Server
  • Citrix Hypervisor
  • Server Virtualization Software
  • Windows Server
  • Linux
  • Virtualization
  • JavaScript
  • SQL
  • VirtualMin
  • Plesk
  • Web Server
  • DNS Server
  • IPv6
  • IPv4
  • SIP
  • SSH
  • UDP/IP
  • Email Virus Protection
  • TCP/IP
X-twitter Linkedin Youtube Reddit Github
  • Product
  • Login
  • Pricing
  • Editions
  • For Partners
  • Partner Program
  • Contributor Program
  • Affiliate Program
  • Plesk University
  • Company
  • Blog
  • Careers
  • Events
  • About Plesk
  • Our Brand
  • Resources
  • User and Admin guides
  • Help Center
  • Migrate to Plesk
  • Contact Us
  • Hosting Wiki
  • Forum
  • Legal
  • Legal
  • Privacy Policy
  • Imprint

© 2025 WebPros International GmbH

Part of the WebPros®  Family