The offical Ubuntu guide can be a little confusing.
Here are the correct steps in order to set up a local postgresql database server.
sudo apt install postgresqlsudo service postgresql startsudo su - postgres-
createuser --superuser $USERwhere $USER is your username psql-
\password $USERis typed into the psql console to set up your account. -
\qto exit -
createdb $USERby convention -
exitand now you can runpsqlin your own console with your username.