AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
feat(platform): add Linux and macOS appliance installer (#13261)
Nicholas Tindle212f8f14c565
diff --git a/.github/workflows/platform-installer-ci.yml b/.github/workflows/platform-installer-ci.ymlnew file mode 100644index 0000000000..07e0986c13--- /dev/null+++ b/.github/workflows/platform-installer-ci.yml@@ -0,0 +1,92 @@+name: AutoGPT Platform - Installer CI++on:+ pull_request:+ paths:+ - ".github/workflows/platform-installer-ci.yml"+ - ".github/scripts/platform-single-container-publish.sh"+ - ".github/workflows/platform-single-container-docker.yml"+ - "autogpt_platform/installer/**"+ - "autogpt_platform/single-container/Dockerfile"+ - "autogpt_platform/single-container/docker-bake.hcl"+ - "README.md"+ - "docs/platform/getting-started.md"+ - "docs/platform/installer.md"+ push:+ branches: [dev]+ paths:+ - ".github/workflows/platform-installer-ci.yml"+ - ".github/scripts/platform-single-container-publish.sh"+ - ".github/workflows/platform-single-container-docker.yml"+ - "autogpt_platform/installer/**"+ - "autogpt_platform/single-container/Dockerfile"+ - "autogpt_platform/single-container/docker-bake.hcl"+ - "README.md"+ - "docs/platform/getting-started.md"+ - "docs/platform/installer.md"++permissions:+ contents: read++jobs:+ shell:+ name: Shell installer+ runs-on: ubuntu-24.04+ steps:+ - name: Check out repository+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1+ with:+ persist-credentials: false++ - name: Parse shell installers+ run: bash -n autogpt_platform/installer/*.sh++ - name: Lint changed shell installers+ run: >-+ shellcheck --exclude=SC2016+ autogpt_platform/installer/install.sh+ autogpt_platform/installer/test-single-container-handoff.sh++ - name: Smoke-test single-container handoff+ env:+ INSTALLER_REQUIRE_OWNERSHIP_TEST: "true"+ INSTALLER_REAL_DOCKER_TEST: "true"+ run: bash autogpt_platform/installer/test-single-container-handoff.sh++ - name: Validate release publication mapping+ run: bash .github/scripts/platform-single-container-publish.sh self-test++ - name: Validate installer assumptions against the appliance Dockerfile+ run: |+ grep -F 'org.opencontainers.image.title="AutoGPT Platform single-container"' autogpt_platform/single-container/Dockerfile+ grep -F 'org.opencontainers.image.source="https://github.com/Significant-Gravitas/AutoGPT"' autogpt_platform/single-container/Dockerfile+ # shellcheck disable=SC2016+ grep -F 'org.opencontainers.image.revision="${VCS_REF}"' autogpt_platform/single-container/Dockerfile+ grep -F 'VOLUME ["/data"]' autogpt_platform/single-container/Dockerfile+ grep -F 'EXPOSE 3000' autogpt_platform/single-container/Dockerfile+ grep -F 'ENTRYPOINT ["/usr/bin/tini", "--", "/opt/autogpt/single-container/entrypoint.sh"]' autogpt_platform/single-container/Dockerfile+ grep -F 'CMD ["/usr/bin/supervisord", "-n", "-c", "/opt/autogpt/single-container/supervisor/supervisord.conf"]' autogpt_platform/single-container/Dockerfile++ macos:+ name: Shell installer (macOS)+ runs-on: macos-14+ steps:+ - name: Check out repository+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1+ with:+ persist-credentials: false++ - name: Parse shell installers+ run: bash -n autogpt_platform/installer/*.sh++ - name: Install ShellCheck+ run: brew install shellcheck++ - name: Lint shell installers+ run: >-+ shellcheck --exclude=SC2016+ autogpt_platform/installer/install.sh+ autogpt_platform/installer/test-single-container-handoff.sh++ - name: Test macOS installer paths, ACLs, and mocked Docker handoff with system Bash+ run: /bin/bash autogpt_platform/installer/test-single-container-handoff.shdiff --git a/README.md b/README.mdindex f668ac876d..cd3bdc369d 100644--- a/README.md+++ b/README.md@@ -111,17 +111,15 @@ The hosted Platform is a paid service with usage-based agent runs. [Compare plan> [!NOTE]> Self-hosting is the free path. You provide the infrastructure and model API keys, and you maintain the deployment. If you want zero setup, use the [managed Platform](https://platform.agpt.co/signup?utm_source=github&utm_medium=referral&utm_campaign=autogpt_readme&utm_content=self_host_note).-**macOS and Linux:**+The Linux and macOS single-container release installer is coming with the next+appliance release. Until the public installer endpoint and image tags pass the+[documented release gates](docs/platform/installer.md#maintainer-release-gates),+use the [manual self-hosting guide](https://docs.agpt.co/platform/getting-started).-```bash-curl -fsSL https://setup.agpt.co/install.sh -o install.sh && bash install.sh-```--**Windows PowerShell:**--```powershell-powershell -c "iwr https://setup.agpt.co/install.bat -o install.bat; ./install.bat"-```+The release installer will require an already-running local Docker daemon using+Linux containers on `amd64` or `arm64`. It pulls the published appliance and+runs its immutable digest; it does not install Docker or build from source.+Windows users should continue with the manual self-hosting guide for now.[Read the self-hosting guide →](https://docs.agpt.co/platform/getting-started)@@ -131,7 +129,7 @@ powershell -c "iwr https://setup.agpt.co/install.bat -o install.bat; ./install.b| | **AutoGPT Platform** | **Self-hosted** ||---|---|---|-| Access | Public signup | Clone and install |+| Access | Public signup | Operate the published appliance or a development checkout || Cost | Paid plan plus agent usage | No license fee; pay your own infrastructure and model providers || Setup | Managed | Docker and configuration required || Model access | Built in | Bring your own API keys |diff --git a/autogpt_platform/installer/install.sh b/autogpt_platform/installer/install.shnew file mode 100755index 0000000000..d7b037ef39--- /dev/null+++ b/autogpt_platform/installer/install.sh@@ -0,0 +1,611 @@+#!/usr/bin/env bash+# AutoGPT Platform release installer for Linux and macOS.+#+# Docker must already be installed, running locally, and using Linux containers.+# Download to a unique temporary file and execute only after a successful fetch:+# ( installer="$(mktemp)" && trap 'rm -f "$installer"' EXIT &&+# curl --proto '=https' --proto-redir '=https' --tlsv1.2 -fsSL -o "$installer" \+# https://setup.agpt.co/install.sh && bash "$installer" )+set -Eeuo pipefail++DEPLOY_IMAGE='docker.io/significantgravitas/autogpt'+CONTAINER_NAME='autogpt'+DATA_VOLUME='autogpt-platform-data'+OWNER_LABEL_KEY='com.agpt.installer.owner'+OWNER_LABEL_VALUE='autogpt-platform-installer'+CONTRACT_LABEL_KEY='com.agpt.installer.contract'+CONTRACT_LABEL_VALUE='1'+INSTALL_ID_LABEL_KEY='com.agpt.installer.install-id'+ENV_HASH_LABEL_KEY='com.agpt.installer.env-sha256'+EXPECTED_TITLE='AutoGPT Platform single-container'+EXPECTED_SOURCE='https://github.com/Significant-Gravitas/AutoGPT'+MIN_RAM_GB=8+MIN_DISK_GB=25++CHECK_DIR_ONLY=false+RELEASE=''+DIR="${XDG_CONFIG_HOME:-${HOME}/.config}"+DIR="${DIR%/}/autogpt"+SKIP_PREFLIGHT=false+PREFLIGHT_ONLY=false+RESOLVE_ONLY=false+VER_REF=''+IMAGE=''+IMAGE_DIGEST=''+DAEMON_ARCH=''+INSTALL_ID=''+ENV_FILE=''+ENV_HASH=''+VOLUME_ESTABLISHED=false++if [ -t 1 ]; then+ C_G=$'\033[0;32m'+ C_Y=$'\033[1;33m'+ C_R=$'\033[0;31m'+ C_C=$'\033[0;36m'+ C_0=$'\033[0m'+else+ C_G=''+ C_Y=''+ C_R=''+ C_C=''+ C_0=''+fi++say() { printf '%s\n' "$*"; }+info() { printf ' %s\n' "$*"; }+ok() { printf ' %s[ OK ]%s %s\n' "$C_G" "$C_0" "$*"; }+warn() { printf ' %s[WARN]%s %s\n' "$C_Y" "$C_0" "$*"; }+step() { printf '\n%s==> %s%s\n' "$C_C" "$*" "$C_0"; }+die() {+ printf '\n%sError: %s%s\n' "$C_R" "$*" "$C_0" >&2+ exit 1+}++print_help() {+ cat <<'EOF'+AutoGPT Platform Installer (Linux + macOS)++Installs the published single-container appliance. A running local Docker+daemon configured for Linux containers is required.++Safe download and execution:+ ( installer="$(mktemp)" && trap 'rm -f "$installer"' EXIT &&+ curl --proto '=https' --proto-redir '=https' --tlsv1.2 -fsSL -o "$installer" \+ https://setup.agpt.co/install.sh && bash "$installer" )++Flags:+ --release <tag> published vX.Y.Z image (default: latest)+ --dir <path> private state directory (default: $XDG_CONFIG_HOME/autogpt+ or $HOME/.config/autogpt)+ --skip-preflight skip RAM and disk checks; Docker checks remain mandatory+ --preflight-only validate the machine and install nothing+ --resolve-only print the selected image and install nothing+ --help+EOF+ exit 0+}++need_val() {+ [ -n "${2:-}" ] || die "$1 needs a value (try --help)"+ case "$2" in+ -*) die "$1 needs a value, not another option: $2" ;;+ esac+}++while [ $# -gt 0 ]; do+ case "$1" in+ --release=*)+ RELEASE="${1#*=}"+ [ -n "$RELEASE" ] || die '--release needs a non-empty value (try --help)'+ ;;+ --release)+ need_val "$1" "${2:-}"+ RELEASE="$2"+ shift+ ;;+ --dir=*) DIR="${1#*=}" ;;+ --dir)+ need_val "$1" "${2:-}"+ DIR="$2"+ shift+ ;;+ --skip-preflight) SKIP_PREFLIGHT=true ;;+ --preflight-only) PREFLIGHT_ONLY=true ;;+ --resolve-only) RESOLVE_ONLY=true ;;+ --check-dir-only) CHECK_DIR_ONLY=true ;;+ -h | --help) print_help ;;+ *) die "Unknown flag: $1 (try --help)" ;;+ esac+ shift+done++OS="$(uname -s)"+case "$OS" in+Linux*) OS_FAMILY=linux ;;+Darwin*) OS_FAMILY=macos ;;+*) die "Unsupported OS: $OS. This release installer supports Linux and macOS; Windows users should follow the manual setup guide." ;;+esac+ARCH="$(uname -m)"++release_image() {+ local release="$1" version+ if [[ "$release" =~ ^autogpt-platform-beta-v([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then+ version="${BASH_REMATCH[1]}"+ elif [[ "$release" =~ ^v([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then+ version="${BASH_REMATCH[1]}"+ else+ die "Unsupported release tag: ${release}. Expected autogpt-platform-beta-vX.Y.Z or vX.Y.Z."+ fi+ printf '%s:v%s\n' "$DEPLOY_IMAGE" "$version"+}++resolve_version() {+ if [ -n "$RELEASE" ]; then+ VER_REF="$RELEASE"+ IMAGE="$(release_image "$RELEASE")"+ else+ VER_REF='latest'+ IMAGE="${DEPLOY_IMAGE}:latest"+ fi+}++path_owner_uid() {+ if stat -c '%u' "$1" >/dev/null 2>&1; then stat -c '%u' "$1"; else stat -f '%u' "$1"; fi+}++path_link_count() {+ if stat -c '%h' "$1" >/dev/null 2>&1; then stat -c '%h' "$1"; else stat -f '%l' "$1"; fi+}++path_mode() {+ if stat -c '%a' "$1" >/dev/null 2>&1; then stat -c '%a' "$1"; else stat -f '%Lp' "$1"; fi+}++path_is_group_or_other_writable() {+ local mode group other+ mode="$(path_mode "$1")"+ group="${mode: -2:1}"+ other="${mode: -1}"+ case "${group}${other}" in+ *[2367]*) return 0 ;;+ *) return 1 ;;+ esac+}++path_is_trusted_sticky_parent() {+ local owner+ [ -k "$1" ] || return 1+ owner="$(path_owner_uid "$1")"+ [ "$owner" = 0 ] || [ "$owner" = "$(id -u)" ]+}++path_has_unsafe_acl() {+ [ "$OS_FAMILY" = macos ] || return 1+ # macOS exposes ACL entries through ls -le; find has no equivalent output.+ # shellcheck disable=SC2012+ ls -lde "$1" 2>/dev/null | awk '+ NR > 1 && / allow / && /(write|add_file|add_subdirectory|delete|delete_child|writeattr|writeextattr|writeowner|writesecurity|chown)/ { unsafe = 1 }+ END { exit unsafe ? 0 : 1 }+ '+}++path_has_extended_acl() {+ [ "$OS_FAMILY" = macos ] || return 1+ # shellcheck disable=SC2012+ ls -lde "$1" 2>/dev/null | awk 'NR == 1 { exit substr($1, length($1), 1) == "+" ? 0 : 1 }'+}++walk_existing_path() {+ local requested="$1" current='' component owner+ local -a components+ [ "$requested" != / ] || return 0+ IFS='/' read -r -a components <<<"${requested#/}"+ for component in "${components[@]}"; do+ case "$component" in+ '') continue ;;+ .) die "Install directory contains an unsafe '.' component: ${DIR}" ;;+ ..) die "Install directory contains an unsafe '..' component: ${DIR}" ;;+ esac+ current="${current}/${component}"+ if [ -e "$current" ] || [ -L "$current" ]; then+ [ ! -L "$current" ] || die "Install directory contains a symlink component: ${current}"+ [ -d "$current" ] || die "Install directory component is not a directory: ${current}"+ owner="$(path_owner_uid "$current")"+ [ "$owner" = 0 ] || [ "$owner" = "$(id -u)" ] ||+ die "Install directory ancestor is owned by an untrusted user: ${current}"+ if path_is_group_or_other_writable "$current" && ! path_is_trusted_sticky_parent "$current"; then+ die "Install directory ancestor is writable by another user or group: ${current}"+ fi+ ! path_has_unsafe_acl "$current" || die "Install directory ancestor has an unsafe writable ACL: ${current}"+ fi+ done+}++validate_install_directory() {+ local requested home_canonical probe+ [ -n "$DIR" ] || die 'Install directory cannot be empty.'+ case "$DIR" in+ *'//'*) die "Install directory contains redundant path separators: ${DIR}" ;;+ esac+ case "$DIR" in+ /*) requested="${DIR%/}" ;;+ *) requested="$(pwd -P)/${DIR%/}" ;;+ esac+ [ -n "$requested" ] || requested='/'+ walk_existing_path "$requested"++ home_canonical="$(cd "$HOME" && pwd -P)" || die "Could not resolve the current user's home directory."+ case "$requested" in+ / | "$home_canonical" | /Applications | /bin | /boot | /dev | /etc | /home | /Library | /lib | /lib64 | /opt | /private | /proc | /root | /run | /sbin | /srv | /System | /tmp | /Users | /usr | /var | /Volumes)+ die "Refusing broad or system install directory: ${requested}"+ ;;+ esac++ if [ -e "$requested" ] || [ -L "$requested" ]; then+ [ ! -L "$requested" ] || die "Install directory is a symlink: ${requested}"+ [ -d "$requested" ] || die "Install directory is not a directory: ${requested}"+ [ "$(path_owner_uid "$requested")" = "$(id -u)" ] ||+ die "Install directory is not owned by the current user: ${requested}"+ ! path_is_group_or_other_writable "$requested" ||+ die "Install directory is writable by another user or group: ${requested}"+ [ "$(path_mode "$requested")" = 700 ] ||+ die "Existing install directory must already be private mode 0700: ${requested}"+ ! path_has_extended_acl "$requested" ||+ die "Install directory has an extended ACL; use a new private directory: ${requested}"+ else+ probe="$(dirname "$requested")"+ while [ ! -e "$probe" ] && [ ! -L "$probe" ]; do probe="$(dirname "$probe")"; done+ [ ! -L "$probe" ] || die "Install directory parent is a symlink: ${probe}"+ if path_is_group_or_other_writable "$probe" && ! path_is_trusted_sticky_parent "$probe"; then+ die "Install directory parent is writable by another user or group: ${probe}"+ fi+ fi+ DIR="$requested"+}++prepare_install_directory() {+ local current='' component created=false+ local -a components+ validate_install_directory+ [ -d "$DIR" ] && return+ IFS='/' read -r -a components <<<"${DIR#/}"+ for component in "${components[@]}"; do+ [ -n "$component" ] || continue+ current="${current}/${component}"+ if [ -e "$current" ] || [ -L "$current" ]; then+ if [ -L "$current" ] || [ ! -d "$current" ]; then+ die "Install directory changed during setup: ${current}"+ fi+ continue+ fi+ if ! (umask 077 && mkdir "$current"); then+ die "Install directory changed during setup; refusing to reuse it: ${current}"+ fi+ created=true+ done+ [ "$created" = true ] || die "Install directory was not created safely: ${DIR}"+ validate_install_directory+ chmod 0700 "$DIR"+}++validate_private_file() {+ local file="$1" description="$2"+ [ ! -L "$file" ] || die "Refusing symlink for ${description}: ${file}"+ [ -f "$file" ] || die "${description} is not a regular file: ${file}"+ [ "$(path_owner_uid "$file")" = "$(id -u)" ] || die "${description} is not owned by the current user: ${file}"+ [ "$(path_link_count "$file")" = 1 ] || die "${description} has multiple hard links: ${file}"+ if path_has_extended_acl "$file"; then+ chmod -N "$file" || die "Could not remove the extended ACL from ${description}: ${file}"+ ! path_has_extended_acl "$file" || die "${description} retains an extended ACL: ${file}"+ fi+ chmod 0600 "$file"+}++prepare_state() {+ local id_file="${DIR}/install-id" state_file="${DIR}/install-state"+ if [ ! -e "$id_file" ] && [ ! -L "$id_file" ]; then+ (umask 077 && od -An -N16 -tx1 /dev/urandom | tr -d ' \n' >"$id_file") ||+ die 'Could not create a private installer identity.'+ fi+ validate_private_file "$id_file" 'Installer identity'+ INSTALL_ID="$(<"$id_file")"+ [[ "$INSTALL_ID" =~ ^[0-9a-f]{32}$ ]] || die "Installer identity has invalid contents: ${id_file}"+ if [ -e "$state_file" ] || [ -L "$state_file" ]; then+ validate_private_file "$state_file" 'Installer lifecycle state'+ [ "$(<"$state_file")" = "contract=1 lifecycle=established volume=${DATA_VOLUME} install-id=${INSTALL_ID}" ] ||+ die "Installer lifecycle state has invalid contents: ${state_file}"+ VOLUME_ESTABLISHED=true+ fi+}++mark_install_established() {+ local state_file="${DIR}/install-state" temp_file+ if [ "$VOLUME_ESTABLISHED" = true ]; then return; fi+ temp_file="$(mktemp "${DIR}/.install-state.XXXXXX")" || die 'Could not create installer lifecycle state.'+ chmod 0600 "$temp_file"+ printf 'contract=1 lifecycle=established volume=%s install-id=%s\n' "$DATA_VOLUME" "$INSTALL_ID" >"$temp_file" || {+ rm -f "$temp_file"+ die 'Could not write installer lifecycle state.'+ }+ if [ -e "$state_file" ] || [ -L "$state_file" ]; then+ rm -f "$temp_file"+ die "Installer lifecycle state appeared during setup: ${state_file}"+ fi+ mv "$temp_file" "$state_file" || {+ rm -f "$temp_file"+ die 'Could not commit installer lifecycle state.'+ }+ validate_private_file "$state_file" 'Installer lifecycle state'+ VOLUME_ESTABLISHED=true+}++file_sha256() {+ if command -v sha256sum >/dev/null 2>&1; then+ sha256sum "$1" | awk '{print $1}'+ elif command -v shasum >/dev/null 2>&1; then+ shasum -a 256 "$1" | awk '{print $1}'+ else+ die 'sha256sum or shasum is required to bind the runtime configuration.'+ fi+}++prepare_environment() {+ ENV_FILE="${DIR}/autogpt.env"+ if [ ! -e "$ENV_FILE" ] && [ ! -L "$ENV_FILE" ]; then+ (umask 077 && printf '%s\n' \+ '# Private runtime configuration for the AutoGPT appliance.' \+ 'AUTOGPT_PUBLIC_URL=http://localhost:3000' >"$ENV_FILE")+ fi+ validate_private_file "$ENV_FILE" 'Runtime configuration'+ ENV_HASH="$(file_sha256 "$ENV_FILE")"+ [[ "$ENV_HASH" =~ ^[0-9a-f]{64}$ ]] || die 'Could not hash the runtime configuration.'+ ok "Private runtime configuration: ${ENV_FILE}"+}++preflight() {+ step 'Hardware pre-flight checks'+ local ram_gb=0 ram_value='' target_dir free_gb+ info "Host OS: ${OS_FAMILY} (${ARCH}); the selected Docker daemon is validated separately."+ if [ "$OS_FAMILY" = linux ]; then+ ram_value="$(awk '/MemTotal/{print $2}' /proc/meminfo 2>/dev/null || true)"+ [[ "$ram_value" =~ ^[0-9]+$ ]] && ram_gb=$((ram_value / 1024 / 1024))+ else+ ram_value="$(sysctl -n hw.memsize 2>/dev/null || true)"+ [[ "$ram_value" =~ ^[0-9]+$ ]] && ram_gb=$((ram_value / 1024 / 1024 / 1024))+ fi+ if [ "$ram_gb" -eq 0 ]; then warn 'Could not determine installed RAM.'+ elif [ "$ram_gb" -lt "$MIN_RAM_GB" ]; then warn "Only ${ram_gb} GB RAM; ${MIN_RAM_GB} GB or more is recommended."+ else ok "${ram_gb} GB RAM"; fi++ target_dir="$DIR"+ while [ ! -d "$target_dir" ] && [ "$target_dir" != / ]; do target_dir="$(dirname "$target_dir")"; done+ free_gb="$(df -Pk "$target_dir" 2>/dev/null | awk 'NR==2{print int($4/1024/1024)}')"+ if [ "${free_gb:-0}" -lt "$MIN_DISK_GB" ]; then+ warn "Only ${free_gb:-0} GB free on the state filesystem. Docker may use another storage root; verify at least ${MIN_DISK_GB} GB there."+ else ok "${free_gb} GB free on the state filesystem (Docker storage is validated by the image pull)"; fi+}++normalize_arch() {+ case "$1" in+ amd64 | x86_64) printf 'amd64\n' ;;+ arm64 | aarch64) printf 'arm64\n' ;;+ *) return 1 ;;+ esac+}++validate_docker() {+ step 'Validating the local Docker daemon'+ local endpoint context daemon_os daemon_arch raw_arch+ command -v docker >/dev/null 2>&1 ||+ die 'Docker is required. Install it from https://docs.docker.com/engine/install/ or https://docs.docker.com/desktop/, start it, then retry.'+ if [ -n "${DOCKER_HOST:-}" ]; then+ endpoint="$DOCKER_HOST"+ else+ context="$(docker context show 2>/dev/null)" || die 'Could not read the selected Docker context.'+ endpoint="$(docker context inspect "$context" --format '{{(index .Endpoints "docker").Host}}' 2>/dev/null)" ||+ die 'Could not inspect the selected Docker context.'+ fi+ case "$endpoint" in+ unix://*) ;;+ *) die "Refusing non-local Docker endpoint: ${endpoint}. Select a local unix:// context." ;;+ esac+ docker info >/dev/null 2>&1 || die 'The local Docker daemon is not running or is not accessible. Start Docker and retry.'+ read -r daemon_os raw_arch < <(docker info --format '{{.OSType}} {{.Architecture}}') || die 'Could not inspect the Docker daemon platform.'+ [ "$daemon_os" = linux ] || die "Docker is using ${daemon_os:-an unknown mode}; switch Docker Desktop to Linux containers and retry."+ daemon_arch="$(normalize_arch "$raw_arch")" || die "Unsupported Docker daemon architecture: ${raw_arch:-unknown}. Use amd64 or arm64."+ DAEMON_ARCH="$daemon_arch"+ ok "Local Docker Linux daemon (${DAEMON_ARCH})"+}++validate_image() {+ local title source revision image_os raw_arch image_arch digest_output digest_hashes unique_digests digest line count=0+ title="$(docker image inspect --format '{{index .Config.Labels "org.opencontainers.image.title"}}' "$IMAGE")" || die 'Could not inspect appliance image title.'+ source="$(docker image inspect --format '{{index .Config.Labels "org.opencontainers.image.source"}}' "$IMAGE")" || die 'Could not inspect appliance image source.'+ revision="$(docker image inspect --format '{{index .Config.Labels "org.opencontainers.image.revision"}}' "$IMAGE")" || die 'Could not inspect appliance image revision.'+ [ "$title" = "$EXPECTED_TITLE" ] || die "Image ${IMAGE} is not the AutoGPT appliance (unexpected OCI title)."+ [ "$source" = "$EXPECTED_SOURCE" ] || die "Image ${IMAGE} is not from the expected AutoGPT source repository."+ [[ "$revision" =~ ^[0-9a-f]{40}$ ]] || die "Image ${IMAGE} has an invalid source revision label."+ read -r image_os raw_arch < <(docker image inspect --format '{{.Os}} {{.Architecture}}' "$IMAGE") || die 'Could not inspect appliance image platform.'+ [ "$image_os" = linux ] || die "Image ${IMAGE} is not a Linux appliance image."+ image_arch="$(normalize_arch "$raw_arch")" || die "Image ${IMAGE} has unsupported architecture: ${raw_arch:-unknown}."+ [ "$image_arch" = "$DAEMON_ARCH" ] || die "Image architecture ${image_arch} does not match Docker daemon architecture ${DAEMON_ARCH}."++ digest_output="$(docker image inspect --format '{{range .RepoDigests}}{{println .}}{{end}}' "$IMAGE")" || die 'Could not resolve the appliance repository digest.'+ digest_hashes=''+ while IFS= read -r line; do+ [ -n "$line" ] || continue+ digest="${line##*@}"+ case "$line" in+ docker.io/significantgravitas/autogpt@* | significantgravitas/autogpt@*) ;;+ *) die "Image ${IMAGE} resolved to an unexpected repository digest: ${line}" ;;+ esac+ [[ "$digest" =~ ^sha256:[0-9a-f]{64}$ ]] || die "Image ${IMAGE} has an invalid repository digest."+ digest_hashes="${digest_hashes}${digest}"$'\n'+ done <<<"$digest_output"+ unique_digests="$(printf '%s' "$digest_hashes" | sort -u)" || die 'Could not deduplicate appliance repository digests.'+ while IFS= read -r line; do+ [ -n "$line" ] || continue+ count=$((count + 1))+ digest="$line"+ done <<<"$unique_digests"+ [ "$count" -eq 1 ] || die "Image ${IMAGE} must resolve to exactly one native repository digest; found ${count}."+ IMAGE_DIGEST="${DEPLOY_IMAGE}@${digest}"+ ok "Appliance identity: ${IMAGE_DIGEST}"+}++prepare_image() {+ step "Pulling published appliance image: ${IMAGE}"+ docker pull "$IMAGE" || die "Published appliance image ${IMAGE} is unavailable. Retry after publication completes or choose an existing --release vX.Y.Z."+ validate_image+}++validate_volume() {+ local metadata+ if docker volume inspect "$DATA_VOLUME" >/dev/null 2>&1; then+ metadata="$(docker volume inspect --format "{{.Driver}} {{index .Labels \"${OWNER_LABEL_KEY}\"}} {{index .Labels \"${CONTRACT_LABEL_KEY}\"}} {{index .Labels \"${INSTALL_ID_LABEL_KEY}\"}}" "$DATA_VOLUME")" || die 'Could not inspect the persistent volume.'+ [ "$metadata" = "local ${OWNER_LABEL_VALUE} ${CONTRACT_LABEL_VALUE} ${INSTALL_ID}" ] ||+ die "Refusing existing unowned or incompatible volume: ${DATA_VOLUME}"+ return+ fi+ [ "$VOLUME_ESTABLISHED" = false ] ||+ die "Installer state already exists but persistent volume ${DATA_VOLUME} is missing. Refusing to create an empty replacement; restore the volume or use a new --dir."+ docker volume create --driver local \+ --label "${OWNER_LABEL_KEY}=${OWNER_LABEL_VALUE}" \+ --label "${CONTRACT_LABEL_KEY}=${CONTRACT_LABEL_VALUE}" \+ --label "${INSTALL_ID_LABEL_KEY}=${INSTALL_ID}" \+ "$DATA_VOLUME" >/dev/null || die 'Could not create the persistent volume.'+ metadata="$(docker volume inspect --format "{{.Driver}} {{index .Labels \"${OWNER_LABEL_KEY}\"}} {{index .Labels \"${CONTRACT_LABEL_KEY}\"}} {{index .Labels \"${INSTALL_ID_LABEL_KEY}\"}}" "$DATA_VOLUME")" || die 'Could not verify the persistent volume.'+ [ "$metadata" = "local ${OWNER_LABEL_VALUE} ${CONTRACT_LABEL_VALUE} ${INSTALL_ID}" ] ||+ die "Persistent volume ownership verification failed: ${DATA_VOLUME}"+}++inspect_container() {+ local format="$1"+ docker container inspect --format "$format" "$CONTAINER_NAME"+}++reuse_existing_container() {+ local labels image runtime process state health+ labels="$(inspect_container "{{index .Config.Labels \"${OWNER_LABEL_KEY}\"}} {{index .Config.Labels \"${CONTRACT_LABEL_KEY}\"}} {{index .Config.Labels \"${INSTALL_ID_LABEL_KEY}\"}} {{index .Config.Labels \"${ENV_HASH_LABEL_KEY}\"}}")" ||+ die "Could not inspect existing container ${CONTAINER_NAME}."+ [ "$labels" = "${OWNER_LABEL_VALUE} ${CONTRACT_LABEL_VALUE} ${INSTALL_ID} ${ENV_HASH}" ] ||+ die "Refusing existing container ${CONTAINER_NAME}: installer ownership or configuration identity does not match."++ image="$(inspect_container '{{.Config.Image}}')" || die "Could not inspect existing container image."+ [ "$image" = "$IMAGE_DIGEST" ] ||+ die "Refusing existing container ${CONTAINER_NAME}: immutable appliance digest does not match ${IMAGE_DIGEST}."++ runtime="$(inspect_container '{{.HostConfig.Privileged}}|{{.HostConfig.NetworkMode}}|{{.HostConfig.RestartPolicy.Name}}|{{.Config.StopTimeout}}|{{.HostConfig.ShmSize}}|{{.HostConfig.LogConfig.Type}}|{{index .HostConfig.LogConfig.Config "max-size"}}|{{index .HostConfig.LogConfig.Config "max-file"}}|{{len .HostConfig.Ulimits}}|{{range .HostConfig.Ulimits}}{{.Name}}:{{.Soft}}:{{.Hard}}{{end}}|{{len .Mounts}}|{{range .Mounts}}{{.Type}}:{{.Name}}:{{.Destination}}:{{.RW}}{{end}}|{{len .HostConfig.PortBindings}}|{{range $key, $bindings := .HostConfig.PortBindings}}{{$key}}={{range $bindings}}{{.HostIp}}:{{.HostPort}}{{end}}{{end}}')" ||+ die "Could not inspect existing container runtime contract."+ [ "$runtime" = 'false|bridge|unless-stopped|360|2147483648|json-file|50m|5|1|nofile:65536:65536|1|volume:autogpt-platform-data:/data:true|1|3000/tcp=127.0.0.1:3000' ] ||+ die "Refusing existing container ${CONTAINER_NAME}: critical runtime contract has drifted."++ process="$(inspect_container '{{json .Config.Entrypoint}}|{{json .Config.Cmd}}')" ||+ die "Could not inspect existing container process contract."+ [ "$process" = '["/usr/bin/tini","--","/opt/autogpt/single-container/entrypoint.sh"]|["/usr/bin/supervisord","-n","-c","/opt/autogpt/single-container/supervisor/supervisord.conf"]' ] ||+ die "Refusing existing container ${CONTAINER_NAME}: entrypoint or command was overridden."++ state="$(inspect_container '{{.State.Status}}')" || die "Could not inspect existing container state."+ case "$state" in+ running)+ health="$(inspect_container '{{if .State.Health}}{{.State.Health.Status}}{{end}}')" || die "Could not inspect existing container health."+ case "$health" in+ healthy) ok 'Existing installer-owned appliance already matches the requested immutable contract.' ;;+ starting) info 'Existing installer-owned appliance is still starting; continuing to the health wait.' ;;+ *) die "Existing installer-owned container is running but not healthy (health=${health:-none})." ;;+ esac+ ;;+ created | exited)+ step 'Starting the existing installer-owned appliance'+ docker start "$CONTAINER_NAME" >/dev/null || die 'Could not start the existing installer-owned appliance.'+ ;;+ *) die "Existing installer-owned container is in unsupported state: ${state}" ;;+ esac+}++start_appliance() {+ validate_volume+ mark_install_established+ if docker container inspect "$CONTAINER_NAME" >/dev/null 2>&1; then+ reuse_existing_container+ return+ fi+ step 'Starting the AutoGPT appliance'+ docker run --detach \+ --name "$CONTAINER_NAME" \+ --label "${OWNER_LABEL_KEY}=${OWNER_LABEL_VALUE}" \+ --label "${CONTRACT_LABEL_KEY}=${CONTRACT_LABEL_VALUE}" \+ --label "${INSTALL_ID_LABEL_KEY}=${INSTALL_ID}" \+ --label "${ENV_HASH_LABEL_KEY}=${ENV_HASH}" \+ --restart unless-stopped \+ --stop-timeout 360 \+ --shm-size 2g \+ --ulimit nofile=65536:65536 \+ --log-driver json-file \+ --log-opt max-size=50m \+ --log-opt max-file=5 \+ --env-file "$ENV_FILE" \+ --publish 127.0.0.1:3000:3000 \+ --volume "${DATA_VOLUME}:/data" \+ "$IMAGE_DIGEST" >/dev/null || die 'Could not start the appliance. The persistent volume was not removed.'+}++wait_for_healthy() {+ step 'Waiting for the appliance to become healthy'+ local attempt status state health+ for ((attempt = 1; attempt <= 180; attempt++)); do+ status="$(docker inspect --format '{{.State.Status}} {{if .State.Health}}{{.State.Health.Status}}{{end}}' "$CONTAINER_NAME")" ||+ die "Could not inspect appliance container ${CONTAINER_NAME}; it may have been removed."+ read -r state health <<<"$status"+ if [ "${state}:${health}" = running:healthy ]; then ok 'AutoGPT is healthy'; return; fi+ case "${state}:${health}" in+ exited:* | dead:* | removing:* | *:unhealthy)+ docker logs --tail 100 "$CONTAINER_NAME" >&2 || true+ die "The appliance failed while starting (state=${state}, health=${health:-none})."+ ;;+ esac+ sleep 5+ done+ docker logs --tail 100 "$CONTAINER_NAME" >&2 || true+ die 'The appliance did not become healthy within 15 minutes.'+}++say ''+say '============================================='+say ' AutoGPT Platform Installer'+say '============================================='++if [ "$CHECK_DIR_ONLY" = true ]; then+ validate_install_directory+ info "Validated install directory: ${DIR}"+ exit 0+fi++resolve_version+if [ "$RESOLVE_ONLY" = true ]; then+ info "Selected release -> ${VER_REF} -> ${IMAGE}"+ exit 0+fi++validate_install_directory+if [ "$SKIP_PREFLIGHT" = true ]; then warn 'Hardware pre-flight skipped; Docker locality and appliance identity checks remain mandatory.'; else preflight; fi+validate_docker+if [ "$PREFLIGHT_ONLY" = true ]; then say ''; say '(--preflight-only: nothing was installed.)'; exit 0; fi++prepare_install_directory+prepare_state+prepare_environment+prepare_image+info "Selected release -> ${VER_REF} -> ${IMAGE_DIGEST}"+start_appliance+wait_for_healthy++say ''+say '============================================='+say ' AutoGPT is ready at http://localhost:3000'+say '============================================='+say "Configuration: ${ENV_FILE}"+say "Persistent data: Docker volume ${DATA_VOLUME}"+say "Immutable appliance: ${IMAGE_DIGEST}"+say 'Registration starts open. Create the intended account, promote it, then close signup as documented.'diff --git a/autogpt_platform/installer/test-single-container-handoff.sh b/autogpt_platform/installer/test-single-container-handoff.shnew file mode 100755index 0000000000..7a89beb7eb--- /dev/null+++ b/autogpt_platform/installer/test-single-container-handoff.sh@@ -0,0 +1,508 @@+#!/usr/bin/env bash+set -Eeuo pipefail++repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"+installer="${repo_root}/autogpt_platform/installer/install.sh"+test_root="$(mktemp -d)"+test_root="$(cd "$test_root" && pwd -P)"+trap 'rm -rf "${test_root}"' EXIT++assert_contains() {+ local expected="$1" actual="$2"+ grep -Fq -- "$expected" <<<"$actual" || {+ printf 'missing expected text: %s\nactual output:\n%s\n' "$expected" "$actual" >&2+ return 1+ }+}++assert_not_contains() {+ local unexpected="$1" actual="$2"+ if grep -Fq -- "$unexpected" <<<"$actual"; then+ printf 'unexpected text: %s\nactual output:\n%s\n' "$unexpected" "$actual" >&2+ return 1+ fi+}++assert_fails_with() {+ local expected="$1"+ shift+ local output+ if output="$("$@" 2>&1)"; then+ printf 'command unexpectedly succeeded: %q ' "$@" >&2+ printf '\n' >&2+ return 1+ fi+ assert_contains "$expected" "$output"+}++file_mode() {+ if stat -c '%a' "$1" >/dev/null 2>&1; then stat -c '%a' "$1"; else stat -f '%Lp' "$1"; fi+}++default_home="${test_root}/default-home"+mkdir -m 0700 "$default_home"+default_dir_output="$(env -u XDG_CONFIG_HOME HOME="$default_home" bash "$installer" --check-dir-only)"+assert_contains "Validated install directory: ${default_home}/.config/autogpt" "$default_dir_output"+xdg_trailing_output="$(XDG_CONFIG_HOME="${default_home}/.config/" HOME="$default_home" bash "$installer" --check-dir-only)"+assert_contains "Validated install directory: ${default_home}/.config/autogpt" "$xdg_trailing_output"++bootstrap_bin="${test_root}/bootstrap-bin"+bootstrap_executed="${test_root}/bootstrap-executed"+mkdir "$bootstrap_bin"+cat >"${bootstrap_bin}/curl" <<'FAKE_CURL'+#!/bin/sh+set -eu+output=''+while [ $# -gt 0 ]; do+ if [ "$1" = -o ]; then output="$2"; shift; fi+ shift+done+printf 'partial installer\n' >"$output"+exit 22+FAKE_CURL+cat >"${bootstrap_bin}/bash" <<'FAKE_BASH'+#!/bin/sh+touch "${BOOTSTRAP_EXECUTED:?}"+exit 0+FAKE_BASH+chmod +x "${bootstrap_bin}/curl" "${bootstrap_bin}/bash"+if PATH="${bootstrap_bin}:${PATH}" BOOTSTRAP_EXECUTED="$bootstrap_executed" /bin/sh -c '+ ( installer="$(mktemp)" && trap '\''rm -f "$installer"'\'' EXIT &&+ curl --proto '\''=https'\'' --proto-redir '\''=https'\'' --tlsv1.2 -fsSL \+ -o "$installer" https://setup.agpt.co/install.sh && bash "$installer" )+'; then+ printf 'failed bootstrap download unexpectedly succeeded\n' >&2+ exit 1+fi+[ ! -e "$bootstrap_executed" ] || {+ printf 'partial bootstrap content was executed after a failed download\n' >&2+ exit 1+}++bootstrap_docs=(docs/platform/installer.md autogpt_platform/installer/install.sh)+if grep -En 'curl[^`]*\|[^`]*bash|install\.(bat|ps1)|Invoke-WebRequest' "${bootstrap_docs[@]}"; then+ printf 'unsafe or stale installer bootstrap remains in public docs\n' >&2+ exit 1+fi+grep -Fq -- "--proto '=https' --proto-redir '=https' --tlsv1.2" autogpt_platform/installer/install.sh++latest_output="$(bash "$installer" --resolve-only)"+assert_contains 'Selected release -> latest -> docker.io/significantgravitas/autogpt:latest' "$latest_output"++release_output="$(bash "$installer" --resolve-only --release autogpt-platform-beta-v1.2.3)"+assert_contains 'Selected release -> autogpt-platform-beta-v1.2.3 -> docker.io/significantgravitas/autogpt:v1.2.3' "$release_output"++short_release_output="$(bash "$installer" --resolve-only --release v2.3.4)"+assert_contains 'Selected release -> v2.3.4 -> docker.io/significantgravitas/autogpt:v2.3.4' "$short_release_output"++assert_fails_with 'Expected autogpt-platform-beta-vX.Y.Z or vX.Y.Z' bash "$installer" --resolve-only --release latest+assert_fails_with 'needs a non-empty value' bash "$installer" --resolve-only --release=+assert_fails_with 'Unknown flag: --dev' bash "$installer" --resolve-only --dev+assert_fails_with 'Unknown flag: --branch' bash "$installer" --resolve-only --branch dev+assert_fails_with 'needs a value, not another option' bash "$installer" --release --resolve-only+assert_fails_with 'needs a value, not another option' bash "$installer" --dir --resolve-only++# macOS /bin/bash 3.2 must reject root without expanding an unset empty array.+assert_fails_with 'Refusing broad or system install directory: /' bash "$installer" --check-dir-only --dir /+assert_fails_with 'Refusing broad or system install directory' bash "$installer" --check-dir-only --dir "$HOME"+assert_fails_with "contains an unsafe '.' component" bash "$installer" --check-dir-only --dir "$HOME/."+assert_fails_with 'contains redundant path separators' bash "$installer" --check-dir-only --dir "$HOME//"++existing_dir="${test_root}/existing-install"+mkdir -m 0700 "$existing_dir"+bash "$installer" --check-dir-only --dir "$existing_dir" >/dev/null+test "$(file_mode "$existing_dir")" = 700++nonprivate_dir="${test_root}/nonprivate-install"+mkdir -m 0751 "$nonprivate_dir"+assert_fails_with 'must already be private mode 0700' bash "$installer" --check-dir-only --dir "$nonprivate_dir"++shared_dir="${test_root}/shared-install"+mkdir -m 0777 "$shared_dir"+assert_fails_with 'writable by another user or group' bash "$installer" --check-dir-only --dir "$shared_dir"++symlink_target="${test_root}/symlink-target"+symlink_dir="${test_root}/symlink-install"+mkdir "$symlink_target"+ln -s "$symlink_target" "$symlink_dir"+assert_fails_with 'symlink' bash "$installer" --check-dir-only --dir "$symlink_dir"++intermediate_target="${test_root}/intermediate-target"+intermediate_link="${test_root}/intermediate-link"+mkdir "$intermediate_target"+ln -s "$intermediate_target" "$intermediate_link"+assert_fails_with 'symlink component' bash "$installer" --check-dir-only --dir "${intermediate_link}/child"++if [ "$(uname -s)" = Darwin ]; then+ acl_dir="${test_root}/acl-install"+ mkdir -m 0700 "$acl_dir"+ chmod +a 'everyone allow read,write,execute,delete,append,readattr,writeattr,readextattr,writeextattr,readsecurity,writesecurity,chown' "$acl_dir"+ assert_fails_with 'ACL' bash "$installer" --check-dir-only --dir "$acl_dir"+ for acl_right in delete chown; do+ acl_parent="${test_root}/acl-parent-${acl_right}"+ mkdir -m 0700 "$acl_parent"+ chmod +a "everyone allow ${acl_right}" "$acl_parent"+ assert_fails_with 'unsafe writable ACL' bash "$installer" --check-dir-only --dir "${acl_parent}/private-state"+ done+elif [ "$(uname -s)" = Linux ]; then+ untrusted_parent="${test_root}/untrusted-owner"+ mkdir -m 0755 "$untrusted_parent"+ if [ "$(id -u)" -eq 0 ]; then+ chown 65534:65534 "$untrusted_parent"+ assert_fails_with 'owned by an untrusted user' bash "$installer" --check-dir-only --dir "${untrusted_parent}/private-state"+ elif command -v sudo >/dev/null 2>&1 && sudo -n chown 65534:65534 "$untrusted_parent"; then+ assert_fails_with 'owned by an untrusted user' bash "$installer" --check-dir-only --dir "${untrusted_parent}/private-state"+ sudo -n chown "$(id -u):$(id -g)" "$untrusted_parent"+ elif [ "${INSTALLER_REQUIRE_OWNERSHIP_TEST:-false}" = true ]; then+ printf 'ownership regression requires root or passwordless sudo\n' >&2+ exit 1+ fi+fi++fake_bin="${test_root}/fake-bin"+docker_log="${test_root}/docker.log"+volume_state="${test_root}/volume.state"+mkdir "$fake_bin"++cat >"${fake_bin}/docker" <<'FAKE_DOCKER'+#!/usr/bin/env bash+set -Eeuo pipefail+printf '%q ' "$@" >>"${FAKE_DOCKER_LOG:?}"+printf '\n' >>"${FAKE_DOCKER_LOG}"++if [ "${1:-}" = context ] && [ "${2:-}" = show ]; then+ printf 'default\n'+ exit 0+fi+if [ "${1:-}" = context ] && [ "${2:-}" = inspect ]; then+ printf '%s\n' "${FAKE_DOCKER_ENDPOINT:-unix:///var/run/docker.sock}"+ exit 0+fi+if [ "${1:-}" = info ]; then+ if [ "${2:-}" = --format ]; then+ printf '%s %s\n' "${FAKE_DOCKER_OS:-linux}" "${FAKE_DOCKER_ARCH:-x86_64}"+ fi+ exit 0+fi+if [ "${1:-}" = pull ]; then+ [ "${FAKE_DOCKER_PULL_FAIL:-false}" != true ]+ exit+fi+if [ "${1:-}" = image ] && [ "${2:-}" = inspect ]; then+ format="${4:-}"+ case "$format" in+ *org.opencontainers.image.title*) printf '%s\n' "${FAKE_IMAGE_TITLE:-AutoGPT Platform single-container}" ;;+ *org.opencontainers.image.source*) printf '%s\n' "${FAKE_IMAGE_SOURCE:-https://github.com/Significant-Gravitas/AutoGPT}" ;;+ *org.opencontainers.image.revision*) printf '%s\n' "${FAKE_IMAGE_REVISION:-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}" ;;+ '{{.Os}} {{.Architecture}}') printf '%s %s\n' "${FAKE_IMAGE_OS:-linux}" "${FAKE_IMAGE_ARCH:-amd64}" ;;+ *RepoDigests*)+ if [ "${FAKE_IMAGE_DIGESTS+x}" = x ]; then+ printf '%b' "$FAKE_IMAGE_DIGESTS"+ else+ printf '%b' 'significantgravitas/autogpt@sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\n'+ fi+ ;;+ *) printf 'unexpected image inspect format: %s\n' "$format" >&2; exit 71 ;;+ esac+ exit 0+fi+if [ "${1:-}" = container ] && [ "${2:-}" = inspect ]; then+ [ "${FAKE_CONTAINER_EXISTS:-false}" = true ] || exit 1+ if [ "${3:-}" != --format ]; then exit 0; fi+ format="${4:-}"+ case "$format" in+ *com.agpt.installer.owner*)+ if command -v sha256sum >/dev/null 2>&1; then+ env_hash="$(sha256sum "${FAKE_INSTALL_DIR:?}/autogpt.env" | awk '{print $1}')"+ else+ env_hash="$(shasum -a 256 "${FAKE_INSTALL_DIR:?}/autogpt.env" | awk '{print $1}')"+ fi+ printf '%s\n' "${FAKE_CONTAINER_LABELS:-autogpt-platform-installer 1 $(cat "${FAKE_INSTALL_DIR}/install-id") ${env_hash}}"+ ;;+ '{{.Config.Image}}')+ printf '%s\n' "${FAKE_CONTAINER_IMAGE:-docker.io/significantgravitas/autogpt@sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb}"+ ;;+ *HostConfig.Privileged*)+ printf '%s\n' "${FAKE_CONTAINER_RUNTIME:-false|bridge|unless-stopped|360|2147483648|json-file|50m|5|1|nofile:65536:65536|1|volume:autogpt-platform-data:/data:true|1|3000/tcp=127.0.0.1:3000}"+ ;;+ *Config.Entrypoint*)+ printf '%s\n' "${FAKE_CONTAINER_PROCESS:-[\"/usr/bin/tini\",\"--\",\"/opt/autogpt/single-container/entrypoint.sh\"]|[\"/usr/bin/supervisord\",\"-n\",\"-c\",\"/opt/autogpt/single-container/supervisor/supervisord.conf\"]}"+ ;;+ '{{.State.Status}}') printf '%s\n' "${FAKE_CONTAINER_STATE:-running}" ;;+ *State.Health*) printf '%s\n' "${FAKE_CONTAINER_HEALTH:-healthy}" ;;+ *) printf 'unexpected container inspect format: %s\n' "$format" >&2; exit 72 ;;+ esac+ exit 0+fi+if [ "${1:-}" = volume ] && [ "${2:-}" = inspect ]; then+ if [ ! -s "${FAKE_VOLUME_STATE:?}" ]; then exit 1; fi+ if [ "${3:-}" = --format ]; then+ if [ "$(cat "$FAKE_VOLUME_STATE")" = unowned ]; then+ printf 'local <no value> <no value> <no value>\n'+ else+ printf 'local autogpt-platform-installer 1 %s\n' "$(cat "${FAKE_INSTALL_DIR:?}/install-id")"+ fi+ fi+ exit 0+fi+if [ "${1:-}" = volume ] && [ "${2:-}" = create ]; then+ printf 'owned\n' >"${FAKE_VOLUME_STATE:?}"+ printf 'autogpt-platform-data\n'+ exit 0+fi+if [ "${1:-}" = run ]; then+ if [ "${FAKE_DOCKER_RUN_FAIL:-false}" = true ]; then exit 1; fi+ printf 'fake-container-id\n'+ exit 0+fi+if [ "${1:-}" = start ]; then+ printf '%s\n' "${2:-}"+ exit 0+fi+if [ "${1:-}" = inspect ]; then+ [ "${FAKE_HEALTH_INSPECT_FAIL:-false}" != true ] || exit 1+ printf 'running healthy\n'+ exit 0+fi+if [ "${1:-}" = logs ]; then exit 0; fi+printf 'unexpected fake docker invocation: %s\n' "$*" >&2+exit 70+FAKE_DOCKER+chmod +x "${fake_bin}/docker"++run_installer() {+ local install_dir="$1"+ shift+ FAKE_DOCKER_LOG="$docker_log" \+ FAKE_VOLUME_STATE="$volume_state" \+ FAKE_INSTALL_DIR="$install_dir" \+ PATH="${fake_bin}:${PATH}" \+ bash "$installer" --skip-preflight --dir "$install_dir" "$@"+}++assert_fake_fails() {+ local expected="$1" install_dir="$2"+ shift 2+ assert_fails_with "$expected" env \+ FAKE_DOCKER_LOG="$docker_log" \+ FAKE_VOLUME_STATE="$volume_state" \+ FAKE_INSTALL_DIR="$install_dir" \+ PATH="${fake_bin}:${PATH}" \+ "$@"+}++: >"$docker_log"+: >"$volume_state"+default_dir="${test_root}/default-install"+run_installer "$default_dir"+log="$(cat "$docker_log")"+assert_contains 'pull docker.io/significantgravitas/autogpt:latest' "$log"+assert_contains 'run --detach' "$log"+assert_contains 'docker.io/significantgravitas/autogpt@sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' "$log"+assert_not_contains 'docker.io/significantgravitas/autogpt:latest' "$(grep '^run ' "$docker_log")"+assert_contains '--publish 127.0.0.1:3000:3000' "$log"+assert_contains '--restart unless-stopped' "$log"+assert_contains '--stop-timeout 360' "$log"+assert_contains '--volume autogpt-platform-data:/data' "$log"+assert_contains '--label com.agpt.installer.owner=autogpt-platform-installer' "$log"+assert_contains '--label com.agpt.installer.contract=1' "$log"+grep -Eq -- '--label com.agpt.installer.env-sha256=[0-9a-f]{64}' "$docker_log"+test "$(file_mode "$default_dir")" = 700+test "$(file_mode "${default_dir}/autogpt.env")" = 600+test "$(file_mode "${default_dir}/install-id")" = 600+test "$(file_mode "${default_dir}/install-state")" = 600+grep -Fxq 'AUTOGPT_PUBLIC_URL=http://localhost:3000' "${default_dir}/autogpt.env"++: >"$docker_log"+: >"$volume_state"+explicit_dir="${test_root}/explicit-install"+run_installer "$explicit_dir" --release v1.2.3+assert_contains 'pull docker.io/significantgravitas/autogpt:v1.2.3' "$(cat "$docker_log")"++remote_dir="${test_root}/remote-install"+assert_fake_fails 'Refusing non-local Docker endpoint: tcp://' "$remote_dir" \+ env DOCKER_HOST=tcp://example.invalid:2375 bash "$installer" --skip-preflight --dir "$remote_dir"++ssh_dir="${test_root}/ssh-install"+assert_fake_fails 'Refusing non-local Docker endpoint: ssh://' "$ssh_dir" \+ env FAKE_DOCKER_ENDPOINT=ssh://example.invalid bash "$installer" --skip-preflight --dir "$ssh_dir"++npipe_dir="${test_root}/npipe-install"+assert_fake_fails 'Refusing non-local Docker endpoint: npipe://' "$npipe_dir" \+ env FAKE_DOCKER_ENDPOINT=npipe:////./pipe/docker_engine bash "$installer" --skip-preflight --dir "$npipe_dir"++windows_dir="${test_root}/windows-daemon"+assert_fake_fails 'switch Docker Desktop to Linux containers' "$windows_dir" \+ env FAKE_DOCKER_OS=windows bash "$installer" --skip-preflight --dir "$windows_dir"++unsupported_arch_dir="${test_root}/unsupported-arch"+assert_fake_fails 'Unsupported Docker daemon architecture' "$unsupported_arch_dir" \+ env FAKE_DOCKER_ARCH=riscv64 bash "$installer" --skip-preflight --dir "$unsupported_arch_dir"++wrong_title_dir="${test_root}/wrong-title"+assert_fake_fails 'unexpected OCI title' "$wrong_title_dir" \+ env FAKE_IMAGE_TITLE='Not AutoGPT' bash "$installer" --skip-preflight --dir "$wrong_title_dir"++missing_digest_dir="${test_root}/missing-digest"+assert_fake_fails 'exactly one native repository digest; found 0' "$missing_digest_dir" \+ env FAKE_IMAGE_DIGESTS='' bash "$installer" --skip-preflight --dir "$missing_digest_dir"++multiple_digest_dir="${test_root}/multiple-digest"+multiple_digests='significantgravitas/autogpt@sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\nsignificantgravitas/autogpt@sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\n'+assert_fake_fails 'exactly one native repository digest; found 2' "$multiple_digest_dir" \+ env FAKE_IMAGE_DIGESTS="$multiple_digests" bash "$installer" --skip-preflight --dir "$multiple_digest_dir"++: >"$volume_state"+aliased_digest_dir="${test_root}/aliased-digest"+aliased_digests='significantgravitas/autogpt@sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\ndocker.io/significantgravitas/autogpt@sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\n'+(+ export FAKE_IMAGE_DIGESTS="$aliased_digests"+ run_installer "$aliased_digest_dir"+)+grep -Fxq 'contract=1 lifecycle=established volume=autogpt-platform-data install-id='"$(cat "${aliased_digest_dir}/install-id")" "${aliased_digest_dir}/install-state"++wrong_arch_dir="${test_root}/wrong-image-arch"+assert_fake_fails 'does not match Docker daemon architecture' "$wrong_arch_dir" \+ env FAKE_IMAGE_ARCH=arm64 bash "$installer" --skip-preflight --dir "$wrong_arch_dir"++collision_dir="${test_root}/container-collision"+assert_fake_fails 'installer ownership or configuration identity does not match' "$collision_dir" \+ env FAKE_CONTAINER_EXISTS=true FAKE_CONTAINER_LABELS='unowned 0 wrong wrong' bash "$installer" --skip-preflight --dir "$collision_dir"++: >"$docker_log"+printf 'owned\n' >"$volume_state"+FAKE_CONTAINER_EXISTS=true run_installer "$default_dir"+assert_not_contains 'run --detach' "$(cat "$docker_log")"+assert_contains 'container inspect --format' "$(cat "$docker_log")"++: >"$docker_log"+FAKE_CONTAINER_EXISTS=true FAKE_CONTAINER_STATE=exited run_installer "$default_dir"+assert_contains 'start autogpt' "$(cat "$docker_log")"++: >"$docker_log"+FAKE_CONTAINER_EXISTS=true FAKE_CONTAINER_HEALTH=starting run_installer "$default_dir"+assert_not_contains 'run --detach' "$(cat "$docker_log")"+assert_contains 'inspect --format' "$(cat "$docker_log")"++: >"$volume_state"+inspect_failure_dir="${test_root}/health-inspect-failure"+assert_fake_fails 'Could not inspect appliance container autogpt; it may have been removed' "$inspect_failure_dir" \+ env FAKE_HEALTH_INSPECT_FAIL=true bash "$installer" --skip-preflight --dir "$inspect_failure_dir"++drift_dir="${test_root}/runtime-drift"+mkdir -m 0700 "$drift_dir"+printf 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n' >"${drift_dir}/install-id"+printf 'AUTOGPT_PUBLIC_URL=http://localhost:3000\n' >"${drift_dir}/autogpt.env"+assert_fake_fails 'critical runtime contract has drifted' "$drift_dir" \+ env FAKE_CONTAINER_EXISTS=true FAKE_CONTAINER_RUNTIME='true|host|no|0|0|none||||0||0||0|' bash "$installer" --skip-preflight --dir "$drift_dir"++missing_volume_dir="${test_root}/missing-prior-volume"+mkdir -m 0700 "$missing_volume_dir"+printf 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n' >"${missing_volume_dir}/install-id"+printf 'AUTOGPT_PUBLIC_URL=http://localhost:3000\n' >"${missing_volume_dir}/autogpt.env"+printf 'contract=1 lifecycle=established volume=autogpt-platform-data install-id=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n' >"${missing_volume_dir}/install-state"+: >"$volume_state"+assert_fake_fails 'Installer state already exists but persistent volume autogpt-platform-data is missing' "$missing_volume_dir" \+ bash "$installer" --skip-preflight --dir "$missing_volume_dir"++retry_dir="${test_root}/retry-after-pull"+: >"$volume_state"+assert_fake_fails 'Published appliance image' "$retry_dir" \+ env FAKE_DOCKER_PULL_FAIL=true bash "$installer" --skip-preflight --dir "$retry_dir"+[ ! -e "${retry_dir}/install-state" ]+run_installer "$retry_dir"+test -f "${retry_dir}/install-state"+: >"$volume_state"+assert_fake_fails 'Installer state already exists but persistent volume autogpt-platform-data is missing' "$retry_dir" \+ bash "$installer" --skip-preflight --dir "$retry_dir"++run_failure_dir="${test_root}/run-failure"+: >"$volume_state"+assert_fake_fails 'Could not start the appliance' "$run_failure_dir" \+ env FAKE_DOCKER_RUN_FAIL=true bash "$installer" --skip-preflight --dir "$run_failure_dir"+test -f "${run_failure_dir}/install-state"+: >"$volume_state"+assert_fake_fails 'Installer state already exists but persistent volume autogpt-platform-data is missing' "$run_failure_dir" \+ bash "$installer" --skip-preflight --dir "$run_failure_dir"++unowned_volume_dir="${test_root}/unowned-volume"+printf 'unowned\n' >"$volume_state"+assert_fake_fails 'Refusing existing unowned or incompatible volume' "$unowned_volume_dir" \+ bash "$installer" --skip-preflight --dir "$unowned_volume_dir"++: >"$volume_state"+symlink_env_dir="${test_root}/symlink-env"+mkdir -m 0700 "$symlink_env_dir"+ln -s "${test_root}/outside.env" "${symlink_env_dir}/autogpt.env"+assert_fake_fails 'Refusing symlink for Runtime configuration' "$symlink_env_dir" \+ bash "$installer" --skip-preflight --dir "$symlink_env_dir"++hardlink_env_dir="${test_root}/hardlink-env"+mkdir -m 0700 "$hardlink_env_dir"+printf 'AUTOGPT_PUBLIC_URL=http://localhost:3000\n' >"${hardlink_env_dir}/autogpt.env"+ln "${hardlink_env_dir}/autogpt.env" "${test_root}/env-copy"+assert_fake_fails 'Runtime configuration has multiple hard links' "$hardlink_env_dir" \+ bash "$installer" --skip-preflight --dir "$hardlink_env_dir"++hardlink_state_dir="${test_root}/hardlink-state"+mkdir -m 0700 "$hardlink_state_dir"+printf 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n' >"${hardlink_state_dir}/install-id"+ln "${hardlink_state_dir}/install-id" "${test_root}/state-copy"+assert_fake_fails 'Installer identity has multiple hard links' "$hardlink_state_dir" \+ bash "$installer" --skip-preflight --dir "$hardlink_state_dir"++if [ "$(uname -s)" = Darwin ]; then+ acl_env_dir="${test_root}/acl-env"+ mkdir -m 0700 "$acl_env_dir"+ printf 'AUTOGPT_PUBLIC_URL=http://localhost:3000\n' >"${acl_env_dir}/autogpt.env"+ chmod +a 'everyone allow read,write' "${acl_env_dir}/autogpt.env"+ : >"$volume_state"+ run_installer "$acl_env_dir"+ # macOS exposes ACL entries through ls -le; find has no equivalent output.+ # shellcheck disable=SC2012+ if ls -lde "${acl_env_dir}/autogpt.env" | awk 'NR == 1 { exit substr($1, length($1), 1) == "+" ? 0 : 1 }'; then+ printf 'runtime configuration retained an extended ACL\n' >&2+ exit 1+ fi+fi++if [ "${INSTALLER_REAL_DOCKER_TEST:-false}" = true ]; then+ (+ set -Eeuo pipefail+ suffix="${BASHPID}"+ real_image="autogpt-installer-contract-smoke:${suffix}"+ real_volume="autogpt-installer-contract-smoke-${suffix}"+ real_container="autogpt-installer-contract-smoke-${suffix}"+ # ShellCheck cannot infer that EXIT invokes this callback.+ # shellcheck disable=SC2317,SC2329+ cleanup_real_contract() {+ docker container rm -f "$real_container" >/dev/null 2>&1 || true+ docker volume rm "$real_volume" >/dev/null 2>&1 || true+ docker image rm "$real_image" >/dev/null 2>&1 || true+ }+ trap cleanup_real_contract EXIT+ docker info >/dev/null+ tar -cf - --files-from /dev/null | docker import - "$real_image" >/dev/null+ docker volume create "$real_volume" >/dev/null+ docker create \+ --name "$real_container" \+ --restart unless-stopped \+ --stop-timeout 360 \+ --shm-size 2g \+ --ulimit nofile=65536:65536 \+ --log-driver json-file \+ --log-opt max-size=50m \+ --log-opt max-file=5 \+ --publish 127.0.0.1:3000:3000 \+ --volume "${real_volume}:/data" \+ "$real_image" /bin/true >/dev/null+ actual_contract="$(docker inspect --format '{{.HostConfig.Privileged}}|{{.HostConfig.NetworkMode}}|{{.HostConfig.RestartPolicy.Name}}|{{.Config.StopTimeout}}|{{.HostConfig.ShmSize}}|{{.HostConfig.LogConfig.Type}}|{{index .HostConfig.LogConfig.Config "max-size"}}|{{index .HostConfig.LogConfig.Config "max-file"}}|{{len .HostConfig.Ulimits}}|{{range .HostConfig.Ulimits}}{{.Name}}:{{.Soft}}:{{.Hard}}{{end}}|{{len .Mounts}}|{{range .Mounts}}{{.Type}}:{{.Name}}:{{.Destination}}:{{.RW}}{{end}}|{{len .HostConfig.PortBindings}}|{{range $key, $bindings := .HostConfig.PortBindings}}{{$key}}={{range $bindings}}{{.HostIp}}:{{.HostPort}}{{end}}{{end}}' "$real_container")"+ expected_contract="false|bridge|unless-stopped|360|2147483648|json-file|50m|5|1|nofile:65536:65536|1|volume:${real_volume}:/data:true|1|3000/tcp=127.0.0.1:3000"+ [ "$actual_contract" = "$expected_contract" ] || {+ printf 'real Docker runtime contract mismatch\nexpected: %s\nactual: %s\n' "$expected_contract" "$actual_contract" >&2+ exit 1+ }+ )+fi++printf 'installer shell tests passed\n'diff --git a/docs/platform/getting-started.md b/docs/platform/getting-started.mdindex 35fbf793aa..c0588b4ebb 100644--- a/docs/platform/getting-started.md+++ b/docs/platform/getting-started.md@@ -13,73 +13,53 @@ This guide will help you setup the server and builder for the project.## Prerequisites-To setup the server, you need to have the following installed:+The single-container appliance's only product prerequisite is an installed,+running Docker CLI and daemon. Select a local Docker endpoint using Linux+containers on `amd64` or `arm64`. The Unix bootstrap also uses Bash, curl, and+`sha256sum` or `shasum`. Docker Compose, Git, Node.js, and NPM are not required+for the appliance installer.-- [Node.js](https://nodejs.org/en/)-- [Docker](https://docs.docker.com/get-docker/)-- [Git](https://git-scm.com/downloads)+Install Docker from the [official Docker documentation](https://docs.docker.com/get-docker/),+start it, then verify the selected daemon:-### Checking if you have Node.js & NPM installed--We use Node.js to run our frontend application.--If you need assistance installing Node.js:-https://nodejs.org/en/download/--NPM is included with Node.js, but if you need assistance installing NPM:-https://docs.npmjs.com/downloading-and-installing-node-js-and-npm--You can check if you have Node.js & NPM installed by running the following command:--```bash-node -v-npm -v-```--Once you have Node.js installed, you can proceed to the next step.--### Checking if you have Docker & Docker Compose installed--Docker containerizes applications, while Docker Compose orchestrates multi-container Docker applications.--If you need assistance installing docker:-https://docs.docker.com/desktop/--Docker-compose is included in Docker Desktop, but if you need assistance installing docker compose:-https://docs.docker.com/compose/install/--You can check if you have Docker installed by running the following command:--```bash+```consoledocker -v-docker compose -v+docker info```-Once you have Docker and Docker Compose installed, you can proceed to the next step.+## Quick Setup with the Appliance Installer-## Quick Setup with Auto Setup Script (Recommended)-If you're self-hosting AutoGPT locally, we recommend using our official setup script to simplify the process. This will install dependencies (like Docker), pull the latest code, and launch the app with minimal effort.+The release installer pulls and starts the published single-container+appliance: one Docker container, one loopback port, no source checkout. It+needs a running Docker daemon with Linux containers on `amd64` or `arm64`; it+does not install Docker or build AutoGPT from source. See+[the installer reference](installer.md) for details.-For macOS/Linux:-```-curl -fsSL https://setup.agpt.co/install.sh -o install.sh && bash install.sh-```+The hosted installer is not live yet: `setup.agpt.co/install.sh` still serves+the Compose installer, and the appliance image tags are not public until the+[release gates](installer.md#maintainer-release-gates) pass. This first release+supports Linux and macOS. Until then, and on Windows, use the+[from-source setup](#manual-setup) below, which is also the path that supports+a fully offline install with a local LLM.-For Windows (PowerShell):-```-powershell -c "iwr https://setup.agpt.co/install.bat -o install.bat; ./install.bat"-```-This method is ideal if you're setting up for development or testing and want to skip manual configuration.+## Manual Setup-## Experimental single-container image+### Development prerequisites-For a small self-hosted installation that does not need a source checkout, see-[Run AutoGPT in one Docker container](single-container.md). The image bundles-the platform and its stateful services for one host; it is not the development-setup or a high-availability deployment.+The manual source checkout requires+[Git](https://git-scm.com/downloads),+[Node.js and NPM](https://nodejs.org/en/download/), Docker, and+[Docker Compose](https://docs.docker.com/compose/install/). Verify them before+continuing:-## Manual Setup+```console+git --version+node -v+npm -v+docker -v+docker compose version+```### Cloning the RepositoryThe first step is cloning the AutoGPT repository to your computer.@@ -160,8 +140,8 @@ make helpYou can check if the server is running by visiting [http://localhost:3000](http://localhost:3000) in your browser.**Notes:**--By default the application for different services run on the following ports:++By default the application for different services run on the following ports:Frontend UI Server: 3000Backend Websocket Server: 8001@@ -482,7 +462,7 @@ make formatTo run the tests:```sh-poetry run pytest -s+poetry run pytest -s```## Adding a New Agent Blockdiff --git a/docs/platform/installer.md b/docs/platform/installer.mdindex 0bb368038f..23880d4f97 100644--- a/docs/platform/installer.md+++ b/docs/platform/installer.md@@ -1,46 +1,196 @@-# AutoGPT Platform Installer+# AutoGPT Platform Release Installer-The AutoGPT Platform provides easy-to-use installers to help you quickly set up the platform on your system. This page covers how to use the installer scripts for both Linux/macOS and Windows.+The release installer runs the published AutoGPT Platform appliance as one+Docker container. It does not clone the repository, build AutoGPT, install+Docker, elevate privileges, or accept Docker Desktop license terms.-## What the Installer Does+The appliance exposes one loopback-only port. Application state and generated+secrets live in a named Docker volume; installer identity and runtime+configuration live in a dedicated private state directory.-The installer scripts will:+## Prerequisites-1. Check for required prerequisites (Git, Docker, npm)-2. Clone the AutoGPT repository-3. Set up the backend services using Docker-4. Set up the frontend application-5. Start both the backend and frontend services+Before running the installer:-## Prerequisites+- Install and start Docker from the+ [official Docker Engine](https://docs.docker.com/engine/install/) or+ [Docker Desktop](https://docs.docker.com/desktop/) documentation.+- Select a local `unix://` Docker endpoint on Linux or macOS. Remote and+ non-Unix contexts are rejected.+- Configure the daemon for Linux containers on `amd64` or `arm64`.+- Allow about 25 GB of free disk; at least 8 GB RAM is recommended.++Docker Desktop is a separate product with its own license terms. AutoGPT does+not install it or grant a Docker license.++## Install (After the Release Gates Pass)++> [!WARNING]+> Do not use the hosted command yet. `setup.agpt.co/install.sh` still serves+> the legacy Compose installer, and the appliance image tags are not public.+> Maintainers must complete every+> [release gate](#maintainer-release-gates) before exposing these commands in+> the README or getting-started guide.++This first appliance-installer release supports Linux and macOS. Windows is+intentionally withheld until its standard-user filesystem checks and native+Docker argument handling are validated; use the manual setup guide there.++The command below uses a unique temporary file, executes it only after the HTTPS+download succeeds, and removes it afterward. Do not stream a network response+directly into a shell.++### Linux and macOS-Before running the installer, make sure you have the following installed:+```bash+(+ installer="$(mktemp)" &&+ trap 'rm -f "$installer"' EXIT &&+ curl --proto '=https' --proto-redir '=https' --tlsv1.2 -fsSL \+ -o "$installer" https://setup.agpt.co/install.sh &&+ bash "$installer"+)+```++### Options++| Goal | Linux/macOS |+| --- | --- |+| Current published appliance | _(no flag)_ |+| Specific published version | `--release=vX.Y.Z` |+| Appliance release-tag form | `--release=autogpt-platform-beta-vX.Y.Z` |+| Hardware and Docker checks only | `--preflight-only` |+| Print image selection only | `--resolve-only` |+| Skip RAM/disk checks | `--skip-preflight` |+| Custom private state directory | `--dir=PATH` |++`--skip-preflight` does not skip the local-endpoint, Linux-container, or+architecture checks.++The default state directory is `$XDG_CONFIG_HOME/autogpt`, or+`$HOME/.config/autogpt` when `XDG_CONFIG_HOME` is unset. A custom directory+must be user-owned and private; the installer rejects symlink paths and shared+or unsafe locations.++## Artifact and Runtime Contract++With no release flag, the installer pulls+`significantgravitas/autogpt:latest`. An explicit `vX.Y.Z` selects the matching+version tag. After pulling, the installer:++1. Requires the expected OCI title and source repository plus a well-formed+ 40-hex source revision label.+2. Requires a Linux image matching the local daemon's `amd64` or `arm64`+ architecture.+3. Resolves exactly one native `RepoDigest` and runs that immutable digest,+ never the mutable tag.+4. Creates an installer-owned, labelled `autogpt-platform-data` volume.+5. Starts `autogpt` with `127.0.0.1:3000`, the private environment file,+ restart and stop policies, log rotation, shared memory, and file-descriptor+ limits.++The bootstrap authenticates transport with HTTPS, and the installer pins the+pulled image by digest after checking its appliance metadata. It does not+independently verify a publisher signature or protect against compromise of+the image-publishing credentials. Signed release artifacts are a follow-up,+not a claim made by this installer.++The installer refuses to adopt an unlabelled container or volume. A rerun is a+no-op, or starts a stopped container, only when the installer identity,+environment hash, immutable image digest, process, port, mount, privilege,+restart, logging, memory, and limit settings all match. Drift fails closed.++If established installer lifecycle state exists but its named volume is+missing, the installer refuses to create an empty replacement. An interrupted+first pull has no established marker and can be retried safely. Restore a+previously established volume or choose a new state directory.++## Runtime Configuration++The private `autogpt.env` initially contains:++```dotenv+AUTOGPT_PUBLIC_URL=http://localhost:3000+```-- **Git**: For cloning the repository-- **Docker**: For running the backend services-- **Node.js and npm**: For the frontend application+Add provider keys and other appliance variables there. The installer binds the+environment file's SHA-256 hash to the container label. To apply a deliberate+configuration change, stop and remove only the container, then rerun the same+installer release:-## Quick One-Liner Installation+```bash+docker stop --time 360 autogpt+docker rm autogpt+```-For convenience, you can use the following one-liner commands to install AutoGPT Platform:+Do not remove `autogpt-platform-data`; it contains accounts, agents, generated+secrets, and application state.-### Linux/macOS+## First Run++After the installer reports a healthy container, open+[http://localhost:3000](http://localhost:3000). Registration starts open so+you can create the intended account. Promote it:```bash-curl -fsSL https://setup.agpt.co/install.sh -o install.sh && bash install.sh+docker exec autogpt autogpt-admin promote [email protected]```-### Windows+Then set this in `autogpt.env`, recreate the container as described above, and+verify registration is closed:-```powershell-powershell -c "iwr https://setup.agpt.co/install.bat -o install.bat; ./install.bat"+```dotenv+AUTH_ALLOW_NEW_ACCOUNTS=false```-For a prebuilt, experimental alternative intended for small self-hosted-installations, see [Run AutoGPT in one Docker container](single-container.md).-That image is separate from the development-oriented installer described here.+Keep the default loopback binding. To serve other machines, place AutoGPT+behind a TLS reverse proxy and set `AUTOGPT_PUBLIC_URL` to the exact public URL.++## Upgrades-## Manual Installation+Before an upgrade, back up `autogpt-platform-data`. Stop and remove only the+`autogpt` container, then rerun the installer with the intended release. The+installer will reuse the named volume only when its ownership labels and the+private installer identity still match.++## Maintainer Release Gates++Repository CI cannot prove the public bootstrap handoff. Do not publish or+announce the installation commands until every external gate below passes:++- Deploy the new repository `install.sh` through the Caddy or object-storage+ configuration behind `setup.agpt.co`. The endpoint must no longer serve the+ legacy clone/Compose installer.+- Publish `significantgravitas/autogpt:vX.Y.Z` and `:latest` only after the+ multi-architecture workflow smoke-tests and scans both runnable images.+- Ensure the appliance release's tag commit contains the full installer,+ publication workflow, and helper, then verify the release-triggered run.+ Manual development dispatches publish SHA artifacts, not the release channel+ used by this installer.+- Verify both public tags expose Linux `amd64` and `arm64` manifests and the+ expected OCI identity:++ ```bash+ docker buildx imagetools inspect significantgravitas/autogpt:vX.Y.Z+ docker buildx imagetools inspect significantgravitas/autogpt:latest+ ```++- Fetch the hosted installer into a new temporary file from an external+ machine and compare it with the released repository file. On each supported+ operating system, perform a clean install against the public image, wait for+ health, verify the loopback endpoint, rerun to prove exact-contract+ idempotency, and confirm no mutable tag was used to create the container.++## Installing from source (Compose)++The scripts below are the other supported path: they clone the repository and+start every service with Docker Compose. Use them on Windows, for development,+or for a fully offline install with a local LLM. The appliance described above+is the image documented in+[Run AutoGPT in one Docker container](single-container.md); these scripts do+not use it.++### Manual InstallationIf you prefer, you can manually download and run the installer scripts:@@ -49,7 +199,7 @@ If you prefer, you can manually download and run the installer scripts:These scripts are located in the `autogpt_platform/installer/` directory.-## Running fully offline with a local LLM (Ollama)+### Running fully offline with a local LLM (Ollama)Both installer scripts accept an opt-in flag that installs[Ollama](https://ollama.com), pulls a default chat model, and wires@@ -58,7 +208,7 @@ is useful for air-gapped or privacy-sensitive deployments — see[Running AutoPilot on a self-hosted LLM](copilot-local-llm.md) for thefull reference.-### Linux / macOS+#### Linux / macOS```bashcd autogpt_platform/installer@@ -68,7 +218,7 @@ cd autogpt_platform/installer# --ollama-host=http://gpu-rig.lab:11434 # use an existing Ollama```-### Windows+#### Windows```cmdcd autogpt_platform\installer@@ -87,26 +237,11 @@ The installer:Re-running with `--with-ollama` is idempotent — the wiring block is rewritten in place.-## After Installation--Once the installation is complete:-- The backend services will be running in Docker containers-- The frontend application will be available at http://localhost:3000--## Stopping the Services--To stop the services, press Ctrl+C in the terminal where the frontend is running, then run:--```bash-cd AutoGPT/autogpt_platform-docker compose down-```-## Troubleshooting-If you encounter any issues during installation:--1. Make sure all prerequisites are correctly installed-2. Check that Docker is running-3. Ensure you have a stable internet connection-4. Verify you have sufficient permissions to create directories and run Docker+1. Confirm `docker info` succeeds against a local Linux-container daemon.+2. If an image pull fails just after release, wait for public manifest+ publication and retry; the installer never falls back to a source build.+3. If the installer reports state or runtime drift, preserve the named volume,+ inspect the existing container, and follow the explicit upgrade procedure.+4. Check `docker logs --tail 100 autogpt` when health checks fail.