Created
September 1, 2016 11:05
-
-
Save clzola/8184821f146b18e1120437abaea331db to your computer and use it in GitHub Desktop.
How to install PostgreSQL + PostGIS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install Postgresql | |
sudo apt-get install -y postgresql postgresql-contrib | |
# Create a database and a user to access it | |
# this will prompt you for a database password | |
sudo -u postgres createuser -P USER_NAME_HERE | |
sudo -u postgres createdb -O USER_NAME_HERE DATABASE_NAME_HERE | |
# Test connecting to Postgresql | |
psql -h localhost -U USER_NAME_HERE DATABASE_NAME_HERE | |
# Add PostGIS support to the database | |
sudo apt-get install -y postgis postgresql-9.3-postgis-2.1 | |
sudo -u postgres psql -c "CREATE EXTENSION postgis; CREATE EXTENSION postgis_topology;" DATABASE_NAME_HERE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment