Tutorials for this topic
Install PostgreSQL on Ubuntu/Debian, create a database user and database, local access, and basic hardening for your applications.