Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions docs/postgresql-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,22 @@ postgres=# SELECT version();
PostgreSQL 18.6 (Ubuntu 18.6-0ubuntu0.26.04.1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 15.2.0-16ubuntu1) 15.2.0, 64-bit
```

## Changing Postgres user password

Since `PostgreSQL` runs under the `postgres` user, we need to use that user to access the database. By default, this user has no password, but by running the following command, we add a password.

```txt
user@it2810-11:~$ sudo passwd postgres
[sudo: authenticate] Password:
Enter new password:
Retype new password:
Retype new password:
passwd: password updated successfully
user@it2810-11:~$
```

Setting the password on the postgres instance itself is done with the following command

```txt
sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'super-secret-password-that-you-cant-read';"
```