The main steps are the following (details below---this steps are general and should be useful also for operating system different from ubuntu, e.g., Windows and Mac OS): (1) install postgresql (a database and a user are created, both named "postgres") (2) assign a password (e.g., "postgres") to the "postgres" user (3) install pgadmin, preferably version 3 (this is not strictly necessary but it is much more user-friendly to use pgadmin to connect to the postgres server than the command-line client "psql") (4) add a connection to the postgresql server inside pgadmin ================================================================================ In what follows, some more detailed instructions about some of the steps above. Most of the these instructions are specific for ubuntu-like operating systems ------------------------------ Step 1: install postgres ------------------------------ - use the following command: sudo apt-get install postgresql postgresql-contrib postgresql-common ------------------------------ Step 2: set-up postgres (assign a password to the "postgres" user) ------------------------------ - use the following command to launch the "psql" client: sudo -u postgres psql - when inside the "psql" client execute the following instruction: ALTER USER postgres PASSWORD 'postgres'; - to exit the "psql" client execute the following instruction: \q ------------------------------ Step 3: install pgadmin, preferably version 3 ------------------------------ - use the following command: sudo apt install pgadmin3 ------------------------------ Step 4: add a connection to the postgresql server inside pgadmin ------------------------------ - click on the button in the top-left corner ("Add a connection to a server") - in the "New Server Registration" window, add the following data: -- Name: -- Host: 127.0.0.1 -- Port: 5432 -- Maintenance DB: postgres -- Username: postgres -- Password: postgres and then click "OK" - if a "Saving passwords" warning appears, just click "OK" - if a new window appears asking to fix some issues related to some missing packages, just click "Fix it!" ================================================================================ In what follows, instructions to uninstall postgresql and pgadmin (only for ubuntu-like operating systems) ------------------------------ uninstall postgres ------------------------------ - use the following command: sudo apt remove --purge postgresql postgresql-common ------------------------------ uninstall pgadmin, version 3 ------------------------------ - use the following command: sudo apt remove --purge pgadmin3 ================================================================================ In what follows, instructions to make a backup (dump) and then restore a database (only for linux-based operating systems) ------------------------------ DB backup ------------------------------ We assume a postgres server is installed on the local machine and we want to make a backup copy of the database named "postgres" (the whole database, not a single schema). We also assume an username "postgres" exists on the postgres server. We also assume folder "/home/dario/Desktop/backup/postgres.sql" to exist and user "postgres" has write (w) and execution (x) permissions on it. ------------------------------ - use the following commands: sudo su - postgres pg_dump -U postgres -W postgres > /home/dario/Desktop/backup/postgres.sql ------------------------------ DB restore ------------------------------ We assume we want to restore a database stored in the file "/home/dario/Desktop/backup/postgres.sql" using the method described above. The new database will ba called "postgres_backup". ------------------------------ - use the following commands: sudo su - postgres psql -U postgres -W --command="create database postgres_backup" psql -U postgres -W postgres_backup < /home/dario/Desktop/backup/postgres.sql