pgAdmin disable login dialog / automatic login

Viewed 931

I'm running pgAdmin using docker-compose with the following script:

version: "3.9"
services:
  postgres:
    image: "postgres:13"
    container_name: "postgres"
    environment:
      POSTGRES_PASSWORD: pwd
    ports:
      - "5432:5432"
    volumes:
      - ./initdb:/docker-entrypoint-initdb.d
  pgadmin:
    image: "dpage/pgadmin4"
    container_name: "pgadmin"
    environment:
      PGADMIN_DEFAULT_EMAIL: pgadmin@mycomp.com
      PGADMIN_DEFAULT_PASSWORD: secret
    links:
      - postgres:postgres
    ports:
      - 5050:80

The script uses PGADMIN_DEFAULT_EMAIL and PGADMIN_DEFAULT_PASSWORD to change the default pgAdmin credentials.

However, as I'm running this docker instance on a development machine, I would like to auto-login into pgAdmin.

Is it possible to disable the login / automatically login?

1 Answers

You have to set SERVER_MODE parameter to False on your development machine. Due to documentation you should use PGADMIN_CONFIG_SERVER_MODE in your docker-compose.yml:

version: "3.9"
services:
  postgres:
    image: "postgres:13"
    container_name: "postgres"
    environment:
      POSTGRES_PASSWORD: pwd
    ports:
      - "5432:5432"
    volumes:
      - ./initdb:/docker-entrypoint-initdb.d
  pgadmin:
    image: "dpage/pgadmin4"
    container_name: "pgadmin"
    environment:
      PGADMIN_DEFAULT_EMAIL: pgadmin@mycomp.com
      PGADMIN_DEFAULT_PASSWORD: secret
      PGADMIN_CONFIG_SERVER_MODE: 'False'
    links:
      - postgres:postgres
    ports:
      - 5050:80

Now if you have a problem with the missing crypt key, you can disable MASTER_PASSWORD by specifying this parameter:

PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED: 'False'
Related