Docs menu

Configure your server

Self-hosting on restricted networks

Use a mirror you control or pre-copy files when the commercial download service or container registries are unreachable. These settings change downloads; model and remote-computer providers still need network access.

Failure Setting or action
Cannot fetch the installer Download it from your mirror or copy it locally
Cannot fetch Compose files PREA_DOWNLOAD_BASE, --local, or PREA_DOWNLOAD_SKIP_EXISTING=1
Cannot pull app or computer images PREA_IMAGE_REGISTRY, plus optional per-image names and tags
Cannot pull Postgres or busybox POSTGRES_IMAGE, BUSYBOX_IMAGE, or Docker daemon registry-mirrors

Installer script

When the first-party download service is unreachable, download the installer from your mirror:

export PREA_INSTALLER_URL=https://example.com/mirror/prea/infra/compose/install-images.sh
export PREA_DOWNLOAD_BASE=https://example.com/mirror/prea/infra/compose
mkdir -p prea && cd prea &&
curl -fsSL -o install-images.sh "${PREA_INSTALLER_URL}" &&
bash install-images.sh --prepare-only

PREA_INSTALLER_URL selects the script for this curl command; PREA_DOWNLOAD_BASE selects the Compose files downloaded by that script. Set both when the download service is blocked.

Compose files

To mirror docker-compose.images.yml and .env.images.example, point the installer at an HTTPS mirror of the licensed server distribution assets:

export PREA_DOWNLOAD_BASE=https://example.com/mirror/prea/infra/compose
bash install-images.sh --prepare-only

Trailing slashes are trimmed; non-HTTPS bases are rejected. Downloads use bounded retries.

To reuse files already present in the working directory:

# Place docker-compose.images.yml and .env.images.example in this directory first.
bash install-images.sh --local --prepare-only
# Equivalent environment setting:
PREA_DOWNLOAD_SKIP_EXISTING=1 bash install-images.sh --prepare-only

Missing files are still downloaded. --prepare-only creates .env without starting the stack; continue with the image settings and startup instructions below.

For an offline installation, copy docker-compose.images.yml and .env.images.example into the working directory and preload all required container images on the Docker host. Then run:

bash install-images.sh --offline

--offline fails before calling Compose if either required file is missing, even when .env already exists. It never downloads files and does not require curl. It skips image pulls and passes --pull never to startup when Compose supports it. Older Compose versions retain the startup path and print a warning when that flag is unavailable.

To install restricted computer egress rules offline, also copy restrict-computer-egress.sh into the working directory. If that optional script is missing, the installer records open egress and warns instead of downloading it. An explicit SANDBOX_COMPUTER_EGRESS setting remains unchanged. See restricted computer egress for host requirements.

Container images

After --prepare-only, set the shared image namespace in .env and authenticate with docker login against that registry. Mirrors must preserve the installation license and distribution rights. For mirrored Postgres or busybox, use digest-verified startup below. Otherwise, rerun the installer (keep --local if using pre-copied Compose files):

PREA_IMAGE_REGISTRY=registry.example.com/mirror/prea
PREA_IMAGE_TAG=edge
PREA_COMPUTER_IMAGE_TAG=edge
POSTGRES_IMAGE=registry.example.com/library/postgres@sha256:<trusted-postgres-digest>
BUSYBOX_IMAGE=registry.example.com/library/busybox@sha256:<trusted-busybox-digest>

Mirror both app and computer images and pair their tags to the same published version. Arm64 hosts need multi-architecture tags; see published images and tags. Image overrides are defined in docker-compose.images.yml.

For Docker Hub images, you can instead merge registry-mirrors into the Docker daemon’s existing JSON configuration, then restart Docker:

{
  "registry-mirrors": ["https://mirror.example.com"]
}

See the base daemon configuration. Docker Hub mirrors do not replace the private registry namespace above.

Digest-verified Hub mirror startup

Run bash install-images.sh --prepare-only in the installation directory first (add --local for pre-copied files). This prepares the Compose file and validates the required secrets without starting containers.

Treat a mirror as a transport, not as the source of truth. Obtain the expected postgres:16 and busybox:1 digests from a trusted upstream or an out-of-band trusted workstation. Put the digest in each mirrored image reference, then pull, compare the local repository digests, and start without pulling again. Replace every example value below before running it:

(
set -euo pipefail

export POSTGRES_IMAGE='registry.example.com/library/postgres@sha256:<trusted-postgres-digest>'
export BUSYBOX_IMAGE='registry.example.com/library/busybox@sha256:<trusted-busybox-digest>'

docker compose --env-file .env -f docker-compose.images.yml pull

for image_ref in "$POSTGRES_IMAGE" "$BUSYBOX_IMAGE"; do
  expected_digest="${image_ref##*@}"
  docker image inspect --format '{{range .RepoDigests}}{{println .}}{{end}}' "$image_ref" |
    awk -F@ -v expected="$expected_digest" '$2 == expected { found=1 } END { exit !found }' || {
      echo "digest verification failed for $image_ref" >&2
      exit 1
    }
done

docker compose up --help | grep -- '--pull' >/dev/null || {
  echo 'Docker Compose with up --pull is required for verified no-repull startup.' >&2
  exit 1
}
docker compose --env-file .env -f docker-compose.images.yml up -d --pull never
)

This sequence fails before startup if pulling or inspection fails, or either image lacks the expected digest. Save the same POSTGRES_IMAGE and BUSYBOX_IMAGE references in the installation’s .env for later restarts; the exports above apply only to this startup. Do not replace them with mutable mirror tags. After startup, follow the health checks in the setup prompt.

Once downloads work, continue with published-image setup. For hosts without external provider access, use local Docker computers and an operator-controlled model endpoint; see local models.