Does the /etc/postgresql/9.6/main/postgresql.conf
show that port being assigned? On my default Xubuntu Linux install, mine showed port = 5433 for some reason as best as I can remember, but I did comment out the line in that same file that said listen_addresses = 'localhost'
and uncommented the line listen_addresses = '*'
. So maybe start and check there. Hope that helps.