A Complete Guide to Fully Local (Air-Gapped) Deployment of a Web-Based AI Agent Platform
This guide explains how to deploy a web-based AI agent platform—web console, task orchestration, model runtime, storage, and logging—in a fully offline environment such as a NAS or an internal server. It covers offline artifact preparation and verification, local model inference setup, containerization and NAS storage adaptation, reverse proxy and access control, network isolation and auditing, plus a step-by-step deployment, acceptance, upgrade, and rollback process with common troubleshooting tips.
A Complete Guide to Fully Local (Air-Gapped) Deployment of a Web-Based AI Agent Platform
1. Background and Deployment Goals
As general-purpose AI agent tools evolve toward web-based management, multi-model integration, and visualized operations, more teams want to run a fully controllable agent platform on their own NAS devices, internal servers, or isolated environments. Such a platform typically includes a web console, a task scheduling service, a model integration layer, session and configuration storage, and logging/auditing modules. Installing directly in an internet-connected environment is simple, but it introduces problems such as system dependency pollution, version drift, uncontrolled outbound traffic, and unclear data boundaries—issues that are especially pronounced on resource-constrained devices like a NAS.
“Fully local installation” does not simply mean getting the service to start. It means the entire lifecycle—deployment, operation, upgrade, and troubleshooting—should avoid reliance on the public internet as much as possible. A stricter definition includes: container images or installation packages come from an internal artifact registry; system packages, language dependencies, and frontend static assets are all synchronized in advance; model weights, tokenizers, configuration files, and license inventories are fully in place; outbound access is denied by default at runtime; the web console is exposed through an internal reverse proxy with authentication; and data, logs, and backups all have clearly defined persistent paths. Only when these conditions are met can a deployment be considered a maintainable offline deployment.
This article takes a generic technical perspective on how to achieve a fully local deployment of a web-based AI agent platform on a NAS or internal server. The configurations shown are illustrative of module relationships only and are not tied to any specific product, interface, or command.
2. Boundaries and Overall Architecture of Full Localization
It is recommended to break the deployment goal into four layers of boundaries:
- Artifact boundary: Container images, system packages, language dependencies, frontend assets, database initialization scripts, model files, certificates, and license inventories must all be available offline, with checksums.
- Runtime boundary: Services must not access the public internet after startup; model inference, web access, and log reporting all stay within the internal network; time synchronization uses an internal time source.
- Data boundary: Sessions, configurations, indexes, logs, and backup directories reside in controlled storage volumes, with permissions assigned on a least-privilege basis.
- Operations boundary: Upgrade packages, rollback packages, migration scripts, acceptance scripts, and troubleshooting manuals are archived with each version, avoiding the awkward situation where “fixes require internet access.”
The overall architecture can be abstracted as follows: the web console handles visual management; the API service handles task and session orchestration; the model runtime provides local inference; a relational database stores structured configuration; object storage or file volumes store attachments and model files; a reverse proxy handles TLS termination, front-end authentication, and access control; and logging/monitoring components handle auditing and alerting. In NAS environments, persistent volumes can be mapped to snapshot-capable storage paths, but attention must be paid to filesystem permissions, UID/GID consistency, and concurrent write limitations.
3. Offline Artifact Preparation and Verification
The first step of a fully local deployment is not starting containers—it is building an offline artifact manifest. The manifest should include at minimum: base runtime images, application service images, model runtime images, database images, reverse proxy images, frontend static asset packages, model weights and tokenizer files, configuration templates, database migration scripts, licenses and third-party notices, and checksum files. Each artifact should record its version number, source, build time, checksum, and supported architecture.
In an isolated network, it is recommended to first create a “version directory” in the internal artifact registry—for example, organized by “platform version / model version / configuration version.” Deployment machines pull only from the internal registry and never access external repositories directly. For NAS environments, large model files can be placed on read-only shared volumes, with integrity confirmed via checksums; application images and configurations go in a separate directory, so model upgrades do not affect service images.
An illustrative verification script can be expressed as:
verify_manifest:input: manifest.yamlsteps:- check_file_exists: all_artifacts- check_sha256: manifest.checksums- check_license: manifest.licenses- check_arch: manifest.architecturesoutput: verification_report.json
Deployment should not proceed if verification fails. Many problems in offline environments are not defects in service code, but rather image architecture mismatches, truncated model files, missing frontend assets, or incomplete certificate chains.
4. Localizing Models and the Inference Service
A web-based AI agent platform typically integrates one or more local model runtimes. For full localization, confirm in advance whether the model license permits offline use, whether commercial use is allowed, and whether attribution notices must be retained. Model weights, tokenizers, configuration files, and quantization versions must be version-pinned. The model directory should be mounted read-only, while the inference service mounts its cache directory separately on a writable volume, avoiding repeated loading after container rebuilds.
Resource planning should distinguish between CPU and GPU scenarios. CPU inference requires attention to memory bandwidth, concurrency, and context length; GPU inference requires attention to VRAM, driver compatibility, runtime versions, and batching strategy. NAS devices typically have limited CPU performance, so it is recommended to deploy the model runtime on a separate internal server, with the web console and orchestration services on the NAS or a lightweight node, calling the runtime over internal addresses. If single-machine deployment is unavoidable, limit concurrency, shorten context lengths, use quantized models, and set memory and VRAM protection thresholds.
The model service should expose an internal endpoint, with timeouts, retries, and circuit breaking configured on the application side. Since there is no online model fallback in an offline environment, acceptance testing must cover scenarios such as model loading failures, insufficient VRAM, request timeouts, and malformed responses.
5. Containerization and NAS Storage Adaptation
Containerization helps isolate dependencies, but offline deployment must avoid automatic pulls at startup. Deployment configurations should pin local image addresses, use read-only root filesystems, run as non-privileged users, and define explicit volume mappings and health checks. Volume mapping on a NAS requires attention to permissions: the user ID inside the application container must have read/write access to persistent directories; database directories should not be placed on unreliable network share paths; model directories can be read-only; and log directories should have size limits and rotation.
The following illustrative orchestration configuration expresses module relationships only and does not represent a real interface:
deployment:workloads:- name: agent-webimage: local-registry/agent-web:offlineports: ["8080:8080"]env:- MODEL_ENDPOINT=http://model-runtime:9000- DATA_DIR=/datavolumes:- ./data:/data- ./config:/config:roreadOnlyRoot: truehealthCheck: /health- name: model-runtimeimage: local-registry/model-runtime:offlinevolumes:- ./models:/models:ro- ./cache:/cacheresources:memory: "8Gi"
After configuration, start first on a test volume to confirm directory permissions, database initialization, and frontend static asset loading, then migrate to production storage. NAS snapshots should be triggered before upgrades, and an additional logical backup of the database is mandatory before migrations.
6. Web Console, Reverse Proxy, and Access Control
Web-based visual management is a key value of this kind of platform, but offline environments still need security boundaries. It is recommended to place the web console behind a reverse proxy that handles TLS termination, front-end authentication, access logging, and basic rate limiting. Certificates can be issued by an internal certificate authority, with root certificates pre-installed on clients. Authentication should use a unified identity source, or strong local passwords plus multi-factor authentication. Permissions should be role-based, at minimum distinguishing administrators, operators, and regular users.
The console should not directly expose database or model runtime ports. The API service and web static assets can be deployed separately; all static assets must be localized so pages do not load external fonts, scripts, or icon libraries. For task execution features, operation auditing should be recorded: who submitted what task, when, which model endpoint was invoked, what result was produced, and whether it failed. Logs must be sanitized to avoid recording secrets or complete sensitive inputs.
7. Network Isolation, Secrets, and Auditing
A fully local deployment should deny outbound traffic by default at the network layer, opening only the internal whitelist as needed. If the application attempts to reach external update sources at startup, automatic updates and anonymous telemetry should be disabled via configuration. Secrets, database passwords, and model access tokens should be injected through local secret files or environment variables—not written into images or code repositories—and file permissions should be restricted to minimum readability. Internal time synchronization must be functional; otherwise TLS validation, token validity periods, and log timelines will all misbehave.
For auditing, retain at least deployment audits, access audits, task audits, and model invocation audits. Logs can be written to a local logging service or a general-purpose logging category, rotated daily with a defined retention period. If running in an isolated network of a cloud environment such as Baidu AI Cloud, general-purpose capabilities like object storage, container platforms, logging services, and monitoring/alerting can be reused—but offline deployment still requires all artifacts to be synchronized in advance, with no reliance on runtime downloads from the public internet.
8. Deployment Process and Acceptance Checklist
The recommended sequence is “prepare — import — verify — start — validate — cut over”: in the preparation phase, complete the artifact manifest and resource planning; in the import phase, bring images, models, configurations, and scripts into the internal network; in the verification phase, check checksums, licenses, architectures, and directory permissions; in the startup phase, start the database and model runtime first, then the API service and web console; in the validation phase, check health endpoints, web login, model invocation, task execution, log writing, and backup restoration; in the cutover phase, retain the old version’s volumes and rollback packages.
The acceptance checklist should cover: Can services start while disconnected from the internet? Does the web console make no external resource requests? Can the model load and complete one inference? Is data retained after a database restart? Are NAS volume permissions correct? Is the reverse proxy certificate trusted? Can regular users be blocked from management interfaces? Do logs contain the necessary audit fields? Can upgrade packages be applied without internet access? Can rollback complete within the allowed time window?
9. Upgrades, Rollbacks, and Common Issues
Offline upgrades should use complete upgrade packages rather than online pulls. Before upgrading, back up the database, configurations, and model manifest; validate migration scripts on a small-scale test volume first; during the formal upgrade, use blue-green or rolling strategies while retaining old images and configurations. Rollback is not just reverting application images—it must also consider whether database migrations are reversible, so migration scripts must come with rollback instructions.
Common issues include: blank web pages, usually caused by incorrect static asset paths or missing frontend packages; model loading failures, usually due to truncated weights, architecture mismatches, or incorrect license configuration; permission denied errors, usually from UID/GID mismatches between the container user and NAS directories; database lock waits, usually from concurrent writes on network share paths; certificate errors, usually from missing root certificates or internal time drift; and services restarting repeatedly, usually from overly tight resource limits or incorrect health check paths. When troubleshooting, check artifact checksums and log timelines first, then examine outbound network access and persistent volumes.
With the approach described above, a web-based AI agent platform can achieve a genuinely maintainable, fully local deployment on a NAS or internal server: artifacts are traceable, models load offline, web access is controlled, data is backed up, and upgrades are reversible—delivering stable, auditable AI agent management in isolated environments.
