title: How to configure postgresql server
body: <p>After recovering whole server files I can't connect my postgerSQL database. Following a lot of tutorials and answers on stackoverflow I had did some of steps to fix, but unfortunately I got the undermentioned:
  My postgresql server runs
  But I can't access via psql</p>
  
  <pre class="lang-none prettyprint-override"><code>$ sudo service postgresql start
  $ sudo service postgresql status
  
  ● postgresql.service - PostgreSQL RDBMS
  Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; ve
  Active: active (exited) since Fri 2019-08-30 15:09:21 UTC; 2s ago
  Process: 3669 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
  Main PID: 3669 (code=exited, status=0/SUCCESS)
  
  Aug 30 15:09:21 unicalkg systemd[1]: Starting PostgreSQL RDBMS...
  Aug 30 15:09:21 unicalkg systemd[1]: Started PostgreSQL RDBMS.
  
  $ sudo -u postgres psql
  
  psql: could not connect to server: No such file or directory
  Is the server running locally and accepting
  connections on Unix domain socket 
  "/var/run/postgresql/.s.PGSQL.5433"?
  
  $ pg_lsclusters
  
  Ver Cluster Port Status Owner     Data directory              Log 
  file
  10  main    5433 down   &lt;unknown&gt; /var/lib/postgresql/10/main 
  /var/log/postgresql/postgresql-10-main.log
  
  $ sudo systemctl start postgresql@10-main
  
  Job for postgresql@10-main.service failed because the service did 
  not take the steps required by its unit configuration.
  See "systemctl status postgresql@10-main.service" and "journalctl - 
  xe" for details.
  
  $ systemctl status postgresql@10-main.service
  
  postgresql@10-main.service - PostgreSQL Cluster 10-main
  Loaded: loaded (/lib/systemd/system/postgresql@.service; indirect; 
  Active: failed (Result: protocol) since Sat 2019-08-31 13:04:16 UTC
  Process: 15725 ExecStart=/usr/bin/pg_ctlcluster --skip-systemctl-red
  lines
  </code></pre>
  
  <p>Please help me with my problem.</p>