PostgreSQL

PostgreSQL & pgAdmin 4

curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add -
sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/focal pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list'
sudo apt update
sudo apt install pgadmin4
sudo /usr/pgadmin4/bin/setup-web.sh

pgagent

sudo apt-get update -y
sudo apt-get install -y pgagent
/usr/bin/pgagent host=0.0.0.0 port=33773 dbname=brick user=brick password=brick-demo

Docker

docker run -d \
--name pgadmin4 \
-p 5050:5050 \
-e 'PGADMIN_DEFAULT_EMAIL=admin@pgadmin.com' \
-e 'PGADMIN_DEFAULT_PASSWORD=postgres' \

Docker compose

version: '3'
services:

  postgres:
    image: postgres:latest
    restart: always
    ports:
      - '5432:5432'
    environment:
      POSTGRES_PASSWORD: postgres
      POSTGRES_USER: postgres
      POSTGRES_DB: postgres
    networks:
      - dtlab
    volumes:
      - postgres-storage:/var/lib/postgresql/data

  pgadmin:
    image: dpage/pgadmin4:latest
    restart: always
    environment:
      PGADMIN_DEFAULT_EMAIL: admin@pgadmin.com
      PGADMIN_DEFAULT_PASSWORD: postgres
      PGADMIN_LISTEN_PORT: 5050
    ports:
      - 5050:5050
    volumes:
      - pgadmin-storage:/var/lib/pgadmin
    networks:
      - dtlab
    depends_on:
      - postgres
    links:
      - postgres

networks:
  dtlab:
    driver: bridge

volumes:
  postgres-storage: {}
  pgadmin-storage: {}
Previous