Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When you create a new library the software will automatically create the new database for you.

All you have to provide is the login information (user & password), the database server (server name or IP address) and the database name - how you want to call the new database (Example: das_element). The software will setup all the tables for you. Nothing that you have to do.

Optional: You can use a SSL certificate.

...

Setup Postgres Server

  1. Install Postgres

    1. Linux

    2. MacOS

    3. Windows

    4. Docker Compose

  2. Configure Server

  3. Create User

Install Postgres

On a machine that’s accessible by everybody on the network (e.g. Virtual Machine) install the Postgres Software.

...

A easy way to create a new database server is to use Docker Compose
Please make sure to install Docker and Docker Compose first.

  1. create a new folder: database_postgres

  2. create a new text file inside the folder called: docker-compose.yml

  3. add this code snipped into the file …

Code Block
version: '3'

services:
  postgres:
    image: postgres:14.4
    restart: always
    ports:
      - 5432:5432
    environment:
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=password
    volumes:
      - ./postgres-data:/var/lib/postgresql/data

...

Code Block
docker-compose up -d

Alternative - Docker Compose for Postgres & pgAdmin

Code Block
languageyaml
version: '3.5'

services:
  postgres:
    container_name: postgres_container
    image: postgres
    environment:
      POSTGRES_USER: {CHANGE HERE}
      POSTGRES_PASSWORD: {CHANGE HERE}
      PGDATA: /data/postgres
    volumes:
       - postgres:/data/postgres
    ports:
      - "5432:5432"
    networks:
      - postgres
    restart: unless-stopped
 
  pgadmin:
    container_name: pgadmin_container
    image: dpage/pgadmin4
    environment:
      PGADMIN_DEFAULT_EMAIL: {CHANGE HERE}
      PGADMIN_DEFAULT_PASSWORD: {CHANGE HERE}
      PGADMIN_CONFIG_SERVER_MODE: 'False'
    volumes:
       - pgadmin:/root/.pgadmin
    ports:
      - "6060:80"
    networks:
      - postgres
    restart: unless-stopped

networks:
  postgres:
    driver: bridge

volumes:
    postgres:
    pgadmin:

Configure Postgres Server

After the installation of the Postgres you need to configure the server to allow access from a remote workstation. There are two files that need changes:

  1. configure database to enable networking

    1. edit the file: postgresql.conf
      Linux: /etc/postgresql/{version}/main/postgresql.conf
      MacOS: /usr/local/var/postgresql.conf
      Windows: C:\Program Files\PostgreSQL\{version}\data\postgresql.conf

    2. remove the # before the line: listen_addresses = '*'
      This allows access from all IP addresses.

    3. save the file

  2. allow access from remote workstation

    1. edit the file: pg_hba.conf
      Linux: /etc/postgresql/{version}/main/pg_hba.conf
      MacOS: /usr/local/var/pg_hba.conf
      Windows: C:\Program Files\PostgreSQL\{version}\data\pg_hba.conf

    2. add this line to the block IPV4:

Code Block
# TYPE  DATABASE        USER            CIDR-ADDRESS            METHOD
# IPv4 local connections
host    all             all             0.0.0.0/0               trust

...