# Synapse fail to install

**URL:** <https://dietpi.com/forum/t/synapse-fail-to-install/23937>\
**Category:** Troubleshooting\
**Created:** [7 August 2025 06:44 UTC](https://dietpi.com/forum/t/synapse-fail-to-install/23937 "2025-08-07T06:44:31Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![sonnatager](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/s/3ab097/32.png) [@sonnatager](https://dietpi.com/forum/u/sonnatager)\
**Post date:** [7 August 2025 06:44 UTC](https://dietpi.com/forum/t/synapse-fail-to-install/23937/1 "2025-08-07T06:44:32Z")

</div>

#### Details:

- Date | 2025-08-07 08:39:33
- Program name | DietPi-Software
- Command | `runuser -u postgres -- psql -c CREATE ROLE synapse WITH LOGIN PASSWORD '`anyPWhere`';`
- Exit code | 2
- DietPi version | v9.15.2 (MichaIng/master)
- Distro version | bookworm (ID=7,RASPBIAN=0)
- Kernel version | `Linux DietPi 6.12.34+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.12.34-1+rpt1~bookworm (2025-06-26) aarch64 GNU/Linux`
- Architecture | `arm64`
- Hardware model | RPi 5 Model B (aarch64) (ID=5)
- Power supply | (EG: RAVPower 5V 1A)
- SD card | (EG: SanDisk Ultra 16 GB)

#### Steps to reproduce:

1. Install synapse from dietpi-software

#### Expected behaviour:

- synapse should be successfully installed

#### Actual behaviour:

- cannot connect to postgres instance

#### Extra details:

- when the script is calling the command “runuser -u postgres – psql -c CREATE ROLE synapse WITH LOGIN PASSWORD ‘’;“

#### Additional logs:

```auto
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
        Is the server running locally and accepting connections on that socket?

```

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [7 August 2025 10:01 UTC](https://dietpi.com/forum/t/synapse-fail-to-install/23937/2 "2025-08-07T10:01:29Z")

</div>

just checked on my demo RPI5 and installation is working without issues.

```auto
[OK] DietPi-Software | pip3 install -U matrix-synapse psycopg2
[OK] DietPi-Software | useradd -rMU -d /mnt/dietpi_userdata/synapse -s /usr/sbin/nologin synapse
[OK] DietPi-Software | systemctl start postgresql
[OK] DietPi-Software | runuser -u postgres -- psql -c CREATE ROLE synapse WITH LOGIN PASSWORD 'password';
[OK] DietPi-Software | runuser -u postgres -- createdb --encoding=UTF8 --locale=C --template=template0 --owner=synapse synapse

```

Can you check PostgreSQL database running?

```auto
journalctl -u postgresql
systemctl status postgresql

```

---

<div class="post-metadata">

**Author:** ![sonnatager](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/s/3ab097/32.png) [@sonnatager](https://dietpi.com/forum/u/sonnatager)\
**Post date:** [7 August 2025 10:19 UTC](https://dietpi.com/forum/t/synapse-fail-to-install/23937/3 "2025-08-07T10:19:45Z")

</div>

I just tried it again and this are the logs of the postgresql:

```auto
root@DietPi:/tmp/DietPi-Software# journalctl -u postgresql
Aug 07 12:14:24 DietPi systemd\[1\]: Starting postgresql.service - PostgreSQL RDBMS…
Aug 07 12:14:24 DietPi systemd\[1\]: Finished postgresql.service - PostgreSQL RDBMS.
Aug 07 12:14:25 DietPi systemd\[1\]: postgresql.service: Deactivated successfully.
Aug 07 12:14:25 DietPi systemd\[1\]: Stopped postgresql.service - PostgreSQL RDBMS.
Aug 07 12:15:18 DietPi systemd\[1\]: Starting postgresql.service - PostgreSQL RDBMS…
Aug 07 12:15:18 DietPi systemd\[1\]: Finished postgresql.service - PostgreSQL RDBMS.

```

```auto
root@DietPi:/tmp/DietPi-Software# systemctl status postgresql
● postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; preset: enabled)
Active: active (exited) since Thu 2025-08-07 12:15:18 CEST; 3min 21s ago
Process: 106919 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 106919 (code=exited, status=0/SUCCESS)
CPU: 1ms

Aug 07 12:15:18 DietPi systemd\[1\]: Starting postgresql.service - PostgreSQL RDBMS…
Aug 07 12:15:18 DietPi systemd\[1\]: Finished postgresql.service - PostgreSQL RDBMS.

```

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [7 August 2025 10:35 UTC](https://dietpi.com/forum/t/synapse-fail-to-install/23937/4 "2025-08-07T10:35:46Z")

</div>

Postgre seems to be running. Can you check following

```auto
ls -la /var/run/postgresql

```

---

<div class="post-metadata">

**Author:** ![sonnatager](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/s/3ab097/32.png) [@sonnatager](https://dietpi.com/forum/u/sonnatager)\
**Post date:** [7 August 2025 10:37 UTC](https://dietpi.com/forum/t/synapse-fail-to-install/23937/5 "2025-08-07T10:37:48Z")

</div>

```auto
root@DietPi:/tmp/DietPi-Software# ls -la /var/run/postgresql
total 0
drwxrwsr-x 2 postgres postgres 40 Aug 7 12:14 .
drwxr-xr-x 23 root root 660 Aug 7 12:14 ..

```

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [7 August 2025 10:53 UTC](https://dietpi.com/forum/t/synapse-fail-to-install/23937/6 "2025-08-07T10:53:31Z")

</div>

can you try to restart postgre and check again

```auto
systemctl restart postgresql
ls -la /var/run/postgresql

```

---

<div class="post-metadata">

**Author:** ![sonnatager](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/s/3ab097/32.png) [@sonnatager](https://dietpi.com/forum/u/sonnatager)\
**Post date:** [7 August 2025 10:54 UTC](https://dietpi.com/forum/t/synapse-fail-to-install/23937/7 "2025-08-07T10:54:55Z")

</div>

I tried it… still the same log:

```auto
root@DietPi:/tmp/DietPi-Software# ls -la /var/run/postgresql
total 0
drwxrwsr-x 2 postgres postgres 40 Aug 7 12:14 .
drwxr-xr-x 23 root root 660 Aug 7 12:14 ..

```

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [7 August 2025 10:56 UTC](https://dietpi.com/forum/t/synapse-fail-to-install/23937/8 "2025-08-07T10:56:50Z")

</div>

do you have a DietPi configuration for postgre? Can you check?

```auto
ls -la /etc/postgresql/15/main/conf.d

```

Usually this should create the socket

---

<div class="post-metadata">

**Author:** ![sonnatager](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/s/3ab097/32.png) [@sonnatager](https://dietpi.com/forum/u/sonnatager)\
**Post date:** [7 August 2025 11:00 UTC](https://dietpi.com/forum/t/synapse-fail-to-install/23937/9 "2025-08-07T11:00:41Z")

</div>

There is a folder /etc/postgresql but nothing in it

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [7 August 2025 11:02 UTC](https://dietpi.com/forum/t/synapse-fail-to-install/23937/10 "2025-08-07T11:02:31Z")

</div>

?? you mean you don’t have anything inside? No version 15 folder?

---

<div class="post-metadata">

**Author:** ![sonnatager](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/s/3ab097/32.png) [@sonnatager](https://dietpi.com/forum/u/sonnatager)\
**Post date:** [7 August 2025 11:11 UTC](https://dietpi.com/forum/t/synapse-fail-to-install/23937/11 "2025-08-07T11:11:24Z")

</div>

No, there is nothing in this folder. I have tried to reinstall the postgresql with the dietpi-software but no, there is nothing in the /etc/postgresql folder

---

<div class="post-metadata">

**Author:** ![sonnatager](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/s/3ab097/32.png) [@sonnatager](https://dietpi.com/forum/u/sonnatager)\
**Post date:** [7 August 2025 11:22 UTC](https://dietpi.com/forum/t/synapse-fail-to-install/23937/12 "2025-08-07T11:22:40Z")

</div>

But i have a postgresql folder in my dietpi data directory. there i have this 15/main folder, but no conf.d in there.

As for information: the logs of “systemctl status postgresql” above said it is active but exited

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [7 August 2025 12:12 UTC](https://dietpi.com/forum/t/synapse-fail-to-install/23937/13 "2025-08-07T12:12:08Z")

</div>

> [@sonnatager](#):
>
> above said it is active but exited

this is ok. Same for my demo system

```auto
root@DietPi5:/etc/postgresql/15/main/conf.d# systemctl status postgresql
● postgresql.service - PostgreSQL RDBMS
     Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; preset: enabled)
     Active: active (exited) since Thu 2025-08-07 12:00:27 CEST; 2h 6min ago
    Process: 4747 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
   Main PID: 4747 (code=exited, status=0/SUCCESS)
        CPU: 982us

Aug 07 12:00:27 DietPi5 systemd[1]: Starting postgresql.service - PostgreSQL RDBMS...
Aug 07 12:00:27 DietPi5 systemd[1]: Finished postgresql.service - PostgreSQL RDBMS.
root@DietPi5:/etc/postgresql/15/main/conf.d#

```

Problem is the missing configuration. Therefore no `socket` is created.

I have a folder 15 (Postgre version) within `/etc/postgresql/`. This is the configuration directory as describe on our online docs [Databases and Data Store Software Options - DietPi.com Docs](https://dietpi.com/docs/software/databases/#postgresql-configuration)

```auto
root@DietPi5:~# ls -la /etc/postgresql/
total 12
drwxr-xr-x 3 postgres postgres 4096 Aug 7 11:58 .
drwxr-xr-x 64 root root 4096 Aug 7 11:59 ..
drwxr-xr-x 3 postgres postgres 4096 Aug 7 11:58 15
root@DietPi5:~#

```

And there are a couple of config files inside.

```auto
root@DietPi5:~# ls -la /etc/postgresql/15/main/
total 68
drwxr-xr-x 3 postgres postgres 4096 Aug 7 11:58 .
drwxr-xr-x 3 postgres postgres 4096 Aug 7 11:58 ..
drwxr-xr-x 2 postgres postgres 4096 Aug 7 11:58 conf.d
-rw-r--r-- 1 postgres postgres 315 Aug 7 11:58 environment
-rw-r--r-- 1 postgres postgres 143 Aug 7 11:58 pg_ctl.conf
-rw-r----- 1 postgres postgres 5002 Aug 7 11:58 pg_hba.conf
-rw-r----- 1 postgres postgres 1636 Aug 7 11:58 pg_ident.conf
-rw-r--r-- 1 postgres postgres 29699 Aug 7 11:58 postgresql.conf
-rw-r--r-- 1 postgres postgres 317 Aug 7 11:58 start.conf
root@DietPi5:~#

```

Can you remove postgre completely, reboot and try again to install Postgre only?

---

<div class="post-metadata">

**Author:** ![sonnatager](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/s/3ab097/32.png) [@sonnatager](https://dietpi.com/forum/u/sonnatager)\
**Post date:** [7 August 2025 19:00 UTC](https://dietpi.com/forum/t/synapse-fail-to-install/23937/14 "2025-08-07T19:00:08Z")

</div>

Ok, i uninstalled it, reboot and reinstalled postgresql. Now it works. I don’t know, what’s changed, because i already did a uninstall/reinstall before - but without a reboot.

So i think we can close this issue now. Thank you!!! 🙂

---

<div class="post-metadata">

**Author:** ![system](https://dietpi.com/forum/uploads/default/original/1X/7e1021de2213860bce185915ce2c1786e56490ec.png) [@system](https://dietpi.com/forum/u/system)\
**Post date:** [5 November 2025 19:00 UTC](https://dietpi.com/forum/t/synapse-fail-to-install/23937/15 "2025-11-05T19:00:50Z")

</div>

Closed on 5 November 2025 19:00 UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
