# IncusOS ISO Download & Customization Methods > **Note:** This document was the original research note that started this repository. > For the actual automation scripts, see [`../incusos/README.md`](../incusos/README.md). --- To automate the generation and download of customized IncusOS ISO files, you have two technical paths: using the official **flasher-tool** (the recommended CLI method for automation) or scripting the **REST API** used by the web customizer. ### Method 1: The flasher-tool (Recommended for Scripts) The Incus team provides a dedicated command-line utility specifically for automated image generation. It connects to the Linux Containers CDN to fetch the latest builds and applies your customizations locally. **Installation:** ```bash go install github.com/lxc/incus-os/incus-osd/cmd/flasher-tool@latest ``` **Sample Automation Script:** This script generates a customized ISO for an x86_64 cluster node with your local client certificate already trusted. ```bash #!/bin/bash # automated-incusos-build.sh # 1. Fetch your local Incus client certificate CLIENT_CERT=$(incus remote get-client-certificate) # 2. Define your customized seed in JSON format # This example preps a node to join a cluster (apply_defaults: false) cat < cluster-node-seed.json { "apply_defaults": false, "preseed": { "certificates": [] } } EOF # 3. Run the flasher tool to build the ISO # -f: format (iso or img) # -s: path to your seed file # -o: output filename flasher-tool -f iso -s cluster-node-seed.json -o my-custom-node.iso ``` ### Method 2: Scripting the Web Customizer API If you prefer to use the web backend directly via curl, you must POST a configuration payload to the generator endpoint. The web customizer is an SPA that communicates with a backend to stream a compressed image. **Technical Logic:** The backend accepts a JSON object that mimics the "Seed" structures. One critical detail is that the web customizer streams **gzipped** data which the browser typically decompresses on the fly; when using curl, you must ensure you handle the output stream correctly. **Sample curl Download Script:** ```bash #!/bin/bash # Configuration ARCH="x86_64" # x86_64 or aarch64 APP="incus" # incus, operations-center, or migration-manager USAGE="install" # install (on disk) or live (run from media) CERT=$(incus remote get-client-certificate | sed ':a;N;$!ba;s/\n/\\n/g') # Generate the JSON payload for the web customizer PAYLOAD=$(cat <