...
Code Block |
---|
docker-compose up -d |
Configure Postgres Server
After the setup of the Postgres Server you need to configure the server to allow access from a remote workstation. There are two files that need changes:
configure access to the database
edit the file:
postgresql.conf
Linux:/etc/postgresql/{version}/main/postgresql.conf
MacOS:/usr/local/var/postgresql.conf
Windows:C:\Program Files\PostgreSQL\{version}\data\postgresql.conf
remove the # before the line:
listen_addresses = '*'
This allows access from all IP addresses.save the file
allow access from remote workstation
edit the file:
pg_hba.conf
Linux:/etc/postgresql/{version}/main/pg_hba.conf
MacOS:/usr/local/var/pg_hba.conf
Windows:C:\Program Files\PostgreSQL\{version}\data\pg_hba.conf
add this line to the block IPV4:
Code Block |
---|
# The same using a host name (would typically cover both IPv4 and IPv6). # TYPE DATABASE USER CIDR-ADDRESS METHOD host all all localhost trust host all all 0.0.0.0/0 trust |
Create Database User
You will need to create Create a User that can read/write the library information to the database.
pgAdmin4
Use the tool pgAdmin4 to view & edit your Database.
You can install the software on any workstation to access the Database server. When you start the application for the first time you have to set an master password - it’s only for your local workstation to access pgAdmin4.
...
Dashboard → Add New Server → input information (Host name/address, Username, Password)
...
Create a Database User to allow access the database.
...
The User needs permission/privileges to:
login
create databases
...
Troubleshooting
...
Edit pg_hba.conf and allow Users access the database.
File location pg_hba.conf
Windows: C:\Program Files\PostgreSQL\14\data\pg_hba.conf
MacOS: /usr/local/var/pg_hba.conf