# Can't Install Nextcloud - pgsql CONNECT privilege

**URL:** <https://help.nextcloud.com/t/cant-install-nextcloud-pgsql-connect-privilege/12643>\
**Category:** ℹ️ Support\
**Created:** [May 16, 2017, 12:23am UTC](https://help.nextcloud.com/t/cant-install-nextcloud-pgsql-connect-privilege/12643 "2017-05-16T00:23:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![lxkraken](https://help.nextcloud.com/letter_avatar/lxkraken/32/5_5575768a8748004e209b776fc1b2916d.png) [@lxkraken](https://help.nextcloud.com/u/lxkraken)\
**Post date:** [May 16, 2017, 12:23am UTC](https://help.nextcloud.com/t/cant-install-nextcloud-pgsql-connect-privilege/12643/1 "2017-05-16T00:23:38Z")

</div>

Hello all–

I’m trying to install the latest Nextcloud on Debian Stretch with postgresql and nginx. I installed all of the required dependencies, however I keep getting this error when trying to create the admin account:

Error while trying to create admin user: Failed to connect to the database: An exception occured in driver: SQLSTATE[08006] [7] FATAL: permission denied for database “nextcloud”  
DETAIL: User does not have CONNECT privilege.

I have no problems logging into phpPgAdmin with this user. I also altered my pg\_ha.conf by adding this line:

local all all trust

I also tried to execute this as the postgres user in the psql console

GRANT ALL PRIVILEGES ON DATABASE nextcloud TO nuser;

… all to no avail.

I have no idea what more I could try. I’d very much appreciate any sort of guidance.

---

<div class="post-metadata">

**Author:** ![sergey\_a](https://help.nextcloud.com/user_avatar/help.nextcloud.com/sergey_a/32/4385_2.png) [@sergey\_a](https://help.nextcloud.com/u/sergey_a)\
**Post date:** [June 2, 2017, 9:34am UTC](https://help.nextcloud.com/t/cant-install-nextcloud-pgsql-connect-privilege/12643/2 "2017-06-02T09:34:35Z")

</div>

I fought with issue like yours for two days strait. And I found cause in my case. I created database manually. But installer script doesn’t like that and fails to assign proper privileges for user is creates in database.  
After I dropped database allowing installer to create it its way setup was completed successfully. I strongly feel that all nuances like this should be mentioned in manual.

---

<div class="post-metadata">

**Author:** ![Igor\_Lunin](https://help.nextcloud.com/letter_avatar/igor_lunin/32/5_5575768a8748004e209b776fc1b2916d.png) [@Igor\_Lunin](https://help.nextcloud.com/u/Igor_Lunin)\
**Post date:** [June 26, 2017, 8:04pm UTC](https://help.nextcloud.com/t/cant-install-nextcloud-pgsql-connect-privilege/12643/3 "2017-06-26T20:04:20Z")

</div>

@sergey_a You are totally right about manual! I spent a day for it! Thank you, man, for the answer!

---

<div class="post-metadata">

**Author:** ![lasserh](https://help.nextcloud.com/letter_avatar/lasserh/32/5_5575768a8748004e209b776fc1b2916d.png) [@lasserh](https://help.nextcloud.com/u/lasserh)\
**Post date:** [August 6, 2018, 8:19pm UTC](https://help.nextcloud.com/t/cant-install-nextcloud-pgsql-connect-privilege/12643/4 "2018-08-06T20:19:53Z")

</div>

Worked for me - thanks a lot!

---

<div class="post-metadata">

**Author:** ![stratege1401](https://help.nextcloud.com/user_avatar/help.nextcloud.com/stratege1401/32/7570_2.png) [@stratege1401](https://help.nextcloud.com/u/stratege1401)\
**Post date:** [August 6, 2018, 8:44pm UTC](https://help.nextcloud.com/t/cant-install-nextcloud-pgsql-connect-privilege/12643/5 "2018-08-06T20:44:24Z")

</div>

IF fixed, please report this bug to github as it is devell related and close thread, thanks.

---

<div class="post-metadata">

**Author:** ![system](https://help.nextcloud.com/user_avatar/help.nextcloud.com/system/32/29333_2.png) [@system](https://help.nextcloud.com/u/system)\
**Post date:** [September 23, 2024, 5:49pm UTC](https://help.nextcloud.com/t/cant-install-nextcloud-pgsql-connect-privilege/12643/6 "2024-09-23T17:49:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 9, 2024, 1:24pm UTC](https://help.nextcloud.com/t/cant-install-nextcloud-pgsql-connect-privilege/12643/7 "2024-12-09T13:24:08Z")

</div>


