Make your Cockpit page easily installable

Since version 152, Cockpit can discover and install packages that add pages to Cockpit. We call them “Applications” and as of now, only two of them exist: We have Fleet Commander and Cockpit’s own Diagnostic Reports in Fedora. You might have seen them on the Applications page:

Two Cockpit Applications

If you want your own page to appear there, you have to add suitable AppStream data to your package in the right location.

When your package is included in a distribution repository, the repository machinery will find the data in your package and make it available to software managers, such as the Cockpit “Applications” page.

For a Cockpit component, the AppStream data looks like this:

<component type="addon">
  <name>Demo Application</name>
    A demo add-on application for Cockpit
    <p>This is a demo application</p>
  <launchable type="cockpit-manifest">demo-app</launchable>

This would be placed at /usr/share/metainfo/org.cockpit-project.demo-app.metainfo.xml in your package.

The important bit is the launchable element with type cockpit-manifest. Any such AppStream component will be offered for installation by Cockpit. The value is the name of the Cockpit package for your page.

Use the component type addon and add an extends element for cockpit.desktop.

You should of course come up with your own value for the id element, in the usual reverse-DNS style, and adjust the filename accordingly.