# Backup/export docker volume to tar archive docker run --rm -v pgdata:/in -v ./:/out ubuntu tar cvf /out/pgdata.tar /in # Restore docker volume from tar archive docker run --rm -v pgdata:/out -v ./:/in ubuntu bash -c "cd /out && tar xvf /in/pgdata.tar"