---
title: "Deploy GitNexus on Pethost in one click"
description: "Index a code repository into a knowledge graph and explore it, or let an agent query it over MCP. A template for Pethost: in a minute or two the app is live on your machine, with HTTPS at its own address and nightly backups."
---

[← All templates](https://pethost.dev/templates/)

# Deploy GitNexus on Pethost in one click

Index a code repository into a knowledge graph and explore it, or let an agent query it over MCP

[Deploy on Pethost](https://console.pethost.dev/?template=gitnexus)

## What happens

1. You sign in to Pethost or make an account, with a passkey, GitHub or Google.
2. No machine yet? You pick a plan, and we prepare one for you. The link waits in your browser until it is ready.
3. New project opens at the app, and you click Create project.
4. In a minute or two the app is live at its own address with HTTPS. Its secrets are made for it at random, and its data is in the nightly backup.
5. It is a project like any other: its compose.yaml, its .env, its logs and a terminal are in the panel, and your agent can change it, roll it back or restore it.

## First steps

The site asks for an access token: TOKEN in the project’s .env. The browser forgets it with the tab, and an agent sends it to the address’s /api/mcp. Whoever has it reads every indexed repository. Its license, PolyForm Noncommercial, allows noncommercial use only.

## What it runs

The template is this compose.yaml and the variables it writes into the project’s .env. Pethost runs the file as it is written.

```
services:
  # The UI, and the one way in: it forwards /api to the server only with the token.
  web:
    image: ghcr.io/abhigyanpatwari/gitnexus-web:1.6.12
    restart: unless-stopped
    environment:
      GITNEXUS_BACKEND_URL: ${URL}
      GITNEXUS_UPSTREAM_URL: http://server:4747
      GITNEXUS_SERVE_AUTH_TOKEN: ${TOKEN}
      GITNEXUS_PROXY_TRUST_XFF: 1
    depends_on:
      - server

  # Indexes repositories into a knowledge graph; it has no address of its own.
  server:
    image: ghcr.io/abhigyanpatwari/gitnexus:1.6.12
    restart: unless-stopped
    environment:
      GITNEXUS_TRUST_PROXY: 1
    # The registry, the indexes and the cloned repositories.
    volumes:
      - data:/data/gitnexus

volumes:
  data:
```

[compose.yaml](https://pethost.dev/templates/gitnexus/compose.yaml)[See it on GitHub](https://github.com/pethost-dev/templates/tree/main/gitnexus)

Pethost · Stephan Gomer · NIP 1133096755

[Templates](https://pethost.dev/templates/) [About](https://pethost.dev/about/) [Blog](https://pethost.dev/blog/) [Terms](https://pethost.dev/terms/) [Privacy](https://pethost.dev/privacy/) [Refunds](https://pethost.dev/refunds/) [API](https://pethost.dev/docs/api/) [CLI](https://pethost.dev/docs/cli/) [Plugin](https://github.com/pethost-dev/plugin) [support@pethost.dev](mailto:support@pethost.dev)
