Snapcraft quickstart

This quickstart how-to will guide you through the steps required to create, build and publish your own snap package with the snapcraft command line tool.

The purpose of this how-to is to provide Linux developers, packagers, and users with a basic and intermediate knowledge of how to package applications as snaps. It covers the following:

  • an overview of the snap ecosystem
  • a detailed explanation of the Snapcraft tool and its usage
  • the syntax and components of the build recipe for snaps (the snapcraft.yaml file)
  • the process of uploading a built snap into the Snap Store

Here’s what you need

  • a basic understanding of Linux and the command line
  • Ubuntu 20.04 LTS, or later, installed
  • 10GB of free storage space
  • access to the internet

The above requirements are specific to this tutorial. Other distributions can be used, and other platforms are supported. See Installing snapd for details.

Step-by-step guide

  1. Snapcraft installation and setup
  2. How Snapcraft builds a snap
  3. Basic snapcraft.yaml example
  4. Intermediate snapcraft.yaml example
  5. Build and publishing example

Many thanks to @Igor who wrote and put this series of guides together.