A snap is a SquashFS filesystem image. snapd mounts each installed revision read-only
at /snap/name/revision/, and each app becomes a command
/snap/bin/name[.app] (the suffix is left out when the
app and snap have the same name). This page follows “The snap format” in the Snapcraft
documentation; meta/snap.yaml is the built package’s metadata, read by
snapd, and is distinct from the snapcraft.yaml used to build it. The
SquashFS parameters (compression, block size) are not given there.
The meta folder
| Path | Contents |
|---|---|
meta/snap.yaml | The snap’s metadata (below), in YAML. |
meta/hooks/ | Hooks: programs snapd calls on events or to ask the snap for input. |
meta/gui/icon.svg, icon.png | The snap’s icon. |
meta/gui/*.desktop | Desktop entries (XDG Desktop Entry 1.1 with exceptions): Exec= must be name[.app] [args]; DBusActivatable, TryExec, Implements and unknown keys are removed on install. |
Top-level keys
Most keys are optional.
| Key | Meaning and values |
|---|---|
name | Suggested snap name: a–z, 0–9 and inner dashes. The store’s snap-declaration assertion can override it. |
title | Display title; capitals and spaces allowed. |
version | The software’s version, with no ordering meaning. |
summary | One-line description. |
description | Longer description. |
license | SPDX licence expression. |
type | app (default), gadget, kernel or base; core is deprecated. |
architectures | List: all (default), amd64, i386, armhf and others. |
base | The base snap that provides the root filesystem the snap runs on. |
assumes | Features snapd must have, such as snapd2.38. |
epoch | Data compatibility epoch (snapd 2.38 and later). |
system-usernames | Map of user name to shared (or {scope: shared}); names _daemon_ (snapd 2.61 and later) and snap-daemon (deprecated). |
apps | Map of app names to app definitions. |
Top-level plugs, slots, hooks and layouts are documented
separately and are not covered here.
App keys
| Key | Meaning and values |
|---|---|
command | Program to run, relative to the snap, with arguments. |
command-chain | Programs run in order before command. |
common-id | The app’s ID in an AppStream file. |
completer | Path of a bash completion script (snapd 2.30 and later). |
plugs, slots | Names of the plugs and slots the app uses. |
daemon | Makes the app a service: simple, forking, oneshot or notify. |
install-mode | enable (default) or disable: whether a new service starts automatically. |
refresh-mode | restart (default) or endure (keep running across refreshes). |
sockets | Named sockets for socket activation of the service. |
socket-mode | Octal permissions of a socket, such as 0644. |
stop-mode | sigterm, sighup, sigusr1 or sigusr2, each optionally with -all (signal the whole process group). |
stop-command | Command to stop the service. |
start-timeout, stop-timeout | Durations with units ns, us, ms, s or m. |
post-stop-command | Command run after the service stops. |
restart-condition | on-failure (default), on-success, on-abnormal, on-abort, always or never. |
restart-delay | Delay between restarts (snapd 2.36 and later). |
watchdog-timeout | systemd watchdog time (snapd 2.33 and later); needs a manually connected daemon-notify plug. |
reload-command | Command to reload the service; without it, reloading restarts it. |
before, after | Other apps of the snap to start after or before (snapd 2.31 and later). |
timer | Timer specification for a daemon app (snapd 2.33 and later). |
autostart | Desktop file name to put in $SNAP_USER_DATA/.config/autostart (snapd 2.32.4 and later). |
Sources
Snapcraft documentation, “The snap format” (snapcraft.io/docs, reference, development, YAML schemas). Not covered here: SquashFS parameters, top-level plugs and slots, hooks and layouts, confinement and grade, which that page does not list.