# Backup restore failing on clean dev docker env: FATAL: Peer authentication failed for user “postgres”

**URL:** https://meta.discourse.org/t/backup-restore-failing-on-clean-dev-docker-env-fatal-peer-authentication-failed-for-user-postgres/208170
**Category:** Bug
**Tags:** pr-welcome, dev-install
**Created:** [November 3, 2021, 9:22pm UTC](https://meta.discourse.org/t/backup-restore-failing-on-clean-dev-docker-env-fatal-peer-authentication-failed-for-user-postgres/208170 "2021-11-03T21:22:05Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![thoka](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thoka/32/115652_2.png) [@thoka](https://meta.discourse.org/u/thoka)
#### Post date: [March 19, 2023, 10:05pm UTC](https://meta.discourse.org/t/backup-restore-failing-on-clean-dev-docker-env-fatal-peer-authentication-failed-for-user-postgres/208170/6 "2023-03-19T22:05:20Z")

</div>

I have had the same problems.  
Finally I inserted the following as a workaround

```plaintext
   if Rails.env.development?
      username = "discourse"
      password = "discourse"
      config["host"] = "localhost"
      config["port"] = 5432
      config["database"] = "discourse_development"
    end

```

before

```plaintext
  DatabaseConfiguration.new(

```

into `/lib/backup_restore.rb`.

I also had to set the password for user `discourse` via

```plaintext
d/psql -c "ALTER USER discourse WITH PASSWORD 'discourse';"

```

There might be nicer ways to achieve this.

---

_[View the full topic](https://meta.discourse.org/t/backup-restore-failing-on-clean-dev-docker-env-fatal-peer-authentication-failed-for-user-postgres/208170)._
