# Build Your Own Library

Library steps refer to customizable and reusable executions that can be incorporated into Valohai projects. These steps can be either predefined by Valohai’s Ecosystem or custom ones created by users.

Unlike project-specific steps defined in each project’s own `valohai.yaml` file, library steps are shared across an entire organization.

This articles shows you how to add custom library steps from your public and private Git repositories. For instructions on how to build the library step, see the [Docker Image builder from the valohai-toolkit repository](https://github.com/valohai/valohai-toolkit/tree/master/docker_image_builder).

### Requirements <a href="#id-1-requirements" id="id-1-requirements"></a>

* A Git repository containing a `valohai.yaml` with at least one step and all the other required code files.
* Admin account in your Valohai organization.

### Add a Git-repository with library steps <a href="#id-2-use-a-public-git-repository" id="id-2-use-a-public-git-repository"></a>

* Click on `Hi, <username>!` in the top-right corner.
* Select `Manage <organization>`.
* Open the Libraries tab.
* Click on the Add a new Library button.
* Name your library. Note that the name can only consist of letters, numbers, underscores or hyphens.

<figure><img src="https://4109720758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ff3mjTRQNkASbnMbJqzJ2%2Fuploads%2Fgit-blob-ba4345eedcb8f9dd73b88e591d5ada97069d85c7%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

#### Public Repositories <a href="#id-3-for-public-repositories" id="id-3-for-public-repositories"></a>

* Add **HTTPS URL of the public repository** in the respective field.
  * The URL looks like `git+https://github.com/<usename>/<repository>.git`

#### Private Repositories <a href="#id-4-for-private-repositories" id="id-4-for-private-repositories"></a>

* Add SSH URL of the private repository in the respective field.
  * The URL looks like `git@github.com:<username>/<repository>.git`
* Add the SSH private key in the field.
* You can either use the Generate new SSH key button in Valohai or generate the key on your command line with the following command

```shell
ssh-keygen -t rsa -b 4096 -f my-project-deploy-key
```

* Click on the **Add Library** button.
* Click on the **Update** button to fetch the commits.

You will need to add the public key as a deploy key for your repository, see the instructions for different hosting services under the [Git integration](https://docs.valohai.com/git-integration) section.

<figure><img src="https://4109720758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ff3mjTRQNkASbnMbJqzJ2%2Fuploads%2Fgit-blob-002e325edaad5e3d5cacd309daccfb0c91b2a590%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
