Skip to content

Instantly share code, notes, and snippets.

@jonpemby
Created December 13, 2018 01:11
Show Gist options
  • Save jonpemby/13befdc028e32cdd8f91134bfcc5ac0d to your computer and use it in GitHub Desktop.
Save jonpemby/13befdc028e32cdd8f91134bfcc5ac0d to your computer and use it in GitHub Desktop.
Set up Postgres on Ubuntu
sudo apt-get install wget ca-certificates
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
# Add repository
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
# Install
sudo apt-get update
sudo apt-get install postgresql postgresql-contrib
# Connect
sudo su - postgres
psql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment