# Accessing Discourse DB with DBeaver

**URL:** https://meta.discourse.org/t/accessing-discourse-db-with-dbeaver/401507
**Category:** Community Building
**Created:** [25 april 2026 om 06:28 UTC](https://meta.discourse.org/t/accessing-discourse-db-with-dbeaver/401507 "2026-04-25T06:28:25Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Milton\_Htsin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/milton_htsin/32/521583_2.png) [@Milton\_Htsin](https://meta.discourse.org/u/Milton_Htsin)
#### Post date: [25 april 2026 om 06:28 UTC](https://meta.discourse.org/t/accessing-discourse-db-with-dbeaver/401507/1 "2026-04-25T06:28:26Z")

</div>

The built-in [Data Explorer](https://meta.discourse.org/t/32566?silent=true) is fine for quick queries, but if you want to use a real GUI like DBeaver or TablePlus, you have to jump through a few hoops since Discourse’s Postgres is locked inside the Docker bridge.

Here is how to expose it safely over a private network (like Tailscale) so you aren’t leaving your DB open to the internet.

### 1. Map a custom port

Discourse usually eats up the standard ports, so I used `5434`. Edit your `containers/app.yml`:

YAML

```plaintext
expose:
  - "80:80"
  - "443:443"
  - "5434:5432" # Host 5434 -> Container 5432

```

Then rebuild: `./launcher rebuild app`

### 2. Firewall

**Don’t open this port to the public.** If you’re using Tailscale or some others tunnels, restrict access to that interface only:

Bash

```plaintext
sudo ufw allow in on tailscale0 to any port 5434 proto tcp

```

### 3. Fix the Auth (The annoying part)

Discourse uses `peer` auth by default, which blocks external password logins. So you need to tell Postgres to allow `scram-sha-256`

Inside the container (`./launcher enter app`):

Bash

```plaintext
echo "host all all 0.0.0.0/0 scram-sha-256" >> /shared/postgres_data/pg_hba.conf

sudo -u postgres psql -c "SELECT pg_reload_conf();"

```

### 4. Set a password

The `discourse` user doesn’t have a password by default. Set one so app like DBeaver can actually log in to it

Bash

```plaintext
sudo -u postgres psql -c "ALTER USER discourse WITH PASSWORD 'your_password_here';"

```

### 5. Connection Details

- **Host:** Your IP

- **Port:** `5434`

- **Database:** `discourse`

- **User:** `discourse`
