Veeam backup requires ncadmin account to have access to nextcloud_db to complete backup without error

Nextcloud version (eg, 29.0.5): replace me
Operating system and version (eg, Ubuntu 24.04): replace me
Apache or nginx version (eg, Apache 2.4.25): replace me
PHP version (eg, 8.3): replace me

Build from a www.hanssonit.se prebuilt VM

This is for a fresh install of NextCloud being backed up by Veeam backup & replication.

I am getting this error:
Failed to explore PostgreSQL instance XXXXXX : Command explore_instance completed with error Error Permission denied for database nextcloud_db.

Now I understand that Veeam would like to be able to access the db to backup the contents. How would I go about granting ncadmin access to the db?

As I understand it I need an account with access to grant access, but what account would have access? I tried the nextcloud_db_user but that doesn’t seem to meet the requirements.

Does anyone know how to get past this error? My Google FU has failed me so far.

As far as I know, Veeam needs a postgres superuser to create a backup of a database.

Understood, but I’m obviously missing something here

I did the following:
sudo -u postgres createuser ncadmin
psql postres
GRANT root TO ncadmin

That cleared and earlier error I had with the postgres db and veeam, but the same trick doesn’t work for nextcloud_db due to a lack of rights, so I’m kind of stumped.

Instead of doing that you can just create a superuser in one command.

CREATE ROLE username SUPERUSER LOGIN PASSWORD ‘password’;

Initially I earned a
ERROR: must be superuser to create superusers

So I tried this:

sudo -u postgres psql postgres
GRANT SUPERUSER TO ncadmin
/q

Now this command works
sudo -u postgres psql nextcloud_db
so I’m doing this
GRANT SUPERUSER TO ncadmin
GRANT root TO ncadmin

Which may be overkill. Running a test backup now.

Hey not sure from where you’ve got

GRANT ROOT
or
GRANT SUPERUSER

The correct way to give superuser permissions to an existing user would be as follows

ALTER USER username WITH SUPERUSER;

Thank you! That is exactly what I needed!
Veeam is happy now

Thank you for all your help

No problem. You’re welcome :smiley: