How to install PostgreSQL in Siemens Industrial Edge?

0
I am working with Siemens Industrial Edge and I want to deploy PostgreSQL as a database inside the Edge environment.What is the recommended way to deploy PostgreSQL in Industrial Edge?Should PostgreSQL be packaged as a Docker container and imported as a custom Edge app?Are there any official PostgreSQL apps available in the Industrial Edge Hub?What are the required steps to create the docker-compose.yml and deploy it using Industrial Edge Management (IEM)?Are there any memory or storage limitations when running PostgreSQL on an Edge device?
asked
2 answers
0

Hi,


In Siemens Industrial Edge, applications run as Docker containers, so PostgreSQL is typically deployed the same way—as a containerized service. There is currently no official PostgreSQL application in the Industrial Edge Hub, so the common approach is to package PostgreSQL yourself as a custom Edge app.

The usual workflow looks like this:

First, create a container definition for PostgreSQL. For example, a simple docker-compose.yml could look like this:


version: '3'
services:
  postgres:
    image: postgres:15
    container_name: edge-postgres
    restart: always
    environment:
      POSTGRES_DB: edgedb
      POSTGRES_USER: edgeuser
      POSTGRES_PASSWORD: edgepassword
    volumes:
      - postgres_data:/var/lib/postgresql/data
    ports:
      - "5432:5432"

volumes:
  postgres_data:

Next, package this into an Industrial Edge application. In practice this means creating an app project with the Edge packaging tools (using the Industrial Edge app template), placing the container definition in the app configuration, and building the application package.

After packaging:

  1. Upload the application package to Industrial Edge Management (IEM).
  2. Deploy it to the target Edge device.
  3. Start the application so the PostgreSQL container runs on the device.

For storage, make sure you mount a persistent volume (as in the example above). Without a volume, the database will be lost if the container restarts.

Regarding resource limits, Industrial Edge devices often have constrained CPU, memory, and storage, so it’s important to size PostgreSQL appropriately. Many deployments limit memory usage and configure PostgreSQL parameters (for example shared_buffers, work_mem, etc.) to avoid exhausting the device’s resources.

In summary, the recommended approach is to deploy PostgreSQL as a Docker container packaged as a custom Industrial Edge application, then manage and deploy it through Industrial Edge Management (IEM).


answered
0

Have a lovely day Karthikeyan, :)


You can deploy PostgreSQL as a Docker-based custom Industrial Edge app. The usual approach is to create a docker-compose.yml, import it into Industrial Edge App Publisher (IEAP), and then deploy it through Industrial Edge Management (IEM).


As far as I know, there is no official PostgreSQL server app in the Industrial Edge Hub, so the common approach is to run it as a custom container.


A simple example of a docker-compose.yml for PostgreSQL could look like this (please read the comments in the file if you copy the code into any IDE so you can understand which parts can be adjusted for your setup):


version: "2.4"   # Docker Compose version. Industrial Edge usually supports 2.x versions.

services:
  postgres:
    image: postgres:16.4   # PostgreSQL image version. You can change this (e.g. postgres:15, postgres:14)
    restart: always        # Restarts the container automatically if it stops. Can be adjusted if needed.

    environment:
      POSTGRES_DB: appdb           # Default database name that will be created (can be changed)
      POSTGRES_USER: appuser       # Database username (change depending on your setup)
      POSTGRES_PASSWORD: strongpassword   # Database password (use a strong password in production)

    volumes:
      - pgdata:/var/lib/postgresql/data   # Persistent storage for PostgreSQL data
                                          # This prevents data loss if the container restarts
                                          # You could also use a host path instead, e.g. ./data:/var/lib/postgresql/data

    ports:
      - "5432:5432"   # Port mapping: host_port:container_port
                      # If port 5432 is already in use on the host, you can change it (e.g. "5433:5432")

volumes:
  pgdata:   # Name of the Docker volume storing PostgreSQL data. The name can be changed if needed.


In general, the steps are:

  1. Create the docker-compose.yml with the PostgreSQL container
  2. Add a persistent volume so the database data is not lost on restart
  3. Import the compose file into Industrial Edge App Publisher (IEAP)
  4. Upload the app to Industrial Edge Management (IEM)
  5. Deploy the app to the Edge device


Regarding memory and storage, there is no specific PostgreSQL limitation from Industrial Edge itself. The limits mainly depend on the Edge device hardware and any resource limits configured for the container.


If this resolves your issue, please mark the answer as accepted so it can help others in the community as well.


answered