> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lanesync.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Self-hosting

> Deploy LaneSync in your own environment with Docker Compose — configuration, secrets, and CI integration.

This guide covers **self-hosted LaneSync** for enterprise customers. The primary product path is the hosted SaaS at [lanesync.dev](https://lanesync.dev) — see [Quickstart](/quickstart) for cloud onboarding.

<Warning>
  Self-hosting requires operational ownership: database backups, upgrades, GitHub App registration, and TLS certificates.
</Warning>

## Architecture

| Component   | Technology             |
| ----------- | ---------------------- |
| UI          | React dashboard        |
| API         | Node.js / Express      |
| Database    | PostgreSQL 16 with RLS |
| Local infra | Docker Compose         |

## Prerequisites

* [Docker](https://docs.docker.com/get-docker/) and Docker Compose
* A GitHub account (or GitHub Enterprise Server)
* A repository to track
* TLS termination (reverse proxy) for production

## Installation

Enterprise customers receive deployment artifacts from LaneSync support. Contact **[support@lanesync.dev](mailto:support@lanesync.dev)** for your installation package and credentials.

Typical self-hosted layout:

```bash theme={null}
# Extract deployment package provided by LaneSync
cd lanesync
cp .env.example .env
docker-compose up -d --build
```

| Service    | Default URL                        |
| ---------- | ---------------------------------- |
| Dashboard  | `http://localhost:3000`            |
| API        | `http://localhost:8080`            |
| API health | `http://localhost:8080/api/health` |

Production deployments should replace localhost with your internal or public domain behind HTTPS.

## First-run setup

<Steps>
  <Step title="Open the setup wizard">
    Navigate to your dashboard URL. The wizard guides GitHub App creation (full or minimal tier).
  </Step>

  <Step title="Install the GitHub App">
    Install on your org or account with required repository access.
  </Step>

  <Step title="Configure OAuth">
    Set GitHub OAuth credentials in `.env` or via the setup API. For pre-created apps:

    ```bash theme={null}
    GITHUB_APP_ID=123456
    GITHUB_APP_PRIVATE_KEY_PATH=/path/to/key.pem
    ```
  </Step>

  <Step title="Sign in and bootstrap repos">
    Complete OAuth sign-in. Run the repo setup wizard for each tracked repository.
  </Step>
</Steps>

## Environment variables

Copy from `.env.example`. Key variables:

| Variable                      | Purpose                                  |
| ----------------------------- | ---------------------------------------- |
| `GITHUB_APP_ID`               | GitHub App identifier                    |
| `GITHUB_APP_PRIVATE_KEY_PATH` | PEM key for app authentication           |
| `SESSION_SECRET`              | Express session signing                  |
| `DATABASE_URL`                | PostgreSQL connection string             |
| `UI_URL` / `API_URL`          | Public URLs for OAuth redirects and CORS |

See internal deployment docs in the repository `docs/` folder for cloud-specific variants (AWS, Alibaba).

## CI integration

Bootstrapped workflows default:

```yaml theme={null}
env:
  SDLC_API_URL: https://lanesync.dev
```

For self-hosted, set a **repository variable** `SDLC_API_URL` to your API base URL (e.g. `https://lanesync.internal.example.com`).

Evidence upload and deploy gate checks must reach your instance from GitHub Actions runners.

## Advance your first release

Same stage gates as hosted SaaS:

1. Create milestone with issues
2. PLANNING → assign issues
3. DEVELOPMENT → merge PRs, cut release branch
4. TESTING → CI passes on release branch
5. EVIDENCING → approve evidence PR
6. DEPLOYMENT → promote to production

Demo helper (self-hosted only):

```bash theme={null}
curl -X POST http://localhost:8080/api/sync/setup-demo/<owner>/<repo>
```

## Upgrades

1. Pull latest image or rebuild `docker-compose up -d --build`
2. Run database migrations (automatic on backend startup)
3. Verify `/api/health`

## Related

* [Enterprise security](/enterprise/security)
* [Enterprise overview](/enterprise/overview)
