SourceAnt Logo

Self-Hosting SourceAnt

This guide is for users who want to host their own instance of SourceAnt.

Prerequisites

  • Python 3.8+
  • GitHub account with a repository for testing.
  • LLM API key (e.g., Gemini).

Installation

  1. Clone the Repository:
    git clone https://github.com/sourceant/sourceant.git && cd sourceant
  2. Initial project setup (docker-compose):
    docker compose up -d
  3. Install Dependencies:
    docker compose exec app pip install -r requirements.txt
  4. Set Environment Variables:
    Copy .env.example to .env and update the credentials.

GitHub App Setup

If you are running your own instance of SourceAnt, you must create your own GitHub App. This is because the webhook URL must point to your own server.

  1. Create a New GitHub App:
    • Navigate to your GitHub settings: Developer settings > GitHub Apps > New GitHub App.
    • Webhook URL: Set this to the public URL of your backend, pointing to the webhook endpoint (e.g., https://your-domain.com/api/github/webhooks).
    • Webhook Secret: Generate a secure secret and save it. You will need this for the GITHUB_SECRET environment variable.
  2. Set Permissions: Grant Pull requests: Read & write and Contents: Read-only.
  3. Generate a Private Key: Download the private key (.pem file).
  4. Configure Environment Variables: Update your .env file with your App ID, private key path, and webhook secret.