# How to export PostgreSQL database

Source: https://www.hukot.net/community/en/tutorials/how-to-export-postgresql-database
Updated: 2026-11-25

If you need to back up or move a database, you'll need to create a database dump. You can create a database dump on our web hosting via SSH.

*You can find a guide on generating SSH keys and setting up SSH connections [here](https://www.hukot.net/community/en/tutorials/generate-ssh-key-and-setup-ssh-for-access-to-webhosting).*

After SSH connecting to web hosting, create a database dump using the following command:

`pg_dump -h localhost --clean -U %username% -f %filename%.dump -W %database%`

Subsequently, a file named **%filename%.dump** will be created in the current directory.

*This guide is also applicable to VPS and similar systems.*
