The is the tutorial for setting up Postgres Point In Time Recovery(PITR). This has been tried and tested on Postgres Server version 9.5 and Ubuntu 16.04. For other version of postgres server the steps should be similar.
First edit the postgresql.conf and make the below changers.
wal_level=logical
archive_mode=on