Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8757781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:23:07+00:00 2026-06-13T14:23:07+00:00

I have installed Postgres App on my Mac and have a database running. I

  • 0

I have installed Postgres App on my Mac and have a database running.

I am able to connect it from the terminal by using the command psql -h localhost

Now I want to access this server from another machine which is on the same network.

When I do psql -h <hostname> -U <username> from the other machine, I get the error

psql: could not connect to server: Connection refused
    Is the server running on host "my hostname" (xx.xx.xx.xxx) and accepting
    TCP/IP connections on port 5432?

In the machine that runs the server I did lsof -i | grep LISTEN and I get the following result.

postgres  3196 sudarm    5u  IPv6 0x1caf6120      0t0  TCP localhost:5432 (LISTEN)
postgres  3196 sudarm    6u  IPv4 0x14678db0      0t0  TCP localhost:5432 (LISTEN)
postgres  3196 sudarm    7u  IPv6 0x1caf6a80      0t0  TCP localhost:5432 (LISTEN)

Do I have to do anything else to connect to the server from another machine?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T14:23:08+00:00Added an answer on June 13, 2026 at 2:23 pm

    The error message asks the right question: is the server accepting connections on port 5432? The lsof output you provided indicates that no, it is not. PostgreSQL is listening on localhost:5432, meaning it will only accept connections from the database server itself.

    Open the server’s postgresql.conf, set listen_addresses = '*', and restart PostgreSQL. It will then be listening for connections over all interfaces, thus accepting connections over the network.

    From here, the next problem you’re likely to run into is authentication. (PostgreSQL will accept connections, but you probably haven’t told it what to do once it has a connection from across the network.) Ensure the server’s pg_hba.conf has an entry matching your database/user/source address combination — something like host all all 10.0.0.0/8 md5 is probably appropriate — and reload PostgreSQL as necessary to apply changes.

    The md5 part tells PostgreSQL to attempt authentication using a password, so you will also need to set a password on the user in question if you don’t have one set already. From however you normally administer your database (e.g. psql template1 on the database server), say ALTER USER whomever WITH PASSWORD 'your_new_password'.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have installed Postgres in my machine, and I'm trying to connect to it
I have installed pyglet onto Mac OS X 10.7.4 using MacPorts. pyglet only works
Well, I have MAMP installed on my Mac OS X, and I've got PostGres
I have postgres database running on Amazon EC2 instance. I have few tablespaces created
I just installed Postgres.app on my Mac but it won't work properly. I finished
Having an issue with postgres.app where its installed, its running, but when I enter
I have just installed PostgreSQL 8.3.4 on Mac OS X 10.5 (using ports), but
I'm attempting to launch a GeoDjango app. I've installed Postgres & PostGIS using brew
Many months ago, I installed postgres 8.4 using the following command: $ sudo aptitude
I have installed my dependencies using bundle package Then transferred them to the offline

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.