Install PostgreSQL on Your Synology NAS with Docker

Last updated on May 9th, 2023 at 10:41 am

PostgreSQL is a powerful, open-source Object-Relational Database Management System (ORDBMS) that is highly extensible and standards-compliant. It supports advanced data types, transactions, and SQL and is known for its reliability, security, and feature-richness. PostgreSQL is used by many organizations and businesses as the primary data store for their applications and is well suited for complex, data-intensive use cases.

Code Source: GitHub

Skip to Docker Run Code / Skip to Compose & Portainer Code

Install Docker

Before we start, please ensure you have Docker installed. This can be installed through the Synology Package Center.

Create the Docker Folder

Head into File Station and open the Docker folder. Select Create, choose Create folder and name it postgres15. (see demonstration)

Create the Scheduled Task

We will now head into Control Panel > Task Scheduler > Create > Scheduled Task and click User-defined script. (see demonstration)

Configure the Scheduled Task

In the window that appears, insert the following:

In the General tab, In the Task field, enter Postgres. From the User list, select root. Uncheck the Enabled option.

In the Schedule tab, Select Run on the following date (make sure It’s today’s date). Now select Do not repeat.

In the Task Settings tab, under Notification, You can choose to turn this on, otherwise skip this. Now copy-paste the following code into the Run command area. Now click OK.

docker run -d \
  --name=postgre15 \
  -e POSTGRES_PASSWORD=yourpassword \
  -e POSTGRES_USER=neellik \
  -e POSTGRES_DB=database \
  -p 5433:5432 \
  -v /volume1/docker/postgres15:/var/lib/postgresql/data \
  postgres:15

Important: Make sure you change the Directory path to match your own. Remember to change the user, password and database options to match your own.

Accept the warning prompt

When the below warning appears, press OK.

Run the Scheduled Task

From the list of tasks, select Postgres. From the top menu, press Run. When asked to run, press Yes.

Your app is now Installed

Your Docker app has now finished installing. Give it a few seconds/minutes to appear in your Docker list.

Docker Compose and Portainer

If you would prefer to install with Docker Compose or Portainer, use the following code. You can also view a demonstration here.

version: '3.3'
services:
    postgres:
        container_name: postgres15
        environment:
            - POSTGRES_PASSWORD=yourpassword
            - POSTGRES_USER=neellik
            - POSTGRES_DB=database
        ports:
            - '5433:5432'
        volumes:
            - '/volume1/docker/postgres15:/var/lib/postgresql/data'
        image: 'postgres:15'

More Guides:

Actual AdGuard airsonic Audiobookshelf autobrr Bitcoin Calibre-Web ChatpadAI Cleanarr Composerize Crypto DailyTxT Dashy deemix Deluge Emby EmulatorJS Ethereum Euterpe FileBot FilePizza FileZilla Flame Focalboard FreshRSS Grafana Grocy Heimdall Homarr Home Assistant Homebridge Jackett Jellyfin Jellyseerr Joplin Kavita Komga LanguageTool LibreOffice Lidarr Mealie MediaGoblin Medusa Memegen Minecraft Minecraft Bedrock MQTT MusicBrainz MyMediaForAlexa Navidrome Node-RED NZBGet NZBHydra Ombi Overseerr PaperlessNGX Pashword Password Cards Petio Pi-Hole Picard Plex Portainer PostgreSQL Prowlarr PUID & PGID pwndrop Radarr Radicale Readarr ruTorrent SABnzbd SearX Seed Phrase Shiori Sonarr SpeedTest Stash Storm Tailscale TasmoAdmin Tautulli Theia Trilium TubeSync Unpackerr Uptime Kuma Vaultwarden Watchtower WebPDF Whisparr Wordle YouTubeDL


Scroll to Top