I have a server with Postgresql. I don't have access to this server, just the endpoint to connect with psql. I want to backup data from this server to another server using pg_dump. However, my second server does not have postgresql and I don't have root privilege to install it either. Is there any way to run pg_dump without install postgresql?

It is possible to install postgresql on my client and pg_dump from it but I'm afraid the database is too big for my laptop.

  • 1
    if you install on your client you can still direct the dump save to a different server as long as you have write permissions
    – indiri
    Commented Dec 13, 2017 at 16:18

4 Answers 4


Basically we don't need any Postgresql server to take the backup. Postgresql client is enough for this.

But you must have sudo privilege to install this client.

For Ubuntu:

echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" >>  /etc/apt/sources.list.d/pgdg.list
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
sudo apt-get install wget ca-certificates
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-client

For RedHat/CentOS/Amazon Linux:

Download the rpm here: https://yum.postgresql.org/repopackages.php#pg96

yum install postgresql 

Dump the Database

pg_dump -h remote_address -U username -D dbname -Fp > backup.sql

enter image description here

More about Pg_dump:



It is possible to install postgresql on my client and pg_dump from it but I'm afraid the database is too big for my laptop.

Sure, pg_dump is just a program. You can download it or build it seperate from the others, also check out the -c option to --format=format if space is an issue

c custom Output a custom-format archive suitable for input into pg_restore. Together with the directory output format, this is the most flexible output format in that it allows manual selection and reordering of archived items during restore. This format is also compressed by default.


For Windows

Just download the version you need here

It is not necessary to extract all data from the archive, it takes up a lot of space. It will be enough to unzip the \pgsql\bin directory, it will contain pg_dump.exe

To connect to a remote host use the --host parameter

Also, to simplify the work with pg_dump, I recommend adding the unzipped bin directory to the PATH environment variable. You can see how to do this here.


I want to backup data from this server to another server ... my second server does not have postgresql ...

What are you hoping to do with the data once you get it onto the new machine?

Clearly, you're not duplicating the database, because you have no DBMS on the new machine to run it. Therefore, a backup of the database will be of limited use to you.

I think you need to talk to those responsible for this database and get their take on the best to achieve what you need - whatever that might be.

  • As always, before /storing/ any Data in any format, you should be asking how that data is going to be /used/!
    – Phill W.
    Commented Apr 2 at 10:05
  • Decommissioning a server means the Data has already been migrated to another server or you need to archive the Data for /possible/ use later. If that happens, it will be restored onto a database server of the same or a compatible, later version. Perfectly reasonable use cases but, in both instances, the "second server" /will/ have PostgreSQL on it, which you originally indicated was not the case. Just as long as they don't come back in six month's time saying "We want to load that old Data into Oracle").
    – Phill W.
    Commented Apr 3 at 13:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.