Running Atuin on a Raspberry Pi with Docker Compose

Hey folks,

I’ve set up Atuin on my Raspberry Pi as part of my homelab, using Docker Compose. This is based on the official Atuin documentation, but adapted to run smoothly on ARM and running in a portainer with a few extras for persistence, monitoring, and automated backups.

This setup assumes you’ll create a .env file with your own credentials, and the generic path like:

ATUIN_DB_USERNAME=atuin
ATUIN_DB_PASSWORD=your_secure_password
ATUIN_DB_NAME=atuin

Based on documentation i’ve add this points:

  • Timezone configured: TZ is set for consistent logs and backup timestamps.
  • Healthchecks: Added for both Atuin and PostgreSQL services to monitor container health - useful on Portainer.
  • Backup container monitoring: Sets HEALTHCHECK_PORT for backup container to allow health status checks.
  • Compose with postgres backup: Add together on stack the db dumper.
version: '3.5'
services:
  atuin:
    restart: always
    image: ghcr.io/atuinsh/<LATEST TAGGED RELEASE>
    command: server start
    volumes:
      - "./config:/config"
    links:
      - postgresql:db
    ports:
      - 8888:8888
    environment:
      ATUIN_HOST: "0.0.0.0"
      ATUIN_OPEN_REGISTRATION: "true"
      ATUIN_DB_URI: postgres://$ATUIN_DB_USERNAME:$ATUIN_DB_PASSWORD@db/$ATUIN_DB_NAME
      RUST_LOG: info,atuin_server=debug
      TZ: America/Sao_Paulo
    healthcheck:
      test: ["CMD", "bash", "-c", "echo > /dev/tcp/localhost/8888"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 10s
      
  postgresql:
    image: postgres:14
    restart: unless-stopped
    volumes:
      - "./database:/var/lib/postgresql/data/"
    environment:
      POSTGRES_USER: ${ATUIN_DB_USERNAME}
      POSTGRES_PASSWORD: ${ATUIN_DB_PASSWORD}
      POSTGRES_DB: ${ATUIN_DB_NAME}
      TZ: America/Sao_Paulo
      PGTZ: America/Sao_Paulo
    healthcheck:
      test: ["CMD-SHELL", "pg_isready", "-U", "${ATUIN_DB_NAME}"]
      interval: 10s
      timeout: 5s
      retries: 5

  backup:
    restart: unless-stopped
    container_name: atuin_db_dumper
    image: prodrigestivill/postgres-backup-local:latest
    environment:
      POSTGRES_HOST: postgresql
      POSTGRES_DB: ${ATUIN_DB_NAME}
      POSTGRES_USER: ${ATUIN_DB_USERNAME}
      POSTGRES_PASSWORD: ${ATUIN_DB_PASSWORD}
      SCHEDULE: "@daily"
      BACKUP_DIR: /db_dumps
      TZ: America/Sao_Paulo
      HEALTHCHECK_PORT: 5432
    volumes:
      - ./db_dumps:/db_dumps
    depends_on:
      - postgresql

This is works for me including the timezone for check logs across along on the clients.
Validates in Raspbery pi 4 with Armbian 25.2.2 Bookworm

Feedback always welcome!

1 Like

nice one! thank you for sharing :folded_hands: