Snap documentation


#1

Welcome to the home of snap, snapd, and snapcraft documentation.

ⓘ Snaps are app packages for desktop, cloud and IoT that are easy to install, secure, cross-platform and dependency-free.

  • snap is both the command line interface and the application package format
  • snapd is the background service that manages and maintains your snaps
  • snapcraft is the command and the framework used to build your own snaps
  • Snap Store provides a place to upload your snaps, and for users to browse and install

Discovering snap:

Getting started Discover how snaps are used, installed, updated, removed and managed
Installing snap Step-by-step installation instructions for all major Linux distributions, from Arch to Zorin
Channels Get the latest stable releases of your favourite software, or run cutting edge versions

Advanced features:

Controlling updates Snaps update automatically, but you can also manually control when and how often
Snapshots Save, backup and restore the state of one or more installed snaps
Parallel installs Install more than one version of the same snap on your system

Building your own snaps:

Snapcraft overview Learn how to Install snapcraft and build your first snaps
Creating a snap Step-by-step guides for Python, Go, Electron, pre-built binaries and more
The snapcraft format A comprehensive look at the various values that can be defined within a snap’s build file

Most of this documentation can be collaboratively discussed and changed on the respective topic in the doc category of the Snapcraft forum. See the documentation guidelines if you’d like to contribute.

Navigation

Using

Publishing

Developing

URLs

