Database error: dial tcp [::1]:5432: connect: connection refused”

I’m following this tutorial https://www.thethingsnetwork.org/forum/t/private-network-without-internet/13365/38 to install Lora server and Lora app server on RPI3:

When I installed the lora server I managed to get it worked without any errors.

I did the following:

vi /etc/default/loraserver
POSTGRES_DSN=postgres://loraserver_ns:dbpassword@localhost/loraserver_ns?sslmode=disable

vi /etc/postgresql/9.5/main/postgresql.conf
listen_addresses = ‘localhost’

Change it to this:

listen_addresses = ‘*’

vi /etc/postgresql/9.5/main/pg_hba.conf . // add at bottom
host all all 0.0.0.0/0 md5
host all all ::/0 md5

After that I tried to install the lora app server and I changed the following in the lora-app-server.toml:

dsn=“postgres://loraserver_as:dbpassword@localhost/loraserver_as?sslmod=disable”

jwt_secret=“abc”

Then I started the both servers and then run the command to show the logs for both:

journalctl -u loraserver -f -n 50

journalctl -u lora-app-server -f -n 50

and the output log for both was:

Jan 09 05:05:12 raspberrypi loraserver[28864]: time=“2019-01-09T05:05:12-10:00” level=error msg=“ping database error, will retry in 2s: dial tcp [::1]:5432: connect: connection refused”
Jan 09 05:05:14 raspberrypi loraserver[28864]: time=“2019-01-09T05:05:14-10:00” level=error msg=“ping database error, will retry in 2s: dial tcp [::1]:5432: connect: connection refused”

What I did wrong and how I can solve this.

I went through a lot of issues but nothing works with me .

your help will be appreciated.

Thank you.

dial tcp [::1]:5432: connect: connection refused”

LoRa Server can’t connect to the PostgreSQL database. Please make sure it is up and running.

Thank you brocaar.for your quick reply

I’ve already managed to solve the problem.

But, I want to ask what should I do next? and what about the self signed certificate? confirm that I have functional LoRaWAN Server. Should I login to the LoRa App Server WEB UI by navigating to https://:8080/. Username is admin and Password is admin? I tried already and it’s not working.

Thank you

Thank you. I figured out.

how did you solve your issue?
dial tcp [::1]:5432: connect: connection refused”