Postgresql connection issues

I made a postgres instance on render and am trying to connect to my database externally, however I am getting this error

sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at “” (, port 5432 failed: Connection timed out (0x0000274C/10060)
Is the server running on that host and accepting TCP/IP connections?


If you’re connecting to a Postgres DB from outside Render, this is covered in the docs here:

You’d need to plug these details into SQLAlchemy. Which I think also requires the scheme to be postgresql:// (not postgres://). You’ll also need to ensure the SSL mode is set to true/require.

Lastly, ensure the Access Control settings on the database are set as expected, e.g. correct/valid IP range.


Thanks for the reply.
I have all of that setup already. How would I check/change the ssl mode? The Access control list i have right now is set to is that correct? would be correct to allow external access from any IP.

I’m not a SQLAlchemy user, but a quick search for SQLAlchemy SSL mode brought up this StackOverflow answer:

We’d suggest require over allow in the example.