title: PgAdmin on Ubuntu 20.04 FATAL: password authentication failed for user
body: <p>I've installed Postgres and PGAdmin4 on Ubuntu 20.04, but I'm not able to create a server and connect to the database</p>
  <p><a href="https://i.stack.imgur.com/yaoHz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yaoHz.png" alt="enter image description here" /></a></p>
  <p>As I have seen in several solutions, I changed the method to md5 on my pg_hba.conf file</p>
  <pre><code># Database administrative login by Unix domain socket
  local   all             postgres                                md5
  
  # TYPE  DATABASE        USER            ADDRESS                 METHOD
  
  # &quot;local&quot; is for Unix domain socket connections only
  local   all             all                                     md5
  # IPv4 local connections:
  host    all             all             127.0.0.1/32            md5
  # IPv6 local connections:
  host    all             all             ::1/128                 md5
  </code></pre>
  <p>I have as well connected to psql, created new users, alter password and restart the server by running <code>sudo systemctl restart postgresql</code></p>
  <pre><code>                                   List of roles
   Role name |                         Attributes                         | Member of 
  -----------+------------------------------------------------------------+-----------
   postgres  | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
  </code></pre>
  <p>Any ideas?</p>