https://www.vultr.com/docs/install-the-postgis-extension-for-postgresql-on-ubuntu-linux
Install Postgres 12
sudo apt -y install postgresql-12 postgresql-client-12
sudo apt install postgis postgresql-12-postgis-3
sudo apt install postgresql-12-postgis-3-scripts
Create User
su - postgres
createuser --interactive --pwprompt
Replace user with the name of the user that you want to own the database, and replace dbname with the name of the database that you want to create: example: createdb -O pippo pippoDB
createdb -O user dbname
edit pg settings
cd etc/postgresql/12/main
nano pg_hba.conf
add:
host all all 0.0.0.0/0 md5
edit pg configuration file
nano postgresql.conf
add IP address of the server:
listen_addresses = 'localhost, *'
Reboot postgres
service postgresql restart