In older versions of the Qnap software, you could install PostgreSQL only via the AppCenter, which had the drawback that it supported usually a quite old PostgreSQL version. However, with newer firmware versions (4.5.1.1480 in my case) you are much more flexible. The reason for that is the container station, which is a very powerful feature.
In this little blog post I will show you how to deploy PostgreSQL 12.4 on Debian 10 which runs directly on the Qnap NAS itself. I could have picked PostgreSQL 12.3 or 12.5 as well. But this is just to illustrate you how flexible you are.
Sidenote: Before you deploy bigger databases on Qnap, I really would recommend to upgrade your physical RAM.
So lets get started by just opening the container station and search for the image that you like to deploy. In my case it is PostgreSQL. 🙂 It will point you to images from bitnami. For more information check out the following link: https://hub.docker.com/r/bitnami/postgresql
After you have chosen your PostgreSQL Docker Image, you can select the version that you like. In my case it is PostgreSQL 12.4.
The next step is to give your container a name and specify the CPU and Memory limits.
If you click on advanced settings, you can fine tune your new container ever more. An important piece is the environment variable POSTGRESQL_PASSWORD. You might choose a more secure password, than I did. 🙂
And adjust the network settings according to your needs.
That’s more or less it. Afterwards you will see only the Summary screen and the backgroud task that builds your container.
Now the fun part begins where you can start the container and fire up the terminal and create your first PostgreSQL database on Qnap.
Ready.
Conclusion
The container station is a very powerful part of the Qnap software stack, where you can easily deploy any PostgreSQL version that you wish.