Install Pg_dump On A Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian And MacOS

Install Pg_dump On A Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian And MacOS

pg_dump

Extract a PostgreSQL database into a script file or other archive file.

Install pg_dump

  • Debian apt-get install postgresql-client-9.1 Click to copy
  • Ubuntu apt-get install postgresql-client-9.3 Click to copy
  • Alpine OS apk add postgresql Click to copy
  • Arch Linux pacman -S postgresql-old-upgrade Click to copy
  • Kali Linux apt-get install postgresql-client-11 Click to copy
  • CentOS yum install postgresql Click to copy
  • Fedora dnf install postgresql Click to copy
  • Raspbian apt-get install postgresql-client-9.5 Click to copy
  • macOS brew install postgresql Click to copy

Extract a PostgreSQL database into a script file or other archive file.

How to use pg_dump?

Below are few example commands for pg_dump that you can use in the terminal.

Dump database into a SQL-script file:
pg_dump db_name > output_file.sqlClick to copy
Same as above, customize username:
pg_dump -U username db_name > output_file.sqlClick to copy
Same as above, customize host and port:
pg_dump -h host -p port db_name > output_file.sqlClick to copy
Dump a database into a custom-format archive file:
pg_dump -Fc db_name > output_file.dumpClick to copy
Installing pg_dump command is simple. just copy one of the above commands for your operating system and paste it into terminal. This command is available for Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian and macOS operating systems. Once you run the command it will install the latest version of pg_dump 2026 package in your OS.