0% found this document useful (0 votes)
4 views

PostgreSQL DevEnv Setup

This guide outlines the steps to set up a PostgreSQL Central Repository on a Windows server and configure Ubuntu clients for access. It includes instructions for server preparation, enabling remote access, client installation, database and user creation, and testing connections. Key tasks involve configuring PostgreSQL settings, firewall rules, and executing SQL commands for database management.

Uploaded by

baechaara
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

PostgreSQL DevEnv Setup

This guide outlines the steps to set up a PostgreSQL Central Repository on a Windows server and configure Ubuntu clients for access. It includes instructions for server preparation, enabling remote access, client installation, database and user creation, and testing connections. Key tasks involve configuring PostgreSQL settings, firewall rules, and executing SQL commands for database management.

Uploaded by

baechaara
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

PostgreSQL Central Repository Setup Guide

Step 1: Prepare the PostgreSQL Server (Windows PC)


1. Install Windows Server OS (2019 or 2022) on one of the PCs.

- Use a bootable USB or ISO image.

- During installation, assign a static IP address (e.g., 192.168.1.10).

2. Install PostgreSQL:

- Download installer from https://www.postgresql.org/download/windows/

- Choose components: PostgreSQL Server, pgAdmin (optional)

- Set port (default: 5432) and postgres user password

Step 2: Enable Remote Access


1. Edit postgresql.conf:

- Navigate to: C:\Program Files\PostgreSQL\<version>\data\postgresql.conf

- Change line: listen_addresses = '*'

2. Edit pg_hba.conf:

- Add: host all all 192.168.1.0/24 md5

3. Restart PostgreSQL service from Services.msc

4. Allow port 5432 through Windows Firewall:

- Run as admin: netsh advfirewall firewall add rule name="PostgreSQL" dir=in action=allow

protocol=TCP localport=5432

Step 3: Ubuntu Client Configuration


On each Ubuntu PC (9 clients):

1. Install PostgreSQL client:

sudo apt update

sudo apt install postgresql-client

2. Connect to server:

psql -h 192.168.1.10 -U postgres -d postgres

Step 4: Create Databases and Users


Login on the server using pgAdmin or psql and run:

CREATE DATABASE devdb1;

CREATE DATABASE devdb2;

CREATE DATABASE testdb;

CREATE USER devuser1 WITH PASSWORD 'StrongPass1';

CREATE USER devuser2 WITH PASSWORD 'StrongPass2';

GRANT ALL PRIVILEGES ON DATABASE devdb1 TO devuser1;

GRANT ALL PRIVILEGES ON DATABASE devdb2 TO devuser2;

Step 5: Test Connection


On Ubuntu clients, test access using:

psql -h 192.168.1.10 -U devuser1 -d devdb1

You might also like