Search code examples
pgadminpgadmin-4

How do I configure pgAdmin to use a fixed port?


pgAdmin4 starts on an unpredictable port. I would like to fix it so it always uses the same port.

According to the docs I can configure this through a plist file, but that file is overridden on starting pgAdmin4.

How can I specify a fixed port to run pgAdmin4 on?


Solution

  • It depends on the version you are using.

    v5.x

    Because of the change to a standalone application this setting is moved to:

    • Click on "File v" next to the pgAdmin logo in the top bar.
    • Click on "Runtime >" and "Configure..."
    • The first section is about "Fixed Port"

    v4.x

    • Click on the pgAdmin 4 tray-icon
    • Click "Configure..."
    • Check the box labeled "Fixed Port Number?"
    • Enter the desired port number in the field next to it

    Source: https://superuser.com/a/1476745/516502

    Note: Some version pre v4.26 had a bug where it ignored the value. This was fixed in v4.26 (issue #5773).