# Hosting Library server

**URL:** <https://librepcb.discourse.group/t/hosting-library-server/1040>\
**Category:** Uncategorized\
**Created:** [June 2, 2026, 12:48pm UTC](https://librepcb.discourse.group/t/hosting-library-server/1040 "2026-06-02T12:48:58Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Walter11](https://avatars.discourse-cdn.com/v4/letter/w/a88e4f/32.png) [@Walter11](https://librepcb.discourse.group/u/Walter11)\
**Post date:** [June 2, 2026, 12:48pm UTC](https://librepcb.discourse.group/t/hosting-library-server/1040/1 "2026-06-02T12:48:58Z")

</div>

Hi there,

First of all, great project!

One of the biggest hurdles I’ve encountered so far is the availability of libraries. For most designs I still have to import components from external libraries. Back in the Eagle 3.x days, a key advantage was the user‑contributed library ecosystem. Some good, some bad, but nevertheless contributing to the overall knowledge-base.

I can understand, that the developing team has not the capacity to curate such at the moment. Therefore my take would be, how one could include such user-contribution to the project.

I saw in the workspace config dialog that it is possible to connect further services via API.

Is there any description to be found how a second library API server may be used here? What API functions needs this secondary library server to serve?

My background to this is, that I would like to host an internal library server for our organisation. On the further perspective I would then like to open this server to the public.

What do you think?

regards

MW

---

<div class="post-metadata">

**Author:** ![ubruhin](https://avatars.discourse-cdn.com/v4/letter/u/c89c15/32.png) [@ubruhin](https://librepcb.discourse.group/u/ubruhin)\
**Post date:** [June 2, 2026, 1:37pm UTC](https://librepcb.discourse.group/t/hosting-library-server/1040/2 "2026-06-02T13:37:25Z")

</div>

Hi @Walter11,

> [@Walter11](#):
>
> First of all, great project!

Thanks ☺

> [@Walter11](#):
>
> One of the biggest hurdles I’ve encountered so far is the availability of libraries.

Absolutely. This is regularly reported by users, and is clearly something that we have to work on. For long term, we have to extend our libraries a lot, but that will take a huge amount of resources which we don’t have at the moment. So we also need short-time solutions, for example to get parts on-demand from services like SnapEDA or [pcblibraries.com](http://pcblibraries.com), or to simply share “unofficial” libraries between users. The Eagle & KiCad importers are also made to provide a short-term solution for the library problem.

Regarding your concrete question: The API for providing libraries is documented here:

> **[LibrePCB Developers Documentation: Server API Specification](https://developers.librepcb.org/d1/dcb/doc_server_api.html)**

When you host a server that implements this API, anyone who has access to the server can add it to the workspace settings and will get the libraries from that server.

The implementation of such a server can actually be quite trivial. In fact, our official server is just a python script that periodically pulls the libraries from GitHub, parses their metadata, saves a JSON file according the API spec, and a static web server delivers that JSON file 😉

Also for companies, I actually do have plans to provide some kind of web panel where they can host their own (private) libraries for easy library deployment within an organization. We should provide paid services to professional users anyway (like an official customer support), to ensure a sustainable funding of the development for long term. The ability of managing company libraries could be part of that paid services (fully optional of course – it will always be possible to implement & host such a server for free by yourself).

As soon as we have built such a system for companies, actually it may also be used to share libraries publicly 🤔

Anyway, those are ideas for the future – implementing the API by yourself, and sharing the URL to other users, is already possible today.

> [@Walter11](#):
>
> My background to this is, that I would like to host an internal library server for our organisation.

Just in case you would be interested in an official solution of internal library management, and official customer support, as part of a paid subscription – please let me know (feel free to PM me, or mail to [Contact | LibrePCB](https://librepcb.org/contact/)). Instead of building something on my own and hoping that companies are interested in buying it, it would be great to have a concrete customer to better understand the needs and to start building up the services together 🙂

---

<div class="post-metadata">

**Author:** ![Walter11](https://avatars.discourse-cdn.com/v4/letter/w/a88e4f/32.png) [@Walter11](https://librepcb.discourse.group/u/Walter11)\
**Post date:** [June 5, 2026, 9:22pm UTC](https://librepcb.discourse.group/t/hosting-library-server/1040/3 "2026-06-05T21:22:20Z")

</div>

Many thanks for your prompt reply. With a lot of discussion with my GPT friend, I was able to get it up and running!. Here is my documentation for the process

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

# LibrePCB Library Server on GitLab Pages

This guide explains how to publish your own LibrePCB library server using **GitLab Pages**.

Starting point: You already created a LibrePCB library:

```auto
Test_Library.lplib

```

The goal is to host it so LibrePCB can install it via a remote library source.

* * *

# 1. Create a Git Repository and Enable GitLab Pages

Create a new project on your GitLab instance.

Example:

```auto
librepcb-library-server

```

Clone it locally:

```auto
git clone git@gitlab.git.nrw:username/librepcb-library-server.git
cd librepcb-library-server

```

Create the GitLab Pages configuration file:

```auto
.gitlab-ci.yml

```

Content:

```auto
pages:
  stage: deploy
  script:
    - echo "Publishing LibrePCB library server"
  artifacts:
    paths:
      - public
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

```

GitLab Pages publishes everything inside:

```auto
public/

```

Don’t forget to make GitLab Pages publicly accessible.  
In your GitLab project:

Go to Settings  
 → Open General  
 → Find Visibility, project features, permissions  
 → Look for Pages  
 → Set it to Everyone

After pushing, the site will be available at:

```auto
https://<project>.pages.git.nrw/

```

* * *

# 2. Create the Directory Structure

Create the directories:

```auto
mkdir -p public/api/v1/libraries
mkdir -p public/libs
mkdir -p libraries
mkdir -p scripts

```

Directory purpose:

```auto
libraries/ → editable LibrePCB libraries (sources)
public/libs/ → zipped libraries for download
public/api/ → API JSON for LibrePCB
scripts/ → helper scripts

```

* * *

# 3. Add the Library Source

Copy your LibrePCB library into:

```auto
libraries/Test_Library.lplib

```

The library should contain:

```auto
.librepcb-lib
library.lp
sym/
pkg/
cmp/
dev/

```

* * *

# 4. Create the Library ZIP

LibrePCB downloads libraries as ZIP archives.

Create the ZIP file:

```auto
cd libraries/Test_Library.lplib
zip -r ../../public/libs/Test_Library.lplib.zip . -x ".lock"
cd ../../

```

Verify the archive:

```auto
unzip -l public/libs/Test_Library.lplib.zip

```

The root must contain:

```auto
.librepcb-lib
library.lp

```

* * *

# 5. Create the LibrePCB API JSON

Create the API endpoint file:

```auto
public/api/v1/libraries/v2

```

Example JSON:

```json
{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "name": {
        "default": "Test Library"
      },
      "description": {
        "default": "Example LibrePCB library"
      },
      "keywords": {
        "default": "example,test"
      },
      "author": "Your Name",
      "version": "0.1",
      "deprecated": false,
      "url": "https://gitlab.git.nrw/username/librepcb-library-server",
      "dependencies": [],
      "component_categories": 0,
      "package_categories": 0,
      "symbols": 0,
      "packages": 0,
      "components": 0,
      "devices": 0,
      "recommended": true,
      "updated_at": "2026-06-04T12:00:00+00:00",
      "format_version": "2",
      "icon_url": null,
      "download_url": "https://<project>.pages.git.nrw/libs/Test_Library.lplib.zip",
      "download_size": 12345,
      "download_sha256": "abcdef123456..."
    }
  ]
}

```

## Explanation of JSON Fields

| Field | Description |
| --- | --- |
| uuid | Library UUID from `library.lp` |
| name | Human readable library name |
| description | Short description |
| keywords | Search keywords |
| author | Library author |
| version | Library version |
| deprecated | Mark library obsolete |
| url | Homepage or repository |
| dependencies | UUIDs of required libraries |
| component\_categories | Number of component categories |
| package\_categories | Number of package categories |
| symbols | Number of symbols |
| packages | Number of packages |
| components | Number of components |
| devices | Number of devices |
| recommended | Suggest installation |
| updated\_at | ISO‑8601 timestamp |
| format\_version | Library format version |
| icon\_url | Optional icon |
| download\_url | Direct ZIP download link |
| download\_size | ZIP file size in bytes |
| download\_sha256 | SHA256 checksum |

* * *

# 6. Calculate File Size and SHA256

Calculate ZIP size:

```auto
stat -c %s public/libs/Test_Library.lplib.zip

```

Calculate SHA256:

```auto
sha256sum public/libs/Test_Library.lplib.zip

```

Insert these values into the JSON.

* * *

# 7. Push to GitLab

Commit everything:

```auto
git add .
git commit -m "Add Test Library"
git push

```

GitLab CI will publish the Pages site.

Test the API:

```auto
curl https://<project>.pages.git.nrw/api/v1/libraries/v2 | jq

```

## this should return a working json file

# 8. Add the Server to LibrePCB

Open LibrePCB:

```auto
Workspace Settings → Internet

```

Enter:

```auto
https://<project>.pages.git.nrw/api/v1/libraries/v2

```

LibrePCB should now list and install the library.

* * *

# 9. Automation Script

Create:

```auto
scripts/build_library.sh

```

Content:

```auto
#!/bin/bash

LIBNAME=Test_Library.lplib
ZIP=public/libs/$LIBNAME.zip

cd libraries/$LIBNAME

zip -r ../../$ZIP . -x ".lock"

cd ../../

SIZE=$(stat -c %s $ZIP)
SHA=$(sha256sum $ZIP | cut -d " " -f1)

echo "Size: $SIZE"
echo "SHA256: $SHA"

```

Make executable:

```auto
chmod +x scripts/build_library.sh

```

Run:

```auto
scripts/build_library.sh

```

The script rebuilds the ZIP and prints the values needed for the JSON.

* * *

# Result

You now have a fully working LibrePCB library server hosted on GitLab Pages.

## Automatic Script

For those who want to use this setup in a production environment, automating the process is highly recommended. A script can extract the required information, generate the ZIP archives, and create the necessary directory structure and JSON metadata automatically.

You can find my current implementation attached: **create\_librePCB\_json.sh**. Just copy your libraries in the /libraries folder and the .sh script in the scripts folder of your git repo.

Feel free to use it and let me know if you have any suggestions or improvements.

**Final advice:** LibrePCB uses the version number in `library.lp` to determine whether a remote library needs to be updated. Therefore, whenever you publish a new version of your library, remember to update this version number as well.

---

<div class="post-metadata">

**Author:** ![Walter11](https://avatars.discourse-cdn.com/v4/letter/w/a88e4f/32.png) [@Walter11](https://librepcb.discourse.group/u/Walter11)\
**Post date:** [June 5, 2026, 9:29pm UTC](https://librepcb.discourse.group/t/hosting-library-server/1040/4 "2026-06-05T21:29:48Z")

</div>

Here you can find the script file [create\_librePCB\_json.sh](https://librepcb-testlib-server-90447e.pages.git.nrw/create_librePCB_json.sh)

Somehow I was not able to upload it here. Even as ZIP always an error resulted.

---

<div class="post-metadata">

**Author:** ![ubruhin](https://avatars.discourse-cdn.com/v4/letter/u/c89c15/32.png) [@ubruhin](https://librepcb.discourse.group/u/ubruhin)\
**Post date:** [June 5, 2026, 10:18pm UTC](https://librepcb.discourse.group/t/hosting-library-server/1040/5 "2026-06-05T22:18:47Z")

</div>

Nice! Just two comments:

> [@Walter11](#):
>
> Open LibrePCB:
> 
> ```auto
> Workspace Settings → Internet
> 
> ```
> 
> Enter:
> 
> ```auto
> https://<project>.pages.git.nrw/api/v1/libraries/v2
> 
> ```

This needs a small correction: The URL added to the workspace settings must be without the `/api/v1/...` path.

And regarding the script: Please note that you should also take care of the file format version. Otherwise, the library management won’t work properly when a new major release of LibrePCB comes out. To ensure a smooth transition from one major version to the next, I recommend the following:

- In the JSON, the “format\_version” should not be hardcoded. Read this information from the file “.librepcb-lib”. Extract its first line – this is the format version. Currently it is “2”, but for LibrePCB 3.x it will be “3” and so on.
- Adjust the API path for every new major release. LibrePCB 2.x calls the API endpoint `/libraries/v2`, LibrePCB 3.x will call `/libraries/v3` and so on. This is important to keep older LibrePCB versions working fine even after a new major release with an updated file format comes out.
- Make sure that the libraries format\_version is always lower or equal to the API version number. For example the JSON of `/libraries/v2` must never contain libraries with format\_version=3. LibrePCB 2.x cannot open libraries with format\_version 3, so the library would basically disappear after installation. I’d recommend to add an assert to the shell script to guarantee this invariant is always fulfilled. (note that since LibrePCB v1, the format\_version can be considered as an integer, it won’t ever be a “major.minor” version number again.)

> [@Walter11](#):
>
> Somehow I was not able to upload it here. Even as ZIP always an error resulted.

That was probably the spam protection of the forum. I have assigned you a higher trust level, I guess ZIP should now work.

---

<div class="post-metadata">

**Author:** ![Walter11](https://avatars.discourse-cdn.com/v4/letter/w/a88e4f/32.png) [@Walter11](https://librepcb.discourse.group/u/Walter11)\
**Post date:** [June 6, 2026, 9:36am UTC](https://librepcb.discourse.group/t/hosting-library-server/1040/6 "2026-06-06T09:36:10Z")

</div>

> [@ubruhin](#):
>
> - Make sure that the libraries format\_version is always lower or equal to the API version number. For example the JSON of `/libraries/v2` must never contain libraries with format\_version=3. LibrePCB 2.x cannot open libraries with format\_version 3, so the library would basically disappear after installation. I’d recommend to add an assert to the shell script to guarantee this invariant is always fulfilled.

ok, great.

here is the corrected Script, now attached

[create\_librePCB\_json.sh.zip](https://librepcb.discourse.group/uploads/short-url/aVw58vtMbzqShjtAnMz7GMhKst7.zip) (1.8 KB)

---

<div class="post-metadata">

**Author:** ![glynischambers53](https://avatars.discourse-cdn.com/v4/letter/g/e0b2c6/32.png) [@glynischambers53](https://librepcb.discourse.group/u/glynischambers53)\
**Post date:** [August 7, 2026, 11:39am UTC](https://librepcb.discourse.group/t/hosting-library-server/1040/7 "2026-08-07T11:39:10Z")

</div>

GitLab Pages works but honestly for a public server you might hit some limits around discoverability—how are people supposed to find and search your library once it’s out there?

---

<div class="post-metadata">

**Author:** ![Walter11](https://avatars.discourse-cdn.com/v4/letter/w/a88e4f/32.png) [@Walter11](https://librepcb.discourse.group/u/Walter11)\
**Post date:** [August 10, 2026, 9:47am UTC](https://librepcb.discourse.group/t/hosting-library-server/1040/8 "2026-08-10T09:47:56Z")

</div>

Hosting on Gitlab was just the proof of principle and has the feature of an already included version control system. Copying to some other site for distribution is an easy task after that. However I am not there yet.  
Providing a ‘marketplace’ for user-contributed libraries would be an endeavour that the user community would need to organise in order to achieve visibility and a useful impact.

---

<div class="post-metadata">

**Author:** ![pknessness](https://yyz2.discourse-cdn.com/free1/user_avatar/librepcb.discourse.group/pknessness/32/421_2.png) [@pknessness](https://librepcb.discourse.group/u/pknessness)\
**Post date:** [September 11, 2026, 10:30am UTC](https://librepcb.discourse.group/t/hosting-library-server/1040/9 "2026-09-11T10:30:07Z")

</div>

I’ve started a small google sheets page as a start, if people would like to upload their libraries. Right now it just has my own pretty random library and an esp32-wroom library, but I plan on taking some time and making footprints for all the major footprint types that librepcb doesn’t cover by default and adding it as a library.

> **[Unofficial LibrePCB Libraries](https://docs.google.com/spreadsheets/d/1AepowhiB2wvQsfXxOv_NchyrPo2mkIIckEn31afRzA4/edit?gid=0#gid=0)**
>
> This Sheet is private

Hopefully this gets some use and the LibrePCB community can collate a collection of user-made unofficial libraries, and help bridge the gap and save others some work.
