Skip to main content

Set up PostgreSQL database

Rell requires PostgreSQL 16.3. The IDE can work without it but can't run a node. A console or a remote postchain app can run without a database.

The default database configuration for Rell is:

  • database: postchain
  • user: postchain
  • password: postchain

Install

  1. Install Homebrew: Homebrew installation guide

  2. Install PostgreSQL:

    brew install postgresql@16
    brew services start postgresql@16
    createuser -s postgres
  3. Prepare the PostgreSQL database:

    psql -U postgres -c "CREATE DATABASE postchain WITH TEMPLATE = template0 LC_COLLATE = 'C.UTF-8' LC_CTYPE = 'C.UTF-8' ENCODING 'UTF-8';" -c "CREATE ROLE postchain LOGIN ENCRYPTED PASSWORD 'postchain'; GRANT ALL ON DATABASE postchain TO postchain;"
    note

    If you get an error saying peer authentication failed, you must change the authentication method from peer to md5. You can change it in the pg_hba.conf file of your psql database.