Step1: add user as below:
Step2: Create Directory
mkdir –p /the/directory/for/data
yum install postgres*
initdb –D / the/directory/for/data
Step 5: Start service
Pg_ctl / the/directory/for/data logfile start
Step6: instead of starting like this we can also create a script in init.d file of linux to start this as a linux service.