Download link: https://www.postgresql.org/download/Click
on the corresponding operating system, and then you will enter different pages.
If it is a Windows system or a Mac system, you may enter a new page and click the link in the box:
Taking Windows as an example, after downloading the installation package, click Run directly, and then keep clicking Next.
Note that it is recommended to select all tools here, including command line tools and graphical interfaces. If you do not select pgAdmin4, it does not include graphical interfaces and only includes command line tools.
If it is a Linux system, you will be asked to specifically choose between Ubuntu, Debian, etc. If you click on it, there will be step-by-step prompts. Generally, you can use the command line. Take Ubuntu as an example:
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
sudo apt-get -y install postgresql
Debian
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
sudo apt-get -y install postgresql
Centos
sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
sudo yum install -y postgresql14-server
sudo /usr/pgsql-14/bin/postgresql-14-setup initdb
sudo systemctl enable postgresql-14
sudo systemctl start postgresql-14
If you want to install through source code, please read this article:
PostgreSQL source code learning - win10 source code compilation and installation.
If you want to install through source code in a non-Windows environment, please read this article:
PostgreSQL official documentation