Part 01 / Topic 4 of 10
Installing PostgreSQL 17
This course uses PostgreSQL 17. Pick your operating system:
Windows
- Download the installer from postgresql.org/download/windows (the EDB installer) and run it.
- Keep the default components (PostgreSQL Server and the command line tools; pgAdmin is a useful extra).
- It will ask for a password for the
postgresuser — choose one and write it down. You will type it every time you connect. - Check: open SQL Shell (psql) from the Start menu, press Enter through the defaults, type your password. You should see a
postgres=#prompt.
macOS
- With Homebrew:
brew install postgresql@17, thenbrew services start postgresql@17. (No Homebrew? Use the installers listed at postgresql.org/download/macosx.) - Check: in Terminal,
psql --versionshould printpsql (PostgreSQL) 17.x. - Connect with
psql -d postgres.
Linux
- Your distribution's package usually works:
sudo apt install postgresql(Debian/Ubuntu) orsudo dnf install postgresql-server(Fedora). Version-specific packages are listed at postgresql.org/download/linux. - Debian/Ubuntu starts the server for you; Fedora needs
sudo postgresql-setup --initdbthensudo systemctl start postgresql. - Check:
sudo -u postgres psqlshould land you at apostgres=#prompt.
Prefer containers? The official image works well for a course setup too: docker run -d --name pg17 -e POSTGRES_PASSWORD=secret -p 5432:5432 postgres:17 and then docker exec -it pg17 psql -U postgres.
Done here? The practice set for Part 1 — 6 exercises with solutions — is on the part page.