Mapping table
Topic Path
Release notes: Snapcraft 3.8 /docs/release-notes-snapcraft-3-8
The gpio-control interface /docs/gpio-control-interface
The appstream-metadata interface /docs/appstream-metadata-interface
The packagekit-control interface /docs/packagekit-control-interface
Ubuntu Core boot modes /docs/ubuntu-core-boot-modes
Installing snap on Red Hat Enterprise Linux (RHEL) /docs/installing-snap-on-red-hat
Permission requests /docs/permission-requests
Services and daemons /docs/services-and-daemons
Snap Store metrics /docs/snap-store-metrics
Using the Snap Store /docs/using-the-snap-store
The conda plugin /docs/the-conda-plugin
The crystal plugin /docs/the-crystal-plugin
The colcon plugin /docs/the-colcon-plugin
Debugging building snaps /docs/debugging-building-snaps
Release management /docs/release-management
Deprecation notices /docs/deprecation-notices
Deprecation notice: 1 /docs/deprecation-notice-1
Deprecation notice: 2 /docs/deprecation-notice-2
Deprecation notice: 3 /docs/deprecation-notice-3
Deprecation notice: 4 /docs/deprecation-notice-4
Deprecation notice: 5 /docs/deprecation-notice-5
Deprecation notice: 6 /docs/deprecation-notice-6
Deprecation notice: 7 /docs/deprecation-notice-7
Deprecation notice: 8 /docs/deprecation-notice-8
Deprecation notice: 9 /docs/deprecation-notice-9
Deprecation notice: 10 /docs/deprecation-notice-10
Deprecation notice: 10 /docs/deprecation-notices/dn10
Parts lifecycle /docs/parts-lifecycle
Release notes: Snapcraft 3.7 /docs/release-notes-snapcraft-3-7
Release notes: Snapcraft 3.6 /docs/release-notes-snapcraft-3-6
Release notes: Snapcraft 3.5 /docs/release-notes-snapcraft-3-5
Release notes: Snapcraft 3.4 /docs/release-notes-snapcraft-3-4
Troubleshoot snap building /docs/troubleshoot-snap-building
Defining a command /docs/defining-a-command
Iterating over a build /docs/iterating-over-a-build
Build and staging dependencies /docs/build-and-staging-dependencies
Adding parts /docs/adding-parts
Base snaps /docs/base-snaps
Adding global metadata /docs/adding-global-metadata
Snapcraft checklist /docs/snapcraft-checklist
Tab completion for snaps /docs/tab-completion
Debuging snap startup performance issues /docs/debuging-startup-performance
The personal-files interface /docs/personal-files-interface
The system-files interface /docs/system-files-interface
Snapshots /docs/snapshots
Architectures /docs/architectures
Build on Docker /docs/build-on-docker
Build on LXD /docs/build-on-lxd
C/C++ applications /docs/c-c-applications
Channels /docs/channels
Choosing a security model /docs/choosing-a-security-model
Commands and aliases /docs/commands-and-aliases
Configuration in snaps /docs/configuration-in-snaps
Creating a snap /docs/creating-a-snap
Create a developer account /docs/creating-your-developer-account
Debugging building snaps /docs/debugging-building-snaps
Developing hotplug interfaces /docs/developing-hotplug-interfaces
Documentation guidelines /docs/documentation-guidelines
Electron apps /docs/electron-apps
Environment variables /docs/environment-variables
Getting ready for stable /docs/getting-ready-for-stable
Getting started /docs/getting-started
Go applications /docs/go-applications
Hotplug support /docs/hotplug-support
Install snapcraft on macOS /docs/install-snapcraft-on-macos
Installing snap on Arch Linux /docs/installing-snap-on-arch-linux
Installing snap on CentOS /docs/installing-snap-on-centos
Installing snap on Debian /docs/installing-snap-on-debian
Installing snap on Deepin /docs/installing-snap-on-deepin
Installing snap on elementary OS /docs/installing-snap-on-elementary-os
Installing snap on Fedora /docs/installing-snap-on-fedora
Installing snap on GalliumOS /docs/installing-snap-on-galliumos
Installing snap on KDE Neon /docs/installing-snap-on-kde-neon
Installing snap on Kubuntu /docs/installing-snap-on-kubuntu
Installing snap on Linux Mint /docs/installing-snap-on-linux-mint
Installing snap on Lubuntu /docs/installing-snap-on-lubuntu
Installing snap on Manjaro Linux /docs/installing-snap-on-manjaro-linux
Installing snap on openSUSE /docs/installing-snap-on-opensuse
Installing snap on Parrot Security OS /docs/installing-snap-on-parrot-security-os
Installing snap on Raspbian /docs/installing-snap-on-raspbian
Installing snap on Solus /docs/installing-snap-on-solus
Installing snap on Ubuntu /docs/installing-snap-on-ubuntu
Installing snap on Xubuntu /docs/installing-snap-on-xubuntu
Installing snap on Zorin OS /docs/installing-snap-on-zorin-os
Installing snapd /docs/installing-snapd
Installing the Snap Store app /docs/installing-snap-store-app
Interface hooks /docs/interface-hooks
Interface management /docs/interface-management
Java applications /docs/java-applications
Keeping snaps up to date /docs/keeping-snaps-up-to-date
MOOS applications /docs/moos-applications
Node apps /docs/node-apps
Parallel Installs /docs/parallel-installs
Process for aliases, auto-connections and tracks /docs/process-for-aliases-auto-connections-and-tracks
Process for reviewing classic confinement snaps /docs/reviewing-classic-confinement-snaps
Python apps /docs/python-apps
Registering your app name /docs/registering-your-app-name
Release notes: Snapcraft 3.0 /docs/release-notes-snapcraft-3-0
Release notes: Snapcraft 3.1.1 /docs/release-notes-snapcraft-3-1-1
Release notes: Snapcraft 3.1 /docs/release-notes-snapcraft-3-1
Release notes: Snapcraft 3.2 /docs/release-notes-snapcraft-3-2
Release notes: Snapcraft 3.3 /docs/release-notes-snapcraft-3-3
Releasing to the Snap Store /docs/releasing-to-the-snap-store
Releasing your app /docs/releasing-your-app
Remote (reusable) parts /docs/remote-reusable-parts
ROS applications /docs/ros-applications
ROS2 applications /docs/ros2-applications
Ruby applications /docs/ruby-applications
Rust applications /docs/rust-applications
Scriptlets /docs/scriptlets
Service management /docs/service-management
Snap confinement /docs/snap-confinement
Snap Documentation (page deprecated) /docs/snap-documentation
Snap epochs /docs/snap-epochs
Snap layouts /docs/snap-layouts
Snapcraft advanced grammar /docs/snapcraft-advanced-grammar
Snapcraft app and service metadata /docs/snapcraft-app-and-service-metadata
Snapcraft build, debug and publishing docs roadmap /docs/snapcraft-docs-roadmap
Snapcraft filesets /docs/snapcraft-filesets
Snapcraft lifecycle /docs/snapcraft-lifecycle
Snapcraft overview /docs/snapcraft-overview
Snapcraft parts metadata /docs/snapcraft-parts-metadata
Snapcraft plugin API /docs/snapcraft-plugin-api
Snapcraft plugins /docs/snapcraft-plugins
Snapcraft release notes /docs/snapcraft-release-notes
Snapcraft top-level metadata /docs/snapcraft-top-level-metadata
Snapcraft.yaml reference /docs/snapcraft-yaml-reference
Snapshots /docs/snapshots
Supported interfaces /docs/supported-interfaces
Supported plugins /docs/supported-plugins
Supported snap hooks /docs/supported-snap-hooks
System options /docs/system-options
Tab completion for snaps /docs/tab-completion-for-snaps
The account-control interface /docs/account-control-interface
The accounts-service interface /docs/accounts-service-interface
The adb-support interface /docs/adb-support-interface
The alsa interface /docs/alsa-interface
The ament plugin /docs/ament-plugin
The ant plugin /docs/ant-plugin
The autopilot-introspection interface /docs/autopilot-introspection-interface
The autotools plugin /docs/autotools-plugin
The avahi-control interface /docs/avahi-control-interface
The avahi-observe interface /docs/avahi-observe-interface
The block-devices interface /docs/block-devices-interface
The bluetooth-control interface /docs/bluetooth-control-interface
The bluez interface /docs/bluez-interface
The bool-file interface /docs/bool-file-interface
The broadcom-asic-control interface /docs/broadcom-asic-control-interface
The browser-support interface /docs/browser-support-interface
The calendar-service interface /docs/calendar-service-interface
The camera interface /docs/camera-interface
The can-bus interface /docs/can-bus-interface
The catkin plugin /docs/catkin-plugin
The catkin-tools plugin /docs/catkin-tools-plugin
The classic-support interface /docs/classic-support-interface
The cmake plugin /docs/cmake-plugin
The content interface /docs/content-interface
The core-support interface /docs/core-support-interface
The cpu-control interface /docs/cpu-control-interface
The cups-control interface /docs/cups-control-interface
The daemon-notify interface /docs/daemon-notify-interface
The dbus interface /docs/dbus-interface
The dcdbas-control interface /docs/dcdbas-control-interface
The desktop interface /docs/desktop-interface
The desktop interfaces /docs/desktop-interfaces
The desktop-legacy interface /docs/desktop-legacy-interface
The device-buttons interface /docs/device-buttons-interface
The display-control interface /docs/display-control-interface
The docker interface /docs/docker-interface
The docker-support interface /docs/docker-support-interface
The docs roadmap /docs/docs-roadmap
The dotnet plugin /docs/dotnet-plugin
The dummy interface /docs/dummy-interface
The dump plugin /docs/dump-plugin
The dvb interface /docs/dvb-interface
The firewall-control interface /docs/firewall-control-interface
The framebuffer interface /docs/framebuffer-interface
The fuse-support interface /docs/fuse-support-interface
The fwupd interface /docs/fwupd-interface
The gadget snap /docs/gadget-snap
The go plugin /docs/go-plugin
The gpg-keys interface /docs/gpg-keys-interface
The gpg-public-keys interface /docs/gpg-public-keys-interface
The gpio interface /docs/gpio-interface
The gpio-memory-control interface /docs/gpio-memory-control-interface
The Gradle plugin /docs/gradle-plugin
The greengrass-support interface /docs/greengrass-support-interface
The gsettings interface /docs/gsettings-interface
The gulp plugin /docs/gulp-plugin
The hardware-observe interface /docs/hardware-observe-interface
The hardware-random-control interface /docs/hardware-random-control-interface
The hardware-random-observe interface /docs/hardware-random-observe-interface
The hidraw interface /docs/hidraw-interface
The home interface /docs/home-interface
The hostname-control interface /docs/hostname-control-interface
The i2c interface /docs/i2c-interface
The iio interface /docs/iio-interface
The intel-mei interface /docs/intel-mei-interface
The io-ports-control interface /docs/io-ports-control-interface
The jdk plugin /docs/jdk-plugin
The joystick interface /docs/joystick-interface
The juju-client-observe interface /docs/juju-client-observe-interface
The kbuild plugin /docs/kbuild-plugin
The kernel-module-control interface /docs/kernel-module-control-interface
The kernel-module-observe interface /docs/kernel-module-observe-interface
The kernel plugin /docs/kernel-plugin
The kernel snap /docs/kernel-snap
The kubernetes-support interface /docs/kubernetes-support-interface
The kvm interface /docs/kvm-interface
The libvirt interface /docs/libvirt-interface
The locale-control interface /docs/locale-control-interface
The location-control interface /docs/location-control-interface
The location-observe interface /docs/location-observe-interface
The log-observe interface /docs/log-observe-interface
The lxd interface /docs/lxd-interface
The lxd-support interface /docs/lxd-support-interface
The make plugin /docs/make-plugin
The maliit interface /docs/maliit-interface
The maven plugin /docs/maven-plugin
The media-hub interface /docs/media-hub-interface
The meson plugin /docs/meson-plugin
The mir interface /docs/mir-interface
The modem-manager interface /docs/modem-manager-interface
The mount-observe interface /docs/mount-observe-interface
The mpris interface /docs/mpris-interface
The netlink-audit interface /docs/netlink-audit-interface
The netlink-connector interface /docs/netlink-connector-interface
The network-bind interface /docs/network-bind-interface
The network-control interface /docs/network-control-interface
The network interface /docs/network-interface
The network-manager interface /docs/network-manager-interface
The network-observe interface /docs/network-observe-interface
The network-setup-control interface /docs/network-setup-control-interface
The network-setup-observe interface /docs/network-setup-observe-interface
The network-status interface /docs/network-status-interface
The nil plugin /docs/nil-plugin
The nodejs plugin /docs/nodejs-plugin
The ofono interface /docs/ofono-interface
The online-accounts-service interface /docs/online-accounts-service-interface
The opengl interface /docs/opengl-interface
The openvswitch interface /docs/openvswitch-interface
The openvswitch-support interface /docs/openvswitch-support-interface
The optical-drive interface /docs/optical-drive-interface
The password-manager-service interface /docs/password-manager-service-interface
The personal-files interface /docs/personal-files-interface
The physical-memory-control interface /docs/physical-memory-control-interface
The physical-memory-observe interface /docs/physical-memory-observe-interface
The plainbox-provider plugin /docs/plainbox-provider-plugin
The ppp interface /docs/ppp-interface
The process-control interface /docs/process-control-interface
The pulseaudio interface /docs/pulseaudio-interface
The python plugin /docs/python-plugin
The qmake plugin /docs/qmake-plugin
The raw-usb interface /docs/raw-usb-interface
The removable-media interface /docs/removable-media-interface
The ruby plugin /docs/ruby-plugin
The rust plugin /docs/rust-plugin
The scons plugin /docs/scons-plugin
The screen-inhibit-control interface /docs/screen-inhibit-control-interface
The serial-port interface /docs/serial-port-interface
The shutdown interface /docs/shutdown-interface
The snap format /docs/snap-format
The snapcraft format /docs/snapcraft-format
The snapd-control interface /docs/snapd-control-interface
The snapd roadmap /docs/snapd-roadmap
The spi interface /docs/spi-interface
The ssh-keys interface /docs/ssh-keys-interface
The ssh-public-keys interface /docs/ssh-public-keys-interface
The storage-framework-service interface /docs/storage-framework-service-interface
The system-files interface /docs/system-files-interface
The system-observe interface /docs/system-observe-interface
The system /snap directory /docs/system-snap-directory
The system-trace interface /docs/system-trace-interface
The thumbnailer-service interface /docs/thumbnailer-service-interface
The time-control interface /docs/time-control-interface
The timeserver-control interface /docs/timeserver-control-interface
The timezone-control interface /docs/timezone-control-interface
The tpm interface /docs/tpm-interface
The u2f-devices interface /docs/u2f-devices-interface
The ubuntu-download-manager interface /docs/ubuntu-download-manager-interface
The udisks2 interface /docs/udisks2-interface
The uhid interface /docs/uhid-interface
The unity7 interface /docs/unity7-interface
The unity8-calendar interface /docs/unity8-calendar-interface
The unity8-contacts interface /docs/unity8-contacts-interface
The unity8 interface /docs/unity8-interface
The upower-observe interface /docs/upower-observe-interface
The waf plugin /docs/waf-plugin
The wayland interface /docs/wayland-interface
The x11 interface /docs/x11-interface
Using external metadata /docs/using-external-metadata
Using in-development features in `snapcraft.yaml` /docs/using-in-development-features
Writing local plugins /docs/writing-local-plugins
Building the snap /docs/building-snaps
Building the snap on Docker /docs/build-snaps-on-docker

Redirects

Mapping table
Path Location
/docs/security-model /docs/choosing-a-security-model
/docs/build-snaps-on-docker /docs/build-on-docker

New docs.snapcraft.io publishing process
Proposed new documentation outline
#2

Hi Robin,

Two suggestions for the format, and one comment about the data:

1. Information is boring

The output is long and boring for most people. It’s okay to have it here as it’s closely related with a table of contents, which is one of the purposes of this page, and having it here also makes it convenient to fetch at once for the dynamic systems. But we don’t need to show it all the time. We can fix that by folding it:

URLs

… content goes here …

Implemented with:

[details=URLs]
... content goes here ...
[/details]

2. Format is hard to read

It’s a lot of data and naturally repetitive. We can probably improve the situation significantly by reformatting it in a more stable way. For example:

Page URL
Creating a snap /creating-a-snap

This is not only shorted, but it’ll turn out a lot more pleasant because the two columns will align. The awkward arrow, which doesn’t align well in the font used here, is also gone.

It’s implemented with:

| Page | URL |
| --- | --- |
| https://forum.snapcraft.io/t/creating-a-snap/6799 | /creating-a-snap |

Then, a third comment on the actual data:

3. Not offering any value

This is a premature comment, but worth raising it now before the data is final. All those links seem to simply point to a URL that uses the exact same text as the title. This doesn’t seem to offer any value, and it’s a lot of trouble for no value. If that’s what we’ll do in 99% of the cases, then it’d be worth asking what the motivation is again.


#3

Thanks @niemeyer

I agree that it looks very long and boring and hard to read, and I like your suggestions 1 and 2. I’ll make it a <table> in a <details> element.

I can appreciate point 3, and it would be very nice if it was possible to make it automatically simply use the slug as the pretty URL. However, this doesn’t work practically for 2 reasons:

  1. Slugs change as soon as someone changes the title of the topic. One of the requirements here is that these URLs are crafted, rather than user-editable, and that they don’t change. So the idea here is that, even though initially these pretty URLs might closely resemble the slug (although I did strip out extra words like “the”), the slug will probably change over time but the URL will persist unless we change it deliberately.
  2. It’s very slow to try to retrieve a topic by slug alone (without ID) (you need to do a general search, then crawl through search results to check the titles/slugs manually). It’s much more efficient to have a mapping somewhere.

We could make the mapping shorted, by simply doing:

| ID | Path |
| -- | ---- |
| 6799 | /creating-a-snap |

I opted for the more verbose version:

| ID | Path |
| -- | ---- |
| https://forum.snapcraft.io/t/creating-a-snap/6799 | https://docs.snapcraft.io/creating-a-snap |

Because this then shows both sides as links, which mean that users can actually click on them to see the page, either on the forum or the documentation side.

But if you think the succinctness of the data in the table outweighs the clickability, I’m happy to entertain the shorter version.


#4

I get it. My point is a more conceptual one, to be raised upstream: if we are not doing anything other than taking Graham’s suggestion of title in 99.9% of the cases, then the whole exercise seems kind of pointless. We don’t need so many people in the loop.

Can we please use the shorter version? The second part is not really a link, but rather the suffix that generates the link. So if the link doesn’t work, it’s the underlying mechanism that is broken and not the link itself. Also, the link won’t work as soon as the file is put live either, as there will necessarily be at least a short delay between it being saved and the system acting on it. So the shorter form is both more pleasant to read, and more appropriate it seems.


#5

Can we please use the shorter version?

Okay, so which do you prefer?

ID Path
6799 /creating-a-snap

Or:

ID Path
6799 /creating-a-snap

Or:

Topic Path
Creating a snap /creating-a-snap

#6

The last one feels like a pretty good trade off between ease of writing it the first time, ease of reading, and convenience in terms of clicking on the link to see the content.


#7

All the content of Building the snap on Docker has been merged into Build on Docker a while ago.

The first page however, still shows up in google searches:

So I removed the content of the first page and added a notice redirecting to the correct one. Is it possible to remove the page entirely and create a redirect pointing /docs/build-snaps-on-docker to /docs/build-on-docker?


#8

That’s a good point, thanks - and thanks for the edits. I’ll add the redirect now.


#10

I’ve been gathering and updating documentation for creating snaps of desktop applications. This is tricky to get right and very specific to which toolkit you use.

Given the many questions on this forum about desktop toolkits, it’s clear that many people are struggling with this, so we should give it a clear place in the docs, but I’m not sure where.

The easiest route might be to just add Desktop app support to the navigation, but it doesn’t really fit in there. I added a link to this document in the checklist page, but I don’t think that is visible enough.

Creating a snap has the “common languages and platforms” table. I was thinking of adding another table or column called “Desktop toolkits” which contains “Electron” (moved from “languages”), “Qt”, “GTK”, “Java Swing”, “wxWidgets” and “other”. This could be expanded in the future with other toolkits and things like OpenGL (which is more complex than simply adding an interface) and ffmpeg.

However, many of these topics don’t really fit into the style of a complete walkthrough. I can update them a bit to look more similar, but I’m not sure if it makes sense to turn pages like Qt5 and GTK into complete walkthroughs since these are meant to be used together with one of the languages. For example, an application might use Python + GTK3 or Go + Qt5 etc.

@degville, what do you think?


#11

Thanks for working on this, and for highlighting desktop toolkit documentation. You’ve raised a really important point, and one we’ve spent considerable time discussing internally. It’s definitely something we want to get right.

Part of the delay in writing a good set of docs for this has been waiting for desktop extensions to mature enough to handle the hard dependency parts - these extensions should transform the process, and they’re close being ready.

Another part has been that we wanted to make sure there was a wider doc support structure for snap building before tackling desktop integration. This is what we’ve been working on with the Snapcraft build, debug and publishing docs roadmap, and it’s almost complete too.

I think we can do this in both of the ways you suggest. A walkthrough is really useful, and helps give a wider context to how snaps are built, even when they don’t fit your exact use-case. It’s also great for Google, etc. Adding a new table to Creating a snap to link to these makes good sense to me.

But as you also mention, a walkthrough doesn’t fit into our current (published) docs style. I think to integrate both, we need to make sure the core details for what’s discussed in any walkthrough are included in the more formal doc structure. I think walkthroughs should be a little like CI testing in code - they bring together the various elements of what’s already documented into a fully working example, but they shouldn’t be adding new ‘functionality’ themselves.

Adding to the wider docs is something I (or anyone, really!) can do if you feel like we’re not explaining something clearly, or if you feel a topic has become vague or outgrown its original intent. And it’s easier to do when that content already exists, whatever form it takes.

TLDR:

  • thanks!
  • I think walkthrough-style docs for desktop toolkit integration is a good idea
  • desktop toolkit integration is currently changing, but still worth documenting
  • a new table on Creating a snap is a good place for them
  • I/we need to make sure whatever we cover in a walkthrough is easily discoverable and more formally documented in the normal doc structure. This may be easier to do after a walkthrough has been written.

I’ll also have a discussion with the Snapcraft/Advocacy teams on how best we can handle desktop toolkit integration.


#12

I have some stuff I need your help with. I’m not completely done cleaning up these pages, but having them online would make my job a bit easier.

Please give the following pages a canonical url.

Feel free to change the path etc.

Topic Path
Adding OpenGL/GPU support to a snap /docs/gpu-support
Desktop files for menu integration /docs/desktop-menu-icon-support
Desktop applications /docs/desktop-applications
Desktop App Support - GTK /docs/gtk-applications
Desktop App support - Qt /docs/qt-applications
Desktop App support - Qt4 /docs/qt4-applications
Desktop App support - Qt5 /docs/qt5-applications
Desktop App support - Qt (for snaps without bases) /docs/legacy-qt-applications

Pages to turn into a wiki

I made them or I want to edit them.

Pages to remove from the sidebar

Pages to add to the sidebar

I propose to add this to the sidebar. I’ll also link to the specific tutorials (GTK3, qt5, …) from the “creating a snap” page.


#13

I’ll make all the necessary fixes you’ve requested - thank you for all this!