Self-Hosted SDKs
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.
When to use self-hosting
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.
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.
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.
How it works
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.
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.
The self-hosted process works as follows:
- Download the Docker image - Fern provides the location of the most up-to-date Docker image containing the SDK generation logic
- Upload your fern folder - Add your API definition and other configuration files to the container
- Run the container - Execute SDK generation using standard Docker commands
- Partial SDK output - Core SDK files are generated and saved to your configured output location (local file system, GitHub repository, package registry, etc.)
- Organization verification - Fern verifies your organization registration and completes SDK generation by adding package distribution files like
pyproject.toml
, READMEs, and dependency configurations - Receive updated Docker images - Fern releases new versions of the Docker image that your team can evaluate and deploy when ready