Install PostgreSQL on Ubuntu/Debian and start the service.

Install PostgreSQL

sudo apt install postgresql postgresql-contrib

Start the service

sudo systemctl start postgresql.service

Enable the service

sudo systemctl enable postgresql.service

Switch to the default postgres user

sudo su - postgres

Optional:

Install postgis sudo apt install postgresql-13-postgis