{
  "$schema": "https://blueprints.servus.run/schema/servus-blueprint-v1.schema.json",
  "schemaVersion": "servus-blueprint/v1",
  "id": "listmonk",
  "name": "Listmonk",
  "tagline": "High-performance newsletter and mailing list manager",
  "description": "Self-hosted newsletter and campaign manager with subscriber lists, analytics, PostgreSQL storage, and inline TOML config.",
  "category": "communication",
  "tags": [
    "newsletter",
    "email",
    "campaigns",
    "postgres"
  ],
  "version": "2026-12-03.1",
  "publisher": "Listmonk (Servus Blueprint)",
  "icon": "listmonk",
  "homepage": "https://listmonk.app",
  "docsUrl": "https://listmonk.app/docs/",
  "sourceUrl": "https://github.com/knadh/listmonk",
  "license": "AGPL-3.0",
  "setup": "Sign in with the configured administrator username and password, then configure your SMTP server in Settings.",
  "inputs": [
    {
      "key": "adminUser",
      "label": "Administrator username",
      "type": "text",
      "required": true,
      "default": "admin",
      "min": 2,
      "max": 32
    },
    {
      "key": "adminPassword",
      "label": "Administrator password",
      "type": "password",
      "secret": true,
      "placeholder": "Auto-generated if blank"
    },
    {
      "key": "batchSize",
      "label": "SMTP batch size",
      "type": "number",
      "default": 500,
      "min": 50,
      "max": 10000,
      "group": "advanced"
    }
  ],
  "secrets": [
    {
      "key": "dbPassword",
      "format": "base64url",
      "bytes": 32
    },
    {
      "key": "generatedAdminPassword",
      "format": "alphanumeric",
      "bytes": 20
    }
  ],
  "domains": [
    {
      "key": "primary",
      "label": "Application domain",
      "service": "app",
      "port": 9000,
      "primary": true
    }
  ],
  "profiles": [
    {
      "id": "compact",
      "label": "Compact",
      "services": {
        "app": {
          "cpus": 0.5,
          "memoryMb": 256
        },
        "database": {
          "cpus": 0.5,
          "memoryMb": 256
        }
      }
    },
    {
      "id": "standard",
      "label": "Standard",
      "services": {
        "app": {
          "cpus": 1,
          "memoryMb": 512
        },
        "database": {
          "cpus": 1,
          "memoryMb": 512
        }
      }
    },
    {
      "id": "performance",
      "label": "Performance",
      "services": {
        "app": {
          "cpus": 2,
          "memoryMb": 1024
        },
        "database": {
          "cpus": 2,
          "memoryMb": 1024
        }
      }
    }
  ],
  "defaultProfile": "standard",
  "files": [
    {
      "key": "listmonk_config",
      "service": "app",
      "target": "/listmonk/config.toml",
      "mode": 292,
      "content": "[app]\naddress = \"0.0.0.0:9000\"\nbatch_size = {{inputs.batchSize|500}}\n\n[db]\nhost = \"database\"\nport = 5432\nuser = \"listmonk\"\ndatabase = \"listmonk\"\nssl_mode = \"disable\"\nmax_open = 25\nmax_idle = 25\nmax_lifetime = \"300s\"\n"
    }
  ],
  "volumes": [
    {
      "name": "uploads"
    },
    {
      "name": "database"
    }
  ],
  "networks": [
    {
      "name": "private",
      "internal": true
    }
  ],
  "services": [
    {
      "name": "app",
      "image": "listmonk/listmonk:v4.1.0",
      "restart": "unless-stopped",
      "resources": {
        "cpus": 1,
        "memoryMb": 512
      },
      "command": [
        "sh",
        "-c",
        "./listmonk --config /listmonk/config.toml --install --idempotent --yes && ./listmonk --config /listmonk/config.toml"
      ],
      "environment": {
        "LISTMONK_db__password": "{{secrets.dbPassword}}",
        "LISTMONK_ADMIN_USER": "{{inputs.adminUser|admin}}",
        "LISTMONK_ADMIN_PASSWORD": [
          {
            "value": "{{inputs.adminPassword}}",
            "when": {
              "inputTruthy": "adminPassword"
            }
          },
          {
            "value": "{{secrets.generatedAdminPassword}}"
          }
        ]
      },
      "volumes": [
        {
          "volume": "uploads",
          "target": "/listmonk/uploads"
        }
      ],
      "networks": [
        "private"
      ],
      "dependsOn": [
        "database"
      ],
      "expose": [
        9000
      ]
    },
    {
      "name": "database",
      "image": "postgres:17-alpine",
      "restart": "unless-stopped",
      "resources": {
        "cpus": 1,
        "memoryMb": 512
      },
      "environment": {
        "POSTGRES_DB": "listmonk",
        "POSTGRES_USER": "listmonk",
        "POSTGRES_PASSWORD": "{{secrets.dbPassword}}"
      },
      "volumes": [
        {
          "volume": "database",
          "target": "/var/lib/postgresql/data"
        }
      ],
      "networks": [
        "private"
      ]
    }
  ]
}
