Snapcraft is a command line tool that allows developers to build and publish their applications as snaps.
Snapcraft can be installed and used on any supported system, including various Linux distributions as well as the macOS and Windows operating systems.
Installation from the Snap Store
On Linux distributions with snap support, the easiest way to install snapcraft is via its snap:
sudo snap install snapcraft --classic
--classic argument is required because snapcraft uses classic confinement.
Repository version or snap
A Linux system may have both the repository and snap version of Snapcraft installed at the same time. Typically, the snap version will be the preferred one, and usually the first listed command in the user’s shell command path.
which command can be used to check which version of snapcraft is run by default:
$ which snapcraft /snap/bin/snapcraft
Snapcraft build providers
By default, Snapcraft relies on a build provider to create an isolated build environment inside which applications can be built and packaged as snaps without changing the host system. Two build providers are supported:
- Multipass, which creates virtual machine build instances. It cannot be reliably used on platforms that do not support nested virtualization. For instance, Multipass will most likely not run inside a virtual machine itself.
- LXD, which creates container image build instances. It can be used inside virtual machines.
See Build providers for further details on configuring and using either Multipass or LXD, and for options that don’t require a built provider.