Skip to content

Faktencheck Database

The faktencheck database is provided within this repo as postgres database dump.
This readme contains instructions to quickly and easily set up postgres, load the data and access it.

In order to use the faktencheck database, we recommend to

Set up Podman (Preferred)

Installation instructions for the podman project are provided below.

Using docker requires the docker daemon to run. Said daemon needs to run as root and consumes resources, whilst podman neither needs a daemon, to run as root, greatly reducing the attack vector. If we were to assume that this project was only deployed on reasonably powerful machines (which is a false assumption), there would still be the issue that the docker daemon running as root is a major point for exploitation. Just last month docker has received two CVEs rated critical (CVE-2025-7390, CVE-2025-9074).

Therefore its resource and security reasons that make us recommend podman over docker.

If however you still want or need to install docker, you can find information on how to do so on ubuntu below.

  • Ubuntu: Follow instructions here: https://docs.docker.com/engine/install/ubuntu/ and https://docs.docker.com/engine/install/linux-postinstall/

Start containers with docker-compose.yml

To start up the containers, run the following command from this directory.

  • Podman: podman compose up -d
  • Docker (not recommended): docker compose up -d

Note: If you have started the containers previously, they might be cached and you will get an error message with exit code 125 ('Error: creating container storage: the container name "kibad-postgres" is already in use by ... You have to remove that container to be able to reuse that name: that name is already in use, or use --replace to instruct Podman to do so. exit code: 125')

You can safely ignore these errors as long as the startup exit code is 0.

Load SQL Dump

Please make sure to wait a few seconds for all containers to start fully before trying to load the database.

  • Import sql file to database: podman exec -it kibad-postgres bash -c "gzip -cd /tmp/data/2025-11-05_pg-faktencheck_dump.sql.gz | psql -U postgres -d kibad"
    • With Docker: docker exec -it kibad-postgres bash -c "gzip -cd /tmp/data/2025-11-05_pg-faktencheck_dump.sql.gz | psql -U postgres -d kibad"

Note: If you have started the containers previously, they might be cached and you will get errors when re-importing the dump (or a newer dump). To fix this, the current solution is to delete the cached containers with

  • podman rm -f kibad-postgres && podman rm -f kibad-pgadmin

Then, rerun podman compose up -d followed by the import command.

Access pgAdmin

These are the steps for using pgAdmin to make the database accessible via api.

  • Go to: http://localhost:8080
  • Use login email "admin@admin.com" and pw "kibad" (see docker-compose!)
  • Click "Add new server"
    • General -> Name: "Postgres-Local"
    • Connection
      • Host name/address: "kibad-postgres"
      • Port: 5432
      • Username: "postgres" (see docker-compose!)
      • Password: "kibad" (see docker-compose!)
  • Access tables: Servers -> Postgres-Local -> Databases -> kibad -> Schemas -> public -> Tables

Stop containers

To shut down the containers, run the following command from this directory.

  • Podman: podman compose down
  • Docker: docker compose down

Deprecated - Docker: Running from scratch

Postgres

  • Download postgres: docker pull postgres:latest
  • Create postgres container: docker run --name kibad-postgres -e POSTGRES_PASSWORD=kibad -p 5432:5432 -d postgres
  • Create kibad database: docker exec -it kibad-postgres psql -U postgres -c "CREATE DATABASE kibad"

SQL Dump

  • Copy sql file to container: docker cp directory_containing_sql_dump/2025-11-05_pg-faktencheck_dump.sql kibad-postgres:/2025-08-19_pg-faktencheck_dump.sql
  • Import sql file to database: docker exec -it kibad-postgres psql -U postgres -d kibad -f /2025-11-05_pg-faktencheck_dump.sql

pgAdmin

  • Create pgadmin container: docker run --name kibad-pgadmin -e PGADMIN_DEFAULT_EMAIL=admin@admin.com -e PGADMIN_DEFAULT_PASSWORD=kibad -p 8080:80 -d dpage/pgadmin4

Network

  • Create network: docker network create kibad-network
  • Connect postgres: docker network connect kibad-network kibad-postgres
  • Connect pgadmin: docker network connect kibad-network kibad-pgadmin

Access pgAdmin

  • Go to: http://localhost:8080
  • Use login email "admin@admin.com" and pw "kibad"
  • Click "Add new server"
    • General -> Name: "Postgres-Local"
    • Connection
      • Host name/address: "kibad-postgres"
      • Port: 5432
      • Username: "postgres"
      • Password: "kibad"
  • Access tables: Servers -> Postgres-Local -> Databases -> kibad -> Schemas -> public -> Tables