Skip to content

Latest commit

 

History

History
76 lines (44 loc) · 2.21 KB

README_API_INSTALL_POSTGRES_LINUX.md

File metadata and controls

76 lines (44 loc) · 2.21 KB

README for API Installation: 1b. Installing PostgreSQL on Linux

Back to Install Table of Contents

Installing PostgreSQL on Linux

$ sudo apt-get install python-psycopg2 
$ sudo apt-get install python-dev
$ sudo apt-get install postgresql-client
$ sudo apt-get install postgresql postgresql-contrib
$ sudo -u postgres psql postgres
postgres=# \password postgres
(NOTE: We recommend using a very simple password like "123" since it is just local development)
postgres=# \q
$ sudo -u postgres createdb WeVoteServerDB

See here for more detailed instructions

Setup - Install pgAdmin 4

We recommend installing pgAdmin 4 as a WYSIWYG database administration tool. NOTE: You may need to turn off the restriction in "Security & Privacy" on "unidentified developers" to allow this tool to be installed. See: http://blog.tcs.de/program-cant-be-opened-because-it-is-from-an-unidentified-developer/

In pgadmin add a server. You can use your sign in name as the server name.

Open this file:

$ sudo vi /etc/postgres/9.6/main/pg_hba.conf

Change the line:

# Database administrative login by Unix domain socket
local   all             postgres                                peer

to

# Database administrative login by Unix domain socket
local   all             postgres                                trust

Now you should reload the server configuration changes and connect pgAdmin 4 to your PostgreSQL database server.

$ sudo /etc/init.d/postgresql reload

Open pgAdmin 4 and navigate to:

Server Groups > Servers
  1. Right-click on "Servers" and choose "Create > Server"

  2. Name: WeVoteServer

  3. Switch to "Connection" tab

3a) Host name: localhost

3b) Port: 5432

3c) Maintenance database: postgres

3d) User name: postgres

Create Database

If you do not see "WeVoteServerDB" in PGAdmin, try this command from your terminal window:

$ sudo -u postgres createdb WeVoteServerDB

NEXT: 2. Get WeVoteServer Code from Github

Working with WeVoteServer day-to-day

Back to Install Table of Contents