Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save valeth/5df31b10b2ee88b9a94b10ee6f73bca5 to your computer and use it in GitHub Desktop.

Select an option

Save valeth/5df31b10b2ee88b9a94b10ee6f73bca5 to your computer and use it in GitHub Desktop.
PostgreSQL configuration without password on Ubuntu for Rails

Abstract

You could have postgres installed on localhost with password (or without user or password seted after instalation) but if we are developing we really don't need password, so configuring postgres server without password for all your rails project is usefull.

Install Postgres packages

  • postgresql
  • postgresql-client
  • libpq-dev

Install Postgres gem

# /Gemfile

gem 'pg'

Configuration

  1. Open postgres configuration file from the console

    gedit /etc/postgresql/POSTGRE_VERSION/main/pg_hba.conf

  2. Change all local configuration access to:

    local all postgres trust

  3. Restart postgres server

    sudo /etc/init.d/postgresql restart

  4. Enjoy :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment