Fabrica – Your self-hosted snap factory

by Igor Ljubuncic on 5 June 2020

There are many ways one can go about building snaps. You can do it on your local system, by manually running commands in a terminal window. If you have a developer account in the Snap Store, you can use the integrated build functionality to create snaps. You can also use Launchpad, Electron Builder or a range of CI/CD systems. And you can also run your own, self-hosted snap building factory!

Setting up shop

Fabrica is a brand new, early development, locally hosted Web service designed to help developers build snaps. The idea behind Fabrica is simple and clever. You get an automated system that can hook up remote repositories and build snaps whenever there is a change in the source tree. This way, you can manage multiple projects and generate up-to-date builds, with little to no interaction.

Fabrica consists of two layers:

  • A simple Web UI that allows you to add an unlimited number of publicly available, clonable Git trees. You can choose different (or multiple) branches for each tree.
  • Under the hood, Fabrica runs the LXD container service, which spawns container instances, inside which the Git trees are cloned and snaps built. You can then “download” the built snaps, test and use them.

Fabrica prerequisites

The first step is to install and configure the LXD service on your system. If you already have it, then you can skip this step. If not, you should install the LXD snap, and go through the first-time setup wizard on the command line. For most users, the default options will work just fine.

snap install lxd
sudo lxd init

Once the LXD component is set up, you can install Fabrica:

snap install fabrica

After the snap is installed, you will need to do just a tiny bit of manual work. Snaps are designed to be self-contained applications, with strong security and isolation from the underlying system and other software running on it. Granular access to system resources is possible through a mechanism called interfaces. Some interfaces are auto-connected; when you install a snap, the requested resources are provisioned automatically. Some, for security reasons, are not.

In this particular case, you will need to grant Fabrica permission to access the LXD service, mount-observe (read mount table and quota information), and system-observe (read process and system information).

snap connect fabrica:lxd lxd:lxd
snap connect fabrica:mount-observe
snap connect fabrica:system-observe

Now, you are all set.

Fabrica in action

Fabrica runs and listens on port 8000. At the moment, the connection is available via HTTP, and there is no secure tunnel or authentication, which means you ought to test and run this service over trusted networks only. As a project in development, it should receive new features and capabilities in the future.

You can now add repositories. Choose the desired project and branch.

Once added, you can manually trigger a build, or wait for a scheduled operation. Fabrica polls the added repositories for changes every five minutes, and will trigger a build if one is required.

While a build is running, you can inspect what’s happening by clicking on the “i” icon in each build line. This will expand the log and show the commands running inside the build container, like perhaps the repository data fetch, system update, compilation, or other commands. All of this happens in isolation from your underlying system.

Once the snap is built, you can use the “Download” button to fetch it from inside the container build environment and place it somewhere on your disk. And that’s it. You have a repository configured for automated builds in a simple and convenient way.

Fabrica currently generates builds only for the local architecture (like say AMD64), so if you want to create builds for other platforms, you will need to set up Fabrica on corresponding hardware (like say Raspberry Pi 4). But this may become simpler and easier in the future.


For people looking for a largely hands-free setup to automate their snaps builds, Fabrica offers a simple, convenient solution. It is not designed to replace the existing methods; instead, it complements the robust build and integration mechanisms already in place, and offers yet another practical toolbox to developers and enthusiastic users.

Now, some options and features are currently unavailable, like perhaps authentication or customizable build trigger period, but this is where you come in! Grab Fabrica and run your own tests, and if you have any recommendations or suggestions, please join our forum, and share your thoughts.

Photo by Science in HD on Unsplash.

Newsletter Signup

Related posts


Chris Sells(Google)、Ken VanDine(Canonical) GoogleはFlutterの開発当初から、ターゲットプラットフォームを問わず、ネイティブ速度で動作する美しいUIを構築するための移植可能なフレームワークを目指しています。このため当初はAndroidとiOSのモバイルプラットフォームに力を注ぎました。Google Playには、すでに8万種類以上の美しいFlutterアプリが公開されています。 この成功を踏まえ、1年以上前から、ウェブOSとデスクトップOS(macOS、Windows、Linux)の両方でデスクトップクラスの体験を提供することに努めてきました。たとえば、デスクトップタイプのマウス入力とキーボード入力のほか、サイズ調整可能 […]


本文由Chris Sells(Google)和Ken VanDine(Canonical)所写 Google对Flutter的目标一直是提供一个构建以原生速度运行的精美UI的可移植的框架,无论您使用的平台是什么。为了验证此功能,我们首先关注于Android和iOS移动平台,我们已经在Google Play上看到了8万多个快速和精美的Flutter应用程序。 为了获得成功,一年多来,我们一直将重点扩展到包括桌面级体验,包括针对Web和桌面系统(macOS,Windows和Linux)的体验。这项工作包括对引擎的大量重构,以支持桌面样式的鼠标和键盘输入以及可调整大小的顶层窗口。它还包括可以很好地适应桌面的新UI功能,例如Material Density支持和Navigatio […]

How to manage snap updates

Updates are an integral part of the software lifecycle. Quite often, they bring improvements, vital security patches – and sometimes, unfortunately, bugs, too. In mission-critical environments, it is important to assert a high degree of oversight and precision over updates. Snaps come with a built-in automatic update mechanism, whereby sn […]