To Connect to the database in Docker psql -h localhost -p 5433 -U postgres -d mhst Back Up Data From Docker Container #Get postgres volume ID docker ps #create backup ( container must be running ) docker exec <id> pg_dump -U postgres mhst > backup.sql Write Data To Docker Container cat backup.sql | docker exec -i <id> psql -U postgres