Snapcraft top-level metadata

The top-level keys and values in snapcraft.yaml provide the snap build process, and the store, with the overarching details of a snap.

See Snapcraft app metadata and Snapcraft parts metadata for details on how apps and parts are configured within snapcraft.yaml.

Top-level details include a snap’s name, version and description, alongside operational values such as its confinement level and supported architecture.


Type: string

Incorporate external metadata via the referenced part.

See Using external metadata for more details.


Type: list[object]

List of build and run architectures.

For more details, see Architectures.


Type: list[string]

A list of features that must be supported by the core in order for this snap to install. For example to make the snap only installable on certain recent version of snapd(like 2.38) you can specify:

- snapd2.38

Other potential values for assumes include:

  • common-data-dir: support for common data directory across revisions of a snap.
  • snap-env: support for the “Environment:” feature in snap.yaml
  • command-chain: support for the “command-chain” feature for apps and hooks in snap.yaml


Type: string

A snap of type base to be used as the execution environment for this snap. See Base snaps for further details.


bare Empty base snap, useful for fully statically linked snaps and testing
core Ubuntu Core 16
core18 Ubuntu Core 18
core20 Ubuntu Core 20


Type: string

Sets the compression type for the snap. Can be xz or lzo. Defaults to xz when not specified.

Snaps are compressed using xz data compression by default. This offers the optimal performance to compression ratio for the majority of snaps.

However, there are certain types of snap, such as large desktop applications, that can benefit from using LZO compression. Snaps compressed with lzo are slightly larger but can decompress quicker, reducing the time it takes for freshly installed or refreshed snaps to launch.

To specify lzo compression, set compression: lzo in your snap’s snapcraft.yaml and rebuild your snap, as shown in the following example:

name: test-snapcraft-lzo
base: core18
version: "0.1"
summary: Test LZO snap
description: Test LZO snap
grade: stable
confinement: strict

# this line enables LZO compression for the snap
compression: lzo

    plugin: nil

    command: bin/something


Type: enum

Determines if the snap should be restricted in access or not.

Possible values are strict (for no access outside of declared interfaces through plugs), devmode (for unrestricted access) or classic. For more information, refer to Confinement.

Examples: strict, or devmode


Type: list[string] | string
(Introduced: Snapcraft 5.0 optional)

A contact for the snap in the form of a URL or email address.


Type: string

Multi-line description of the snap.

A more in-depth look at what your snap does and who may find it most useful.


Type: list[string] | string
(Introduced: Snapcraft 5.0 optional)

A link or list of links to receive donations for the snap.


Type: enum

Defines the quality grade of the snap.

Can be either devel (i.e. a development version of the snap, so not to be published to the stable or candidate channels) or stable (i.e. a stable release or release candidate, which can be released to all channels).

Example: [stable or devel]


Type: list[dict]

Hooks permit executable files to run within a snap’s confined environment when a certain action occurs.

By default, hooks run with no plugs. If a hook needs more privileges, it one can use this top-level hooks attribute:

hooks: # Top-level YAML attribute, parallel to `apps`
  configure: # Hook name, corresponds to executable name
    plugs: [network] # Or any other plugs required by this hook

See Snapcraft hook support for more details.


Type: list[string] | string
(Introduced: Snapcraft 5.0 optional)

A link or list of links to report issues for the snap.


Type: string

Path to icon image that represents the snap in the store pages and other graphical store fronts.

Note that the desktop menu does not use this icon. It uses the icon in the .desktop file of the application.

It is a relative path to a .png/.svg file from the source tree root. The recommended size is 256x256 pixels. Aspect ratio needs to be 1:1. Image size can vary from 40x40 to 512x512 px and the file size should not be larger than 256 KB.

Examples: _package_name_.svg, or snap/gui/logo.png


Type: list[dict]

Layouts modify the execution environment of a strictly-confined snap.

With layouts, you can make elements in $SNAP , $SNAP_DATA , $SNAP_COMMON accessible from locations such as /usr , /var and /etc . This helps when using pre-compiled binaries and libraries that expect to find files and directories outside of locations referenced by $SNAP or $SNAP_DATA .

See Snap layouts for more details.


    bind: $SNAP_DATA/var/lib/foo
    bind: $SNAP/usr/share/foo
    bind-file: $SNAP_DATA/etc/foo.conf


Type: string

A license for the snap in the form of an SPDX expression for the license.

In the legacy Snapcraft syntax (not using the base key), this key is only available through the passthrough key.

Currently, only SPDX 2.1 expressions are supported. A list of supported values are also available at snapd/licenses.go at master · snapcore/snapd.

For “or later” and “with exception” license styles refer to the Appendix IV of the SPDX Specification 2.1.

Examples: GPL-3.0+, MIT, Proprietary


Type: string

The identifying name of the snap.

It must start with an ASCII character and can only contain letters in lower case, numbers, and hyphens, and it can’t start or end with a hyphen. The name must be unique if you want to publish to the Snap Store.

For help on choosing a name and registering it on the Snap Store, see Registering your app name.

Example: my-awesome-app


Type: type[object]

Attributes to passthrough to snap.yaml without validation from snapcraft.

See Using development features in snapcraft for more details.


Type: string
(Introduced: Snapcraft 5.0 optional)

A link to the source of the snap (i.e.; the repository containing snapcraft.yaml).


Type: string

Sentence summarising the snap.

Max len. 78 characters, describing the snap in short and simple terms.

Example: The super cat generator


Type: dict

Common example is snap_daemon: shared to use a daemon user, see sytem-usernames for more details.


Type: string

The canonical title of the application, displayed in the software centre graphical frontends.

Max length 40 characters.

In the legacy Snapcraft syntax (not using the base key), this key is only available through the passthrough key.

Example: My Awesome Application


Type: enum

The type of snap, implicitly set to app if not set.

For more details, see: gadget, kernel, base.

Example: [app|core|gadget|kernel|base]


Type: string
(mandatory, unless using adopt-info)

A user facing version to display.

This field is mandatory unless version information is provided by adopt-info . See Using external metadata for details.

Max len. 32 chars. Needs to be wrapped with single-quotes when the value will be interpreted by the YAML parser as non-string.

Examples: '1', '1.2', '1.2.3', git (will be replaced by a git describe based version string)

Plugs and slots for an entire snap

Plugs and slots for an interface are usually configured per-app or per-daemon within snapcraft.yaml. See Snapcraft app metadata for more details. However, snapcraft.yaml also enables global plugs and slots configuration for an entire snap:


Type: dict

These plugs apply to all apps and differs from apps.<app-name>.plugs in that the type is in a dict rather than a list format, :(colon) must be postfixed to the interface name and shouldn’t start with - (dash-space).


Type: dict

A set of attributes for a plug.

Example: read attribute for the home interface.


Type: string

Value of the attribute.
Example: all for read attribute of the home interface.


Type: dict

A set of slots that the snap provides, applied to all the apps.


Type: dict

A set of attributes of the slot.


Type: dict

Value of the attribute.


Type: string
(Introduced: Snapcraft 5.0 optional)

A link to a product website from the publisher of the snap.

Last updated a month ago.