Skip to content

Instantly share code, notes, and snippets.

@fgianoli
Last active December 11, 2020 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fgianoli/335b751f66f4811cd26be339f0c1960f to your computer and use it in GitHub Desktop.
Save fgianoli/335b751f66f4811cd26be339f0c1960f to your computer and use it in GitHub Desktop.

INSTALL POSTGRESQL AND POSTGIS

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment