Skip to content

Instantly share code, notes, and snippets.

@RikshaDriver
Last active July 1, 2024 05:38
Show Gist options
  • Save RikshaDriver/653bcac5f0854fa3518d9e112e5b59e6 to your computer and use it in GitHub Desktop.
Save RikshaDriver/653bcac5f0854fa3518d9e112e5b59e6 to your computer and use it in GitHub Desktop.
Installing PostgreSQL 13 on QNAP for Davinci Resolve

Installing PostgreSQL 13 on QNAP for Davinci Resolve

This guide aims to provide an updated overview on installing PostgreSQL 13 within a QNAP NAS for use as a database inside Davinci Resolve.

The previous guide(s) created by QNAP are somewhat irrelevant as Davinci Resolve, Container Station and QTS/QuTS have since undergone major upgrades.

These original guides are linked below for reference:

https://www.qnap.com/en/how-to/tutorial/article/how-can-i-migrate-my-davinci-resolve-studio-database-to-a-newer-version-of-qts

https://www.qnap.com/en/how-to/tutorial/article/how-can-i-collaborate-davinci-resolve-studio-16-between-macos-and-windows-in-qts-4-4-3

In order to create a PostgreSQL Server container for Resolve, we must follow a few steps:

  • Create shared folder and structure
  • Set up Docker container in Container Station
  • Configure database access
  • Connect and use database in Resolve

1. Shared Folder

  1. Under Storage and Disks, create a new Shared Folder:

    image

Note

Example settings for sample shared folder:

image

  1. Create a folder inside the share to use as the data folder. I've created postgres for ease of identification:

    image

2. Container Station

  1. Click on Explore, then search for postgres.

  2. Click Deploy next to the official postgres Docker Hub container:

    image
  3. Select the latest version of Postgres 13. Personally, I've selected 13-alpine as that this uses a leaner image.

    image
  4. Set the the name of your docker container, add port 5432 under host then click Advanced

    image
  5. Under Environments tab, add the POSTGRES_PASSWORD variable and password parameter:

    image
  6. Under Storage, Select Bind Mount Host Path

    image
  7. Delete the first Volume entry.

  8. Under the Host entry, enter/locate the respective Share and folder location created earlier.

  9. Set the properties to RW (Read/Write) and add the relevant Container location: /var/lib/postgresql/data

    image
  10. Click Apply, then click Next on the subsequent window.

  11. You will see a summary as below. Click Finish when done

    image

Note

The container should download and start automatically:

image

3. Database Configuration

Next we need to allow access to the databse from remote hosts.

Edit the pg_hba.conf and postgresql.conf files in our postgres folder under the created share.

Edit using Text Editor

This can be done by editing the files through the Share folder or by using File Station directly on the NAS (provided Text Editor is installed).

image

Edit using SSH or shell

This can also be done via ssh to the NAS share folder or even thru the Docker Container itself.

Edit the respective configuration files accordingly using vi, or even a simple shell commmand such as:

echo "listen_addresses = '*' " >> /var/lib/postgresql/data/postgresql.conf

echo "host all all <IP ADDRESS>/<SUBNET> trust" >> /var/lib/postgresql/data/pg_hba.conf

Make sure to replace IP ADDRESS and SUBNET values with appropriate ones relevant to your network.

To edit using a shell prompt within the container itself, click on the container name, then Exceute.

With /bin/bash selected, click Execute in the popup.

image

This will bring the bash prompt for editing

image

4. Database Access

Add the database into Resolve as per the guide:

https://www.qnap.com/en/how-to/tutorial/article/how-can-i-collaborate-davinci-resolve-studio-16-between-macos-and-windows-in-qts-4-4-3

@koemgm
Copy link

koemgm commented Jun 15, 2024

Great job, it worked for me, with a little modification.

Where says
echo "host all all / trust" >> /var/lib/postgresql/data/pg_hba.conf

It is correct without the "/" separator
echo "host all all trust" >> /var/lib/postgresql/data/pg_hba.conf

@BobZelin
Copy link

Thank you Asim - I just tried this, and it works great.
I am very grateful for your detailed explanation. I found it easiest to modify the pg_hba.conf and postgresql.conf files right in Container Station on the QNAP with the EXECUTE Console commands, in the bin/bash window, simply by using vi to modify the files. I am very very grateful to you. You are a wonderful person.

Bob Zelin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment