Check version
SELECT version();
PostgreSQL 12.4 (Ubuntu 12.4-1.pgdg18.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, 64-bit
sudo nano /etc/postgresql/12/main/pg_hba.conf
Add the following lines
# Open access
host all all 0.0.0.0/0 md5
sudo service postgresql@12-main restart