Prerequisites
Collect the following from your platform team before you start:- PyPI repository URL: The internal index that proxies or hosts Python packages, written as
<PYPI_INDEX_URL>on this page. For example,https://pypi.example.internal/simple. - Container registry: The registry host, plus the port if it has one, written as
<DOCKER_REGISTRY>. It must hold a mirror of the Agent Server base image. See Additional images for Agent Server builds. - npm registry URL (JavaScript only): The internal registry that proxies or hosts npm packages, written as
<NPM_REGISTRY_URL>. For example,https://npm.example.internal. Leave off the trailing slash, because Corepack appends paths to it. - CA bundle: The path to the PEM file for your internal certificate authority (CA), written as
<CA_BUNDLE_PATH>. Internal registries usually serve certificates signed by your organization’s own CA, which operating systems and tools do not trust by default. - Root access: Whether you have
sudoon the build machine. Without sudo, use the per-user file locations on this page. Ask the platform team to install OS packages and the CA. - Python versions: Which versions the OS package repositories provide.
Trust the internal CA
Every later step connects to the internal registry over HTTPS. Until the machine trusts the internal CA, those connections fail with certificate errors, so install the CA first:- Add
<CA_BUNDLE_PATH>to the operating system trust store. The command depends on the OS. For example, on Debian and Ubuntu, copy the file to/usr/local/share/ca-certificates/with a.crtextension. Then runsudo update-ca-certificates. - On Linux, copy the CA to
/etc/docker/certs.d/<DOCKER_REGISTRY>/ca.crtso Docker trusts the internal registry. For details, see Docker’s Verify repository client with certificates.
Configure pip
Set the index once in a pip configuration file. A long URL passed as--index-url on each command is easy to get wrong, and a missing space between two flags produces a misleading 404.
Create ~/.config/pip/pip.conf. To apply the setting to every user on the machine, create /etc/pip.conf instead:
index-url: Replaces pypi.org as the package index.cert: The CA bundle pip uses to verify the index. Older pip releases do not read the OS trust store, so set it explicitly.
trusted-host = <host> with the index host name. For the full list of file locations and keys, see pip’s Configuration docs.
Install uv from the internal index
Install uv as a Python package from the internal index. The uv install script (curl ... | sh) does not work on a restricted network, because it downloads the uv binary from releases.astral.sh or GitHub.
PyPI hosts uv as a wheel that contains the binary. On some distributions, venv ships as a separate OS package, such as python3-venv on Debian and Ubuntu.
Install uv into its own virtual environment so it does not touch the system Python. Then link the binaries onto your PATH:
pip install reads the pip.conf from the previous section, so it resolves against <PYPI_INDEX_URL>.
uv self update works only for a uv installed by the install script. To upgrade this uv, run ~/.local/share/uv-bootstrap/bin/pip install --upgrade uv.
Configure uv
uv does not readpip.conf or PIP_INDEX_URL. Without its own setting, uv resolves against pypi.org.
Set the following once in your shell profile, such as ~/.bashrc:
UV_DEFAULT_INDEX: Replaces pypi.org as the default index.UV_SYSTEM_CERTS: Loads certificates from the OS trust store, which holds the internal CA. By default, uv trusts only its bundled roots.UV_PYTHON_DOWNLOADS: Stops uv from downloading Python. Provide the Python interpreter explains why.
UV_SYSTEM_CERTS requires uv 0.11.0 or later. Earlier versions use UV_NATIVE_TLS=true, which later versions still accept with a deprecation warning.SSL_CERT_FILE=<CA_BUNDLE_PATH> in place of UV_SYSTEM_CERTS. SSL_CERT_FILE replaces both uv’s bundled roots and the OS trust store. For every setting, see uv’s environment variable reference.
Provide the Python interpreter
The Agent Server image ships its own Python. The build machine needs Python 3.10 or later only to run pip, uv, and the LangGraph CLI. Install it from the OS repositories, for example on RHEL-family distributions:PATH. Keep UV_PYTHON_DOWNLOADS=never: without it, uv tries to download a missing interpreter from GitHub and retries with no clear error. If the OS repositories do not provide a supported version, see uv’s Installing Python guide.
Build the Agent Server image
The image build runs inside Docker, so the pip and uv settings and the OS trust store on the build machine do not apply to it. Set the base image, the package registry, and the internal CA inlanggraph.json instead.
To prepare the build:
-
Install the LangGraph CLI. It resolves against
UV_DEFAULT_INDEX: -
Log in to the internal registry:
-
Copy the CA bundle into the project directory, next to
langgraph.json. The build can copy files only from the project directory:
Build a Python project
To build the image:-
Set
base_imageanddockerfile_linesinlanggraph.json:base_image: The mirrored Agent Server image, without a tag. The CLI appends a tag built frompython_version, plusapi_versionorimage_distrowhen you set them. With the configuration above, the build pulls<DOCKER_REGISTRY>/langchain/langgraph-api:3.12, so that tag must exist in the registry.dockerfile_lines: Lines the CLI inserts afterFROM. TheCOPYandRUNlines append the internal CA to the image’s system CA bundle, which keeps the public roots. The twoARGlines apply to every install step in the build, including installs from auv.lockfile.SSL_CERT_FILEpoints uv at the system bundle, which uv otherwise ignores, andUV_DEFAULT_INDEXpoints uv at the internal index.ARGvalues are visible indocker history, so do not put credentials in<PYPI_INDEX_URL>.
COPY,RUN, andSSL_CERT_FILElines. -
Build the image:
Build a JavaScript project
The build installs packages with the package manager that matches the project’s lockfile. Node.js does not read the system CA bundle, so the build trusts the internal CA throughNODE_EXTRA_CA_CERTS instead.
To build the image:
-
Set
base_imageanddockerfile_linesinlanggraph.json:base_image: The mirrored JavaScript Agent Server image, without a tag. With the configuration above, the build pulls<DOCKER_REGISTRY>/langchain/langgraphjs-api:20, so that tag must exist in the registry.dockerfile_lines: TheCOPYline puts the internal CA in the image, andNODE_EXTRA_CA_CERTSadds it to the roots Node.js trusts.NPM_CONFIG_REGISTRYpoints npm and pnpm at the internal registry.ARGvalues are visible indocker history, so do not put credentials in<NPM_REGISTRY_URL>.
COPYandNODE_EXTRA_CA_CERTSlines. -
Add the settings for your package manager. The image runs pnpm and Yarn through Corepack, which downloads the package manager itself from the npm registry:
- npm (
package-lock.json, or no lockfile): No other settings. npm fetches fromNPM_CONFIG_REGISTRYeven whenpackage-lock.jsonrecords public URLs. - pnpm (
pnpm-lock.yaml): Add"ARG COREPACK_NPM_REGISTRY=<NPM_REGISTRY_URL>"todockerfile_lines. Pin pnpm inpackage.json, for example"packageManager": "pnpm@9.15.9". - Yarn 1 (
yarn.lock): Add the sameCOREPACK_NPM_REGISTRYline, and pin Yarn, for example"packageManager": "yarn@1.22.22". Yarn 1 downloads from the URLs recorded inyarn.lock, so regenerate the lockfile against<NPM_REGISTRY_URL>. - Yarn 2 or later (
yarn.lock): Replace theNPM_CONFIG_REGISTRYline with"ARG YARN_NPM_REGISTRY_SERVER=<NPM_REGISTRY_URL>", add theCOREPACK_NPM_REGISTRYline, and pin Yarn, for example"packageManager": "yarn@4.9.2".
.npmrcfile. Do not store registry tokens in a project.npmrc. - npm (
-
Build the image:
langgraph.json key, see the LangGraph CLI configuration file reference.
Verify the setup
Run these checks after setup and at the start of each working session. Each check confirms one section and shows the expected output.Check CA trust
Check pip
<PYPI_INDEX_URL>. If it is missing, pip is using pypi.org.
Check the uv installation
command not found error means ~/.local/bin is not on your PATH.
Check the uv configuration
--index-url line must show <PYPI_INDEX_URL>, and a resolved version confirms TLS works.
Check the Python interpreter
/usr/bin/python3.12. To confirm that a missing version fails immediately:
Check the image build
FROM must name the internal registry, and every line from dockerfile_lines must be present.
Next steps
langgraph build leaves the image on the build machine. To run it:
- Push the image: Push the image to a registry your cluster or host can pull from.
- Deploy with control plane: Create a deployment from the pushed image in the LangSmith UI.
- Self-host standalone servers: Run the image without a control plane, on Kubernetes, Docker, or Docker Compose.
- Egress for billing and operational telemetry: Allow the egress a running deployment needs, or ask about an offline (air-gapped) license.
- Custom TLS certificates: Mount the internal CA in your LangSmith installation.
Connect these docs to your agent of choice via MCP for real-time answers.

