|
| 1 | +--- |
| 2 | +title: Self-Hosted SDKs |
| 3 | +description: Fern supports self-hosting SDK generation so that you can run SDK generation |
| 4 | + on your own infrastructure. |
| 5 | +--- |
| 6 | + |
| 7 | +<Note>Self-hosted SDK generation is only available for the enterprise plan.</Note> |
| 8 | + |
| 9 | +Fern SDK generation runs on Fern's infrastructure by default. Self-hosting allows you to run SDK generation on your own infrastructure to meet specific security or compliance requirements. |
| 10 | + |
| 11 | +## When to use self-hosting |
| 12 | + |
| 13 | +Self-hosting is typically required for organizations that operate without internet access, have strict compliance requirements, or need full control over their SDK generation process. |
| 14 | + |
| 15 | +When you self-host, you're responsible for server setup, security, maintenance, and deciding how to distribute your generated SDKs. Self-hosted SDK generation includes [all Fern SDK features](/sdks/capabilities.mdx). |
| 16 | + |
| 17 | +<Warning> |
| 18 | +Unless you have specific requirements that prevent using Fern's default hosting, we recommend **using our managed cloud generation solution** for easier setup and maintenance. |
| 19 | +</Warning> |
| 20 | + |
| 21 | +## How it works |
| 22 | + |
| 23 | +When you run `fern generate`, Fern uses Docker containers to execute SDK generation logic. By default, Fern runs **cloud generation** by allocating compute space and running the container remotely. With **self-hosted (local) generation**, you download and run the same Docker container on your own infrastructure. |
| 24 | + |
| 25 | +Both approaches generate partial SDK files to your configured output location, then Fern verifies your organization registration and completes the SDK by adding package distribution files. |
| 26 | + |
| 27 | +The self-hosted process works as follows: |
| 28 | + |
| 29 | +1. **Download the Docker image** - Fern provides the location of the most up-to-date Docker image containing the SDK generation logic |
| 30 | +1. **Upload your fern folder** - Add your API definition and other configuration files to the container |
| 31 | +1. **Run the container** - Execute SDK generation using standard Docker commands |
| 32 | +1. **Partial SDK output** - Core SDK files are generated and saved to your configured output location (local file system, GitHub repository, package registry, etc.) |
| 33 | +1. **Organization verification** - Fern verifies your organization registration and completes SDK generation by adding package distribution files like `pyproject.toml`, READMEs, and dependency configurations |
| 34 | +1. **Receive updated Docker images** - Fern releases new versions of the Docker image that your team can evaluate and deploy when ready |
| 35 | + |
| 36 | +### Architecture diagram |
| 37 | + |
| 38 | +```mermaid |
| 39 | +sequenceDiagram |
| 40 | + autonumber |
| 41 | + participant F as Fern |
| 42 | + participant C as Customer |
| 43 | + participant S as Customer Server |
| 44 | + F->>C: Provides Docker image |
| 45 | + C->>S: Uploads fern folder |
| 46 | + C->>S: Runs Docker command |
| 47 | + S->>S: Output partial SDK |
| 48 | + F->>F: Checks organization registration |
| 49 | + F->>S: Completes SDK generation |
| 50 | + F->>C: Releases updated Docker image |
| 51 | + C->>C: Evaluates new version |
| 52 | + C->>S: Deploys updated image |
| 53 | +``` |
0 commit comments