Location of postgres db file for backup
To find out where the PostgreSQL data folder is located, just run SQL query:
show data_directory;

You can find more details here
However, note
File System Level Backup are faster but large in size. The worst thing is that to perform a database's backup, PostgreSQL Server required to be stopped. More information about the restrictions of this operation can be found in the official documentation. On my own I will add that from such backups, as a rule, there is more harm than good.
The main method for creating backups in PostgreSQL is the pg_dump utility.
pg_dump dbname &gt; dbname.dump

Opposite file-level backup, a backup via the pg_dump tool does not require stopping the server, it is easy to automate and does not require access to the server file system (it can be performed remotely).