A couple years ago I set up the fantastic software pretix for my track and field club. I set it up using this guide from their docs. A couple years have gone by, and I want to move it to a container based setup using podman.

Backing up the old setup

Lets start by taking the backup from the old setup.


Change user to postgres and take a dump of the database

su - postgres
pg_dumpall -f pretix_db_data

Pretix data and settings

By default the data directory is located in /var/pretix/data, and the config is in /etc/pretix/. Backup those directories.

Podman notes

  • I want to run the containers as my user, aka rootless.
  • I want to follow the documentation from pretix as close as possible
  • I already have a reverse proxy set up on this host.

Podman setup

dir setup:

├── pretix-config
├── pretix-data
├── pretix-db
├── pretix-redis
└── sock
  • Copy your pretix config file to pretix-config
  • Data files to pretix-data

Podman network

  • Create podman network
podman create network pretix

Postgres DB

  • Create db container and import db backup
podman run --name pretix-db --rm -d \
-v /home/fyksen/pretix/pretix-db:/var/lib/postgresql/data:Z \
-e POSTGRES_PASSWORD=heehohkuh2Angeicoo9Kuenu  \
--network pretix \
  • cp in db backup file and restore from backup
podman cp pretix_db_data pretix-db:/pretix_db_data
podman exec -it pretix-db bash
su - postgres
psql -U postgres -f /pretix_db_data
  • Add line to postgres config for pretix to connect trough network. File is in: /home/fyksen/pretix/pretix-db/pg_hba.conf Line to add:
host    pretix          pretix           md5


  • Config file: location: pretix-redis/redis.conf
unixsocket /var/run/redis/redis.sock
unixsocketperm 777
  • run container with:
podman run --rm --name pretix-redis \
--network pretix \
-v /home/fyksen/tickets.skvidar.run/pretix-redis/redis.conf:/usr/local/etc/redis/redis.conf:Z \
-v /home/fyksen/tickets.skvidar.run/sock:/var/run/redis:Z  \
docker.io/library/redis:7 redis-server /usr/local/etc/redis/redis.conf


You need to make some changes to pretix.cfg:

; Replace with the password you chose above
; In most docker setups, is the address of the docker host. Adjust
; this to wherever your database is running, e.g. the name of a linked container.

; Remove the following line if you are unsure about your redis' security
; to reduce impact if redis gets compromised.


Then you'r ready to run the container:

podman run --name pretix-app --rm --network pretix \
-p 8345:80 \
-v /home/fyksen/tickets.skvidar.run/pretix-data:/data:Z \
-v /home/fyksen/tickets.skvidar.run/pretix-config:/etc/pretix:Z \
--sysctl net.core.somaxconn=4096 \
-v /home/fyksen/tickets.skvidar.run/sock:/var/run/redis:Z \
docker.io/pretix/standalone:stable all