24

When starting pgAdmin, I'm prompted:

Please set a master password for pgAdmin

This is a new feature of pgAdmin4 4.7: https://www.pgadmin.org/docs/pgadmin4/dev/release_notes_4_7.html

How can I disable this?

The local documentation tells me to set the "configuration parameter" MASTER_PASSWORD_REQUIRED=False, but I don't know where/how to do this: http://127.0.0.1:37059/help/help/master_password.html

Thomas Landauer
  • 821
  • 2
  • 8
  • 15

2 Answers2

30

Took me a while to find out, that's why I'm posting it here:

  1. You need to locate a file named config.py. In my case it's at /usr/share/pgadmin4/web/config.py
  2. Now create a file config_local.py (in the same folder) and enter: MASTER_PASSWORD_REQUIRED=False
  3. Restart pgAdmin server.
  4. The prompt should be gone :-)

Some reference about config files: https://www.pgadmin.org/docs/pgadmin4/dev/desktop_deployment.html#configuration

EDIT: It looks like in higher versions (I now have pgAdmin4 4.26) the directory changed to /usr/pgadmin4/web/

Thomas Landauer
  • 821
  • 2
  • 8
  • 15
  • 2
    For anyone that needs to do this on a machine on which they don't have root access, I would like to add that you could put this file in for example `~/.config/pgadmin` and then add this directory to the Python path setting in `~/.config/pgadmin/pgadmin4.conf`, something like `PythonPath=/home/«username»/.config/pgadmin:/usr/local/lib/python3/dist-packages:/usr/lib/python3/dist-packages` – RolKau Jun 18 '19 at 21:47
  • Works on Windows too. – MarioVW Nov 12 '19 at 00:02
  • 2
    Does anyone know which directory this should be in on Windows? – James Nov 27 '19 at 22:05
  • Same here, I can't find it on Windows, I went in Program Files, AppData and Registry editor. Nada – Jérôme MEVEL Feb 05 '20 at 15:25
  • 3
    If you download the macOS App Bundle, go to pgAdmin 4 in your Applications folder, and right click to select Show Package Contents. `config.py` should be in `Contents/Resources/web/`. Find the line with `MASTER_PASSWORD_REQUIRED=True`, and change it to `False`. – amball Dec 30 '20 at 17:28
  • Maybe it's important to set `ALLOW_SAVE_PASSWORD = False` too? The documentation [explains](https://www.pgadmin.org/docs/pgadmin4/development/master_password.html) why it's not a very good idea to save passwords without a master password set. – jrh Feb 28 '21 at 18:45
  • Thanks, on Ubuntu 22.04, create a file at this location /usr/pgadmin4/web/config_local.py and set MASTER_PASSWORD_REQUIRED=False then restart pgadmin4. – Bằng Rikimaru Aug 23 '23 at 06:46
11

For those on windows, the config.py is located under

C:\Program Files\PostgreSQL\12\pgAdmin 4\web

or

C:\Program Files (x86)\pgAdmin 4\v4\web

Create config_local.py inside of that folder

yujinyuz
  • 111
  • 1
  • 3
  • If you're on Windows, this is where the file is located now. Don't waste your time looking in the AppData folder as other answers to this problem suggest. If you have Postgres 14 , then the updated location would be `C:\Program Files\PostgreSQL\14\pgAdmin 4\web` – Jason L. Nov 05 '21 at 13:45