# Documentation request: Overview about database access and configuration in a development environment.

**URL:** https://meta.discourse.org/t/documentation-request-overview-about-database-access-and-configuration-in-a-development-environment/258710
**Category:** Site feedback
**Created:** [March 20, 2023, 9:45am UTC](https://meta.discourse.org/t/documentation-request-overview-about-database-access-and-configuration-in-a-development-environment/258710 "2023-03-20T09:45:42Z")
**Posts on this page:** 2
**Page:** 1

<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 20, 2023, 9:45am UTC](https://meta.discourse.org/t/documentation-request-overview-about-database-access-and-configuration-in-a-development-environment/258710/1 "2023-03-20T09:45:42Z")

</div>

In the context of understanding how to restore a backup in a freshly installed development environment (docker) I would be happy about some explanation, how the database is set up and the connection to the database is configured:

> [@Backup restore failing on clean dev docker env: FATAL: Peer authentication failed for user “postgres”](https://meta.discourse.org/t/backup-restore-failing-on-clean-dev-docker-env-fatal-peer-authentication-failed-for-user-postgres/208170/6):
>
> I have had the same problems. Finally I inserted the following as a workaround if Rails.env.development? username = "discourse" password = "discourse" config["host"] = "localhost" config["port"] = 5432 config["database"] = "discourse\_development" end before DatabaseConfiguration.new( into /lib/backup\_restore.rb. I also had to set the password for user discourse via d/psql -c "ALTER USER discourse WITH PASSWORD 'discourse';" There might be nicer ways…

---

<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 20, 2023, 10:53am UTC](https://meta.discourse.org/t/documentation-request-overview-about-database-access-and-configuration-in-a-development-environment/258710/2 "2023-03-20T10:53:34Z")

</div>

Database configuration is done here:

> <https://github.com/discourse/discourse_docker/blob/990519e2373ec32055a7742a407e81f4bd606ed4/image/discourse_dev/Dockerfile#L27-L40>

Create development databases:

> <https://github.com/discourse/discourse_docker/blob/990519e2373ec32055a7742a407e81f4bd606ed4/image/discourse_dev/postgres_dev.template.yml#L26-L42>

Setup database user:

> <https://github.com/discourse/discourse_docker/blob/990519e2373ec32055a7742a407e81f4bd606ed4/templates/postgres.13.template.yml#L204-L207>

I’m still trying to understand,

- how authentication is done
- where authentication is configured
- how connection parameters should be set
