Skip to content

Instantly share code, notes, and snippets.

View sprakash57's full-sized avatar
👨‍🔧
Working from Home

Sunny Prakash sprakash57

👨‍🔧
Working from Home
View GitHub Profile
@ZubinDv
ZubinDv / PSQL-WSL2-Setup.md
Last active April 20, 2024 17:46
PostgreSQL setup with WSL2

Install Postgresql

  • Download and Install binary executable [postgresql.exe] on windows (https://www.enterprisedb.com/downloads/postgres-postgresql-downloads) this will be the server for databases. Take note of the credentials for user [postgres] that you set during the installation, we will use this to connect from WSL in the end.
  • Install postgresql-client and associated libraries on WSL2:
sudo apt-get update
sudo apt-get install postgresql-client postgresql-client-common libpq-dev

Allow Windows defender firewall to recognize connections from WSL

  • Go to Windows defender firewall with Advanced Security on Windows.
  • Select Inbound Rules and create a new Rule.