Why snaps
the problems snaps were built to solve for everyone
Three problems of traditional packaging explain the three decisions that shape snapd, namely one package for every distribution, a store where the publisher owns the name and signs every file, and confinement by default.
On the map: start here, next to the overview
01 Three problems
One program became many packages; its authors could not publish to you directly; and a package ran with everything your account can reach. Each problem got one answer, and snapd is built around the three.
You'd like the photo editor on your laptop. Before snaps, getting it there ran into three problems. Every distribution packaged the program separately, at its own pace, so one program became many packages. Its authors couldn't hand it to you directly: a packager stood in between. And whatever you installed ran as you, with everything your account can reach, so you had to trust whoever wrote it. Snaps answer each problem with one decision, and most of snapd is the shape of those three answers.
02 One package for every distribution
A snap is one squashfs file with its own runtime: a base snap such as core24 and, for shared libraries, content snaps that snapd installs for you when a snap names them. The same file installs on any distribution with snapd, and refreshes follow the publisher's channel.
The first answer is one file for everyone. The photo editor ships as a single squashfs file that carries its own libraries. Its snap.yaml names a base snap, such as core24, and the app runs on that base rather than on your distribution's libraries. Libraries that several snaps share come from content snaps, and when a plug names a default-provider, snapd installs that snap for you. So the same file installs on Ubuntu, Fedora or Arch. And updates come from the store channel you track, when the publisher releases them.
03 The publisher owns the package
account, account-key, snap-declaration and snap-revision assertions bind a snap name, snap-id and file to one publisher, who controls revisions and channels. A file without assertions is refused unless --dangerous is given.
The second answer: the publisher puts the snap in your hands, and snapd checks who that is. Every snap from the store arrives with signed assertions. An account assertion names the publisher and an account-key holds their signing key. A snap-declaration binds the name photo-editor and its snap-id to that account, and a snap-revision assertion ties this exact file to it. The publisher uploads a revision and releases it to a channel; that's what you get. A file with no assertions is refused: snap install says it can't find signatures. --dangerous installs it anyway, at your own risk.
04 Trust by confinement
snap-confine builds the sandbox before every app runs. Interfaces are the unit of trust: the base declaration and the store's snap-declaration, not the developer, decide auto-connection. Super-privileged interfaces such as snapd-control need a store rule to install; classic confinement needs store review and --classic.
The third answer: you needn't trust the developer, because the snap is confined by default. Each time you start the photo editor, snap-confine builds its sandbox first: its own mount namespace, an AppArmor profile and a seccomp filter. Anything beyond the snap's own files comes through an interface, so the interface is the unit of trust. Whether a plug connects by itself isn't the developer's call: the base declaration in snapd and the store's snap-declaration decide. The most powerful interfaces, like snapd-control, need a store rule even to install. And classic confinement, which switches the sandbox off, needs store review and your consent.
05 Why the map looks like this
One package everywhere: the store, packaging and refresh. The publisher owns it: assertions and the model. Confined by default: interfaces, policy and the sandbox. The overview is next door.
Those three decisions explain most of the map. One package for every distribution is why there's a store, a packaging district with bases and content, and a refresh that follows channels. The publisher owning the package is why there are assertions, checked before anything installs, and why an Ubuntu Core device has a signed model. Confinement by default is why interfaces are the biggest district, why a policy district decides who connects what, and why snap-confine and the sandbox internals exist. The overview is next door; from there, follow your question.
Read more
Three problems, three decisions
| Problem | Decision | What it produced in snapd |
|---|---|---|
| Each distribution packages the same program again, at its own pace | One package for every distribution | the snap file (squashfs, mounted read-only), base snaps, content snaps installed from a default provider named by a plug, refresh from a store channel |
| The author cannot publish to users directly | The publisher owns the package | assertions: account, account-key, snap-declaration, snap-revision; channels and revisions the publisher controls |
| A package runs with everything the user's account can reach | Confinement by default | snap-confine, AppArmor and seccomp profiles, a mount namespace per snap, interfaces with plugs, slots and connections, the base declaration and per-snap store rules |
What snapd checks before a store snap installs
- The
snap-revisionassertion for the file's SHA3-384 digest, which names the snap-id and revision. - The
snap-declarationfor that snap-id, which names the snap and its publisher. - The
account-keythat signed them, and theaccountof the publisher. - The interface rules for installation: the snap's own snap-declaration, or else the base declaration.
A file without assertions is refused with cannot find signatures with metadata for snap/component "<file>". snap install --dangerous <file> installs it without assertions; --devmode implies the same for a file.
Confinement levels
| Level | Sandbox | Who allows it |
|---|---|---|
strict | enforced; access only through connected interfaces | the default |
devmode | violations are logged, not blocked | the user, with --devmode; the docs say such a snap cannot be released to the stable channel and does not refresh automatically |
classic | none; the snap sees the host | store review, and the user with --classic; not available on Ubuntu Core |
for app developers for Ubuntu Core developers for snapd developers for administrators
Interfaces that need the store
Super-privileged interfaces have allow-installation: false in the base declaration. A store snap with such a plug installs only when its own snap-declaration has a rule that allows it. snapd-control, mount-control and kernel-module-load are examples; see Policy for the rules.
Further reading
- Get started: installing, running, updating, reverting and connecting a snap, step by step.
- System architecture: a diagram of snapd, the store and the kernel security modules.
- Snap confinement: strict, classic and devmode, and how to see a snap's level.
- Assertions: the assertion types and their format.
- Channels and tracks: how a publisher's releases reach you.
- Distribution support: the distributions snapd runs on.
Roads from here
START HERE
- snapd — the overview of the daemon these decisions produced
GETTING SNAPS
- The store — the store that delivers and refreshes snaps
- Snap packaging — the snap file with its base and content snaps
INTERFACES AND CONFINEMENT
- Interfaces — interfaces are how confinement opens
- Confinement — what confinement by default actually is
- Classic confinement: when the sandbox is switched off — when the sandbox is switched off
ASSERTIONS · signed statements snapd trusts
- Assertions: how they work — the assertions that tie a snap to its publisher
POLICY · who may install and connect what
- Interface policy: the questions snapd asks — who decides what a snap may install and connect
UBUNTU CORE · install and recovery
- Model, gadget and kernel — what the signed model decides on Ubuntu Core