Plain text format should work docker exec -i shared_postgres_instance pg_dump -U postgres -W scons_com_vn_production > ~/backup/scons_com_vn_production.sql docker exec -i shared_postgres_instance psql -U postgres scons_com_vn_prod -W < ~/backup/scons_com_vn_production.sql binary format (tar, gzip) won't work using pipe for backup, cp from container to host docker exec -i shared_postgres_instance bash -c 'pg_dump -U postgres -F t -W scons_com_vn_production > /scons_com_vn_production.tar' docker cp shared_postgres_instance:/scons_com_vn_production.tar ./scons_com_vn_production.tar cp to running container first, then restore docker cp ./scons_com_vn_production.tar shared_postgres_instance:/scons_com_vn_production.tar docker exec -i shared_postgres_instance pg_restore -U postgres -W -d scons_tar_test -v -c -Ft /scons_com_vn_production.tar