Same quick notes on setting up a postgres database.
apt-get update apt-get install postgresql-9.5
mkdir /opt/data chown -R postgres:postgres /opt/data
/etc/postgresql/9.5/main/postgresql.conf
data_directory='/opt/data/pgdata' listen_addresses = '*' max_connections = 100 effective_cache_size = 2GB
/etc/postgresql/9.5/main/pg_hba.conf
host all all 0.0.0.0/0 md5
cd /usr/lib/postgresql/9.5/bin sudo -u postgres ./initdb /opt/data/pgdata/"
servcice restart postgresql