Installation varies by operating system, but on Ubuntu, you can use sudo apt-get install postgresql, and on macOS, brew install postgresql. Ensure you follow the official documentation for your specific environment.