Course map
Stage 1: Foundation
Stage 2: Intermediate
Stage 3: Advanced
Stage 4: Performance & internals
Stage 5: Specialization

Part 01 / Topic 4 of 10

Installing PostgreSQL 17

This course uses PostgreSQL 17. Pick your operating system:

Windows
  1. Download the installer from postgresql.org/download/windows (the EDB installer) and run it.
  2. Keep the default components (PostgreSQL Server and the command line tools; pgAdmin is a useful extra).
  3. It will ask for a password for the postgres user — choose one and write it down. You will type it every time you connect.
  4. Check: open SQL Shell (psql) from the Start menu, press Enter through the defaults, type your password. You should see a postgres=# prompt.
macOS
  1. With Homebrew: brew install postgresql@17, then brew services start postgresql@17. (No Homebrew? Use the installers listed at postgresql.org/download/macosx.)
  2. Check: in Terminal, psql --version should print psql (PostgreSQL) 17.x.
  3. Connect with psql -d postgres.
Linux
  1. Your distribution's package usually works: sudo apt install postgresql (Debian/Ubuntu) or sudo dnf install postgresql-server (Fedora). Version-specific packages are listed at postgresql.org/download/linux.
  2. Debian/Ubuntu starts the server for you; Fedora needs sudo postgresql-setup --initdb then sudo systemctl start postgresql.
  3. Check: sudo -u postgres psql should land you at a postgres=# 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.

Search the guide