Search code examples
postgresqlpgadmin-4

How to access PgAdmin4 in web browser?


I installed the latest version of PgAdmin4 and when I opened it, it started as a separate desktop application rather than opening in my default web browser. I want to open the PostgreSQL in my web browser. How do I do that?
Steps I tried and failed are:

  1. Created a server and then a db with localhost:5432 as address
  2. Tried to open the address localhost:5432 on browser

Am I doing the right steps?

enter image description here


Solution

  • If you're using the desktop version of pgAdmin 4 greater than version 5, you can check the PGADMIN_INT_KEY variable in your runtime and use it to "authenticate" when you open it in a webbrowser

    The steps would go:

    1. Open PgAdmin 4; in my case the latest is v8
    2. Open the dialog File > Runtime > View log
    3. Copy the UUID used as PGADMIN_INT_KEY
    4. Check the PGADMIN_INT_PORT; default is 5050 in v8.
    5. Open your webbrowser of choice to localhost:<PGADMIN_INT_PORT>/?key=<PGADMIN_INIT_KEY>

    End result would look like:

    127.0.0.1:5050/?key=f8ac101a-c1da-46b3-84f6-76e7f9375be3

    You can bookmark that address in your browser for however many windows you'd want to use, but that will only work on each time that you start the pgAdmin session.

    Or potentially, you'd have to set it to run on server mode, but I wouldn't know the details of how to get that to work.