Setting Up Podman and Quadlets

In this guide, I’ll walk you through setting up Podman and Quadlets. While this is the method that worked for me, I’m always open to improvements and suggestions. Future posts will cover how to configure specific Quadlets in detail. Install Podman sudo apt -y install podman For other operation systems, check here Create a Quadlet Create the file /etc/containers/systemd/postgres.container and paste in the following data as sudo. [Unit] Description=Podman - Postgres Wants=network-online.target After=network-online.target [Container] Image=docker.io/library/postgres:17 AutoUpdate=registry ContainerName=postgres # Choose a Postgres username Environment=POSTGRES_USER={POSTGRES_USER} # Choose a Postgres password Environment=POSTGRES_PASSWORD={POSTGRES_PASSWORD} # Change {USER} to your user on the machine Volume=/home/{USER}/services/postgres:/var/lib/postgresql/data PublishPort=5432:5432 HealthCmd="pg_isready -U postgres" HealthStartPeriod=15s HealthInterval=30s HealthTimeout=30s HealthRetries=3 # USER_ID value is obtained with `id -u` while logged into {USER} User={USER_ID} # GROUP_ID value is obtained with `id -g` while logged into {USER} Group={GROUP_ID} [Service] Restart=always TimeoutStartSec=900 [Install] WantedBy=default.target If your editor of choice is vim/nvim you can add # vim: set filetype=systemd : to the end of the file to enable syntax highlighting. ...

September 30, 2024 · Eric Thomas