PostgreSQL no Debian

Instalação do PostgreSQL no Debian 12
Voltar

Passo a passo:

  1. sudo apt update && sudo apt install -y postgresql postgresql-contrib
  2. sudo systemctl start postgresql
  3. Criar acesso login: sudo passwd postgres
  4. Login: su -- postgres
  5. Acessar: psql
  6. Instalar pgAdmin4:
    
    1. Chave pública: curl -fsS https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo gpg --dearmor -o /usr/share/keyrings/packages-pgadmin-org.gpg
    2. Adicionar repositório: sudo sh -c 'echo "deb [signed-by=/usr/share/keyrings/packages-pgadmin-org.gpg] https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
    3. Instalar (Versões web e desktop): sudo apt install pgadmin4 (Ou 'sudo apt install pgadmin4-desktop' para somente desktop, ou 'sudo apt install pgadmin4-web' para somente web)
    4. Configurar pgAdmin web: sudo /usr/pgadmin4/bin/setup-web.sh
    5. Acessar pgAdmin web: No browser, acessar url 'localhost/pgadmin4'
    

Elaborado por Mateus Schwede
ubsocial.github.io