Skip to content

Self-Hosted Gateway

Operate your own Gateway instance

Apart from using our hosted offering, you can also self-host the Invariant Gateway, to enable secure and observable agentic applications within your organization.

This can be favorable if you want to run the Gateway on your own infrastructure, and have more control over the environment, e.g. to comply with your organization's security policies.


Gateway


Prerequisites

Before you get started, you have to ensure that your system has Docker installed.

git clone git@github.com:invariantlabs-ai/invariant-gateway.git

Then, navigate to the cloned directory:

cd invariant-gateway

Launching

After preparing the repository, you can launch the Gateway as a Docker container on your system via the provided run.sh script:

bash run.sh build && bash run.sh up

This will launch a Gateway service at http://localhost:8005/api/v1/gateway/ of the resulting container, allowing you to use and integrate Gateway with your own network infrastructure.

Stopping

To stop the service, you can run the following command, which will stop and remove the container:

bash run.sh down

Configuration

You can also configure your self-hosted Gateway instance, e.g. to use a different Explorer instance to interact with or to change other settings.

To learn more about different configuration options, please see the Gateway README.

Usage

After launching the Gateway, you can use it in the same way as the hosted version, relying on the base URL of your Gateway instance instead of the hosted URL.

Consider any of the following chapters next, to learn more about how to integrate Gateway: