The following commands will help you quickly install Postgresql latest version 13 or a custom version on your Ubuntu/Debian machine
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - sudo apt-get update # If you want a specific version, use 'postgresql-12' or similar instead of 'postgresql': sudo apt-get -y install postgresql
Of course you can also install some other packages that would help during software development or usage:
postgresql-client-12 : client libraries and client binaries
postgresql-contrib-9.x : additional supplied modules (part of the postgresql-xx package in version 10 and later)
libpq-dev : libraries and headers for C language frontend development
postgresql-server-dev-12 : libraries and headers for C language backend development
pgadmin4 : pgAdmin 4 graphical administration utility