Skip to content

Instantly share code, notes, and snippets.

@vinnycrazzy
Forked from ismarsantos/pgadmin.txt
Created August 18, 2021 21:20
Show Gist options
  • Save vinnycrazzy/5f1f61df5614c392ffb08b7c1a19fb8d to your computer and use it in GitHub Desktop.
Save vinnycrazzy/5f1f61df5614c392ffb08b7c1a19fb8d to your computer and use it in GitHub Desktop.
Connect PgAdmin4 on WSL2 Ubuntu 20.04.3 LTS
sudo -u postgres psql -c 'SHOW config_file'
sudo nano /etc/postgresql/13/main/postgresql.conf
# uncomment line 59:
#------------------------------------------------------------------------------
# CONNECTIONS AND AUTHENTICATION
#------------------------------------------------------------------------------
# - Connection Settings -
listen_addresses = 'localhost' # what IP address(es) to listen on;
#------------------------------------------------------------------------------
# Save file and restart
sudo service postgresql stop
sudo service postgresql start
# https://www.pgadmin.org/download/pgadmin-4-windows/
# Download it here and install it.
# In the popup Create — Server window:
# General tab: I set Name to test
# Connection tab: I set Host name/address to 127.0.0.1 (Note: some post said you can set it as localhost, but it causes errors for me)
# port:5432
# Leave maintenance database and Username as default postgres
# Password: whatever password you set up earlier for PostgreSQL in WSL 2, click Save password
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment