How To Install Pg_restore In Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian And MacOS?
Install pg_restore
-
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
Restore a PostgreSQL database from an archive file created by pg_dump.
How to use pg_restore?
Below are few example commands for pg_restore that you can use in the terminal.
Restore an archive into an existing database:pg_restore -d db_name archive_file.dumpClick to copySame as above, customize username:pg_restore -U username -d db_name archive_file.dumpClick to copySame as above, customize host and port:pg_restore -h host -p port -d db_name archive_file.dumpClick to copyClean database objects before creating them:pg_restore --clean -d db_name archive_file.dumpClick to copyUse multiple jobs to do the restoring:pg_restore -j 2 -d db_name archive_file.dumpClick to copy
To install the latest version of pg_restore in your favorite operating system just copy the pg_restore installation command from above and paste it into terminal. It will download and install the latest version of pg_restore 2026 package in your OS.




