ECONNREFUSED [SequelizeConnectionRefusedError]

I am new to the process of setting up a server and connecting my database to it. What I am trying to do: I want to start running my node js application by using npm start.

The Problem: But I get this error:

error from routes.js ConnectionRefusedError [SequelizeConnectionRefusedError]: connect ECONNREFUSED . . . original: Error: connect ECONNREFUSED at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) { errno: ‘ECONNREFUSED’, code: ‘ECONNREFUSED’, syscall: ‘connect’, address: ‘’, port: 5432 }

To start running on the digital ocean IP address the replaced localhost with the ‘’.

My config file:

module.exports=new Sequelize(‘db_name’,‘user_name’,‘password’,{ host:‘’, dialect:‘postgres’, operatorAliases:false, pool:{ max:5, min:0, acquire:30000, idle:10000 }, });

Any good resources/tutorials would be a major help.

Thanks in advance


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi, I have a similar situation, have you fixed the error?

Hi there, I have the same problem “unable to join database connect ECONNREFUSED” Did you manage to resolve this issue?

I am using Putty to load my session and connect to it. It has a port number 22. Is that what I should be including in my host maybe?