> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superjoin.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Whitelist an IP Address in PostgreSQL Server?

> A guide to whitelist Superjoin's IP address in your PostgreSQL server for access.

<Note>
  Superjoin’s IP Addresses are (3.6.225.10, 13.205.69.7 and 13.204.201.25). Whitelist all three IP Addresses in your database and allow TCP/IP connection from this IP in your
  firewall.
</Note>

## What is "Whitelisting"?

Think of your database like a private party. The "whitelist" is your guest list. Only the IP addresses (unique identifiers for computers on the internet) on this list can "enter the party," i.e., connect to your database. IPs not on the list will receive the metaphorical "you're not on the list" and cannot connect.

## Step by Step Guide to IP Whitelisting in your PostgreSQL DB

<AccordionGroup>
  <Accordion title="#1 Speak to your IT Admin">
    If you're not hands-on with database management, contacting your IT admin is the best approach

    <Steps>
      <Step title="Provide the IP">Share Superjoin's IP addresses (3.6.225.10, 13.205.69.7, 13.204.201.25) with your admin.</Step>
      <Step title="Request Whitelisting">Ask them to whitelist this IP for your database access.</Step>
      <Step title="Test the Connection">Once whitelisted, connect your database in your Superjoin account to confirm everything is set up correctly.</Step>
      <Step title="Reach Out for Support">If you've tried the above steps and still facing issues, don't hesitate to contact us at [support@superjoin.ai](mailto:support@superjoin.ai). We will respond immediately.</Step>
    </Steps>
  </Accordion>

  <Accordion title="#2 Whitelist it yourself" defaultOpen="true">
    If you're ready to handle this yourself, here’s how you can whitelist IP addresses for PostgreSQL.

    <iframe width="560" height="415" src="https://www.youtube.com/embed/-EVGru4BQ8E?si=kdpSDKckeQG28JuC" title="Error: Connection Refused - While connecting MySQL/PostgreSQL to Google Sheet" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowFullScreen style={{ width: "100%", borderRadius: "0.5rem" }} />

    ## Solution

    <Steps>
      <Step title="SSH Into Your Server">Use SSH to access your server where PostgreSQL is hosted.</Step>
      <Step title="Edit pg_hba.conf">Open the file located under `/etc/postgresql/[version]/main/`. For each IP (3.6.225.10, 13.205.69.7 and 13.204.201.25), add a line `host all all <IP_ADDRESS>/32 md5`. Save and close.</Step>
      <Step title="Edit postgresql.conf">Open the file located under `/etc/postgresql/[version]/main/`. Locate the line where listen\_addresses is mentioned and add our ip address in it in the following manner - the resultant should look like `listen_addresses = '3.6.225.10,13.205.69.7,13.204.201.25'`</Step>
      <Step title="Restart PostgreSQL">`sudo service postgresql restart` ensures your settings take effect.</Step>
      <Step title="Reach Out for Support">If you've tried the above steps and still facing issues, don't hesitate to contact us at [support@superjoin.ai](mailto:support@superjoin.ai). We will respond immediately.</Step>
    </Steps>
  </Accordion>

  <Accordion title="#3 Whitelist in Google Cloud (Cloud SQL)" defaultOpen="true">
    <Steps>
      <Step title="Navigate to Google Cloud Console">Go to the SQL section and select your instance.</Step>
      <Step title="Authorize Networks">Edit settings and under Authorized Networks, add Superjoin's IP addresses 3.6.225.10, 13.205.69.7 and 13.204.201.25. Save your changes.</Step>
      <Step title="Reach Out for Support">If you've tried the above steps and still facing issues, don't hesitate to contact us at [support@superjoin.ai](mailto:support@superjoin.ai). We will respond immediately.</Step>
    </Steps>
  </Accordion>
</AccordionGroup>

## AWS Whitelisting

<CardGroup cols={1}>
  <Card title="Looking to whitelist in AWS?" icon="life-ring" iconType="duotone" href="../rds/ip-whitelisting">
    Head over to the IP Whitelisting in AWS page to get a step by step troubleshooting guide.
  </Card>
</CardGroup>

<Info>
  Whitelisting an IP for your PostgreSQL database doesn't just bolster security—it ensures that only authorized locations can access your
  data. Whether you choose to manage this process yourself or coordinate with IT professionals, ensuring your database's security is
  crucial. Remember, if you're ever unsure, consulting with an expert is always a wise decision. Happy data managing!
</Info>
