Install Pg_dump On A Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian And MacOS
Install pg_dump
-
Debian
apt-get install postgresql-client-9.1Click to copy -
Ubuntu
apt-get install postgresql-client-9.3Click to copy -
Alpine OS
apk add postgresqlClick to copy -
Arch Linux
pacman -S postgresql-old-upgradeClick to copy -
Kali Linux
apt-get install postgresql-client-11Click to copy -
CentOS
yum install postgresqlClick to copy -
Fedora
dnf install postgresqlClick to copy -
Raspbian
apt-get install postgresql-client-9.5Click to copy -
macOS
brew install postgresqlClick 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 copySame as above, customize username:pg_dump -U username db_name > output_file.sqlClick to copySame as above, customize host and port:pg_dump -h host -p port db_name > output_file.sqlClick to copyDump 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.




