- Install required dependencies
$ sudo apt install postgresql postgresql-contrib libpq-dev g++ make -y
- Initialize postgres service
$ sudo service postgresql start
- Connect to the postgres user, in case of error try the
$ psql -U postgres -w
- Set password
postgres=# \password postgres
- Create database
postgres=# CREATE DATABASE $DBNAME;
- Initialize database schema, copy all the content of the (SCHEMA)[./schema.sql]
- Initialize data runing the init-db npm script
$ npm run init-db
- Allow local connections from any user for postgres default user, replacing the XX with your currently installed postgres
$ sudo vim /etc/postgresql/XX/main/pg_hba.conf
- Replace the line containing local
all postgres peer
withall postgres trust
- Restart the postgres service
$ sudo service postgresql restart