First pick the language your app is written in.

Why are snaps good for C/C++ projects?

  • Snaps are easy to discover and install. Millions of users can browse and install snaps graphically in the Snap Store or from the command-line.
  • Snaps install and run the same across Linux. They bundle the exact versions of your app’s dependencies.
  • Snaps automatically update to the latest version. Four times a day, users’ systems will check for new versions and upgrade in the background.
  • Upgrades are not disruptive. Because upgrades are not in-place, users can keep your app open as it’s upgraded in the background.
  • Upgrades are safe. If your app fails to upgrade, users automatically roll back to the previous revision.

In just a few steps, you’ll have an example C/C++ app in the Snap Store.

Continue ›

Here's how dosbox defines snapcraft.yaml:

name: dosbox
version: "0.74-svn"
summary: DOS emulator
description: |
    DOSBox is a x86 emulator with Tandy/Hercules/
    CGA/EGA/VGA/SVGA graphics sound and DOS. It's
    been designed to run old DOS games under
    platforms that don't support it.

confinement: devmode
base: core18

parts:
  dosbox:
    plugin: autotools
    source-type: tar
    source: http://source.dosbox.com/dosboxsvn.tgz
    build-packages:
      - g++
      - make
      - libsdl1.2-dev
      - libpng-dev
      - libsdl-net1.2-dev
      - libsdl-sound1.2-dev
      - libasound2-dev
    stage-packages:
      - libsdl-sound1.2
      - libsdl-net1.2
      - libxcursor1
      - libxi6
      - libxinerama1
      - libxrandr2
      - libxrender1
      - libopenal1
      - libsndio6.1
      - libspeex1
      - libvorbisfile3
      - libwayland-client0
      - libwayland-cursor0
      - libwayland-egl1-mesa
      - libxkbcommon0
      - libglu1-mesa
      - libasound2
      - libasyncns0
      - libbsd0
      - libcaca0
      - libdbus-1-3
      - libflac8
      - libgcc1
      - libgcrypt20
      - libgl1
      - libglvnd0
      - libglx0
      - libgpg-error0
      - liblz4-1
      - liblzma5
      - libncursesw5
      - libogg0
      - libpng16-16
      - libpulse0
      - libsdl1.2debian
      - libslang2
      - libsndfile1
      - libstdc++6
      - libsystemd0
      - libtinfo5
      - libvorbis0a
      - libvorbisenc2
      - libwrap0
      - libx11-6
      - libxau6
      - libxcb1
      - libxdmcp6
      - libxext6
      - zlib1g

 apps:
   dosbox:
      command: dosbox
      environment:
        "LD_LIBRARY_PATH": "$SNAP/usr/lib/
        $SNAPCRAFT_ARCH_TRIPLET/pulseaudio"
        "DISABLE_WAYLAND": "1"

Why are snaps good for Electron projects?

  • Snaps are easy to discover and install. Millions of users can browse and install snaps graphically in the Snap Store or from the command-line.
  • Snaps install and run the same across Linux. They bundle Electron and all of your app’s dependencies, be they Node modules or system libraries.
  • Snaps automatically update to the latest version. Four times a day, users’ systems will check for new versions and upgrade in the background.
  • Upgrades are not disruptive. Because upgrades are not in-place, users can keep your app open as it’s upgraded in the background.
  • Upgrades are safe. If your app fails to upgrade, users automatically roll back to the previous revision.

In just a few steps, you’ll have an example Electron app in the Snap Store.

Continue ›

Here's how to use it with electron-quick-start:

{
  "name": "electron-quick-start",
  "version": "1.0.0",
  "description": "A minimal Electron application",
  "main": "main.js",
  "scripts": {
    "start": "electron .",
    "dist": "build --linux snap"
  },
  "repository": "https://github.com/electron/electron-quick-start",
  "keywords": [
    "Electron",
    "quick",
    "start",
    "tutorial",
    "demo"
  ],
  "author": "GitHub",
  "license": "CC0-1.0",
  "devDependencies": {
    "electron": "^2.0.0",
    "electron-builder": "^20.27.1"
  }
}

Why are snaps good for Go projects?

  • Easy to discover and install by millions using the Snap Store or command-line every day
  • Automatically updated to the latest stable version of your app
  • Revert to the previous version if an update fails, preserving data

Programming in Go makes it easy to create a zip of your app that runs across Linux, without dependencies. However, end user discovery and update management remain a challenge. Snaps fill this gap, letting you distribute a Go app in an app store experience for end users.

In just a few steps, you’ll have an example Go app in the Snap Store.

Continue ›

Here’s how httplab defines snapcraft.yaml:

name: httplab
version: git
summary: An interactive web server.
description: |
  HTTPLab let you inspect HTTP requests and forge
  responses.

confinement: devmode
base: core18

parts:
  httplab:
    plugin: go
    go-importpath: github.com/gchaincl/httplab
    source: .
    source-type: git
    build-packages:
      - gcc

apps:
  httplab:
    command: bin/httplab

Why are snaps good for Java projects?

  • Simplify installation instructions, regardless of distribution, to snap install myjavaapp.
  • Directly control the delivery of automatic application updates.

Distributing a Java application for Linux and reaching the widest possible audience is complicated. Typically, the user has to make sure the JRE/SDK version and their environment are configured correctly. When a Linux distribution changes the delivered JRE, this can be problematic for applications. Snapcraft ensures the correct JRE is shipped alongside the application at all times.

In just a few steps, you’ll have an example Java app in the Snap Store.

Continue ›

Here's how freeplane defines snapcraft.yaml:

name: freeplane
version: '1.6.10'
summary: Application for Mind Mapping, Knowledge and Project Management
description: |
  Freeplane is a free and open source software
  application that supports thinking, sharing
  information and getting things done at work,
  in school and at home. The core of the
  software is tools for mind mapping (also known
  as concept mapping or information mapping)
  and using mapped information.

confinement: devmode

parts:
  freeplane:
    after: [desktop-glib-only]
    plugin: gradle
    source: .
    build: |
      export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64"
      gradle release -x test -x createGitTag
    install: |
      unzip DIST/freeplane_bin-*.zip -d $SNAPCRAFT_PART_INSTALL/
    build-packages:
      - unzip
      - openjdk-8-jdk

apps:
  freeplane:
    command: desktop-launch $SNAP/freeplane-1.6.10/freeplane.sh

Why are snaps good for MOOS projects?

  • Bundle all the runtime requirements, including the exact version of MOOS/MOOS-IvP and system libraries you need.
  • Directly and reliably control the delivery of application updates using existing infrastructure.
  • Upgrades are safe. If your app fails to upgrade, users automatically roll back to the previous revision.
  • Extremely simple creation of daemons.

In just a few steps, you’ll have an example MOOS app in the Snap Store.

Continue ›

Here's an example snapcraft.yaml that uses MOOS:

name: moos
version: '0.1'
summary: MOOS Example
description: |
  This example includes MOOSDB, the main communication mechanism for all MOOS
  apps.

confinement: devmode
base: core18

parts:
  moos:
    source: https://github.com/themoos/core-moos/archive/v10.4.0.tar.gz
    plugin: cmake
    build-packages: [g++]

apps:
  MOOSDB:
    command: bin/MOOSDB

Why are snaps good for Node.js projects?

  • Easy to discover and install by millions using the Snap Store or command-line every day.
  • Automatically updated to the latest stable version of your app.
  • Revert to the previous version if an update fails, preserving data.

With npm you can distribute apps to other developers, but it’s not tailored to end users. Snaps let you distribute your Node app in an app store experience.

In just a few steps, you’ll have an example Node.js app in the Snap Store.

Continue ›

Here's how wethr defines snapcraft.yaml:

name: wethr
version: git
summary: Command line weather tool.
description: |
  Get current weather:-
  $ wethr
  Get current weather in metric units
  $ wethr --metric
  Get current weather in imperial units
  $ wethr --imperial

confinement: devmode
base: core18

parts:
  wethr:
    plugin: nodejs
    source: .

apps:
  wethr:
    command: wethr

Why are snaps good for pre-built apps?

  • Easy to discover and install by millions using the Snap Store or command-line every day
  • Automatically updated to the latest stable version of your app
  • Revert to the previous version if an update fails, preserving data
  • Isolation ensures no conflicts between applications
  • Identical behaviour across Linux distributions, even with library dependencies

Distributing the Linux build of your app as a zip lets you provide one download and set of instructions for all of Linux. However, end user discovery and update management remain a challenge. Snaps fill this gap, letting you wrap your existing Linux build in an app store experience for end users.

In just a few steps, you’ll have an example pre-built app in the Snap Store.

Continue ›

How geekbench4 defines snapcraft.yaml

name: geekbench4
version: 4.2.0
summary: Cross-Platform Benchmark
description: |
  Geekbench 4 measures your system's power and tells
  you whether your computer is ready to roar. How
  strong is your mobile device or desktop computer?
  How will it perform when push comes to crunch?
  These are the questions that Geekbench can answer.

confinement: devmode
base: core18

parts:
  geekbench4:
    plugin: dump
    source: http://cdn.geekbench.com/Geekbench-$SNAPCRAFT_PROJECT_VERSION-Linux.tar.gz

apps:
  geekbench4:
    command: geekbench4

Why are snaps good for Python projects?

  • Easy to discover and install by millions using the Snap Store or command-line every day
  • Automatically updated to the latest stable version of your app
  • Revert to the previous version if an update fails, preserving data
  • Isolation ensures no conflicts between applications
  • Identical behaviour across Linux distributions, even with library dependencies

With PyPI you can distribute apps to other developers, but it’s not tailored to end users. Virtualenv lets you install an app’s dependencies in isolation, but it’s not automatically used for installs from PyPI. Snaps let you distribute a dependency-isolated Python app in an app store experience for end users.

In just a few steps, you’ll have an example Python app in the Snap Store.

Continue ›

Here's how offlineimap defines snapcraft.yaml:

name: offlineimap
version: git
summary: OfflineIMAP
description: |
  OfflineIMAP is software that downloads your email mailbox(es) as local
  Maildirs. OfflineIMAP will synchronize both sides via IMAP.

confinement: devmode
base: core18

parts:
  offlineimap:
    plugin: python
    python-version: python2
    source: .
    stage-packages:
      - python-six

apps:
  offlineimap:
    command: bin/offlineimap

Why are snaps good for ROS projects?

  • Bundle all the runtime requirements, including the exact version of ROS and system libraries you need.
  • Expand the distributions supported beyond just Ubuntu.
  • Directly and reliably control the delivery of application updates using existing infrastructure.
  • Extremely simple creation of daemons.

In just a few steps, you’ll have an example ROS app in the Snap Store.

Continue ›

Here's an example snapcraft.yaml that uses ROS:

name: ros-talker-listener
version: '0.1'
summary: ROS Talker/Listener Example
description: |
  This example launches a ROS talker and listener.

confinement: devmode
base: core18

parts:
  ros-tutorials:
    plugin: catkin
    source: https://github.com/ros/ros_tutorials.git
    source-branch: melodic-devel
    source-space: roscpp_tutorials/

apps:
  ros-talker-listener:
    command: roslaunch roscpp_tutorials talker_listener.launch

Why are snaps good for ROS2 projects?

  • Bundle all the runtime requirements, including the exact version of ROS and system libraries you need.
  • Expand the distributions supported beyond just Ubuntu.
  • Directly and reliably control the delivery of application updates using existing infrastructure.
  • Extremely simple creation of daemons.

In just a few steps, you’ll have an example ROS2 app in the Snap Store.

Continue ›

Here's an example snapcraft.yaml that uses ROS2:

name: ros2-talker-listener
version: '0.1'
summary: ROS2 Talker/Listener Example
description: |
  This example launches a ROS2 talker and listener.

confinement: devmode
base: core18

parts:
  ros-demos:
    plugin: colcon
    source: https://github.com/ros2/demos.git
    source-branch: crystal
    colcon-rosdistro: crystal
    colcon-source-space: demo_nodes_cpp
    build-packages: [make, gcc, g++]
    stage-packages: [ros-crystal-ros2launch]

apps:
  ros2-talker-listener:
    command: opt/ros/crystal/bin/ros2 launch demo_nodes_cpp talker_listener.launch.py

Why are snaps good for Ruby projects?

  • Bundle all the runtime requirements.
  • Simplify installation instructions, regardless of distribution, to snap install myrubyapp.
  • Directly control the delivery of automatic application updates.
  • Extremely simple creation of services.

Linux install instructions for Ruby applications often get complicated. To prevent modules from different Ruby applications clashing with each other, developer tools like rvm or rbenv must be used. With snapcraft, it’s one command to produce a bundle that works anywhere.

In just a few steps, you’ll have an example Ruby app in the Snap Store.

Continue ›

Here’s how mdl uses it:

name: mdl
version: "0.5.0"
summary: Markdown lint tool
description: |
  Style checker/lint tool for markdown files

confinement: devmode
base: core18

parts:
  mdl:
    source: .
    plugin: ruby
    gems:
      - rake
      - bundler
     override-build: |
       snapcraftctl build
       rake install
     build-packages:
       - git

apps:
  mdl:
    command: bin/mdl

Why are snaps good for Rust projects?

  • Easy to discover and install by millions using the Snap Store or command-line every day.
  • Automatically updated to the latest stable version of your app.
  • Revert to the previous version if an update fails, preserving data.

You can distribute your apps across Linux using a musl-enabled version of Rust, with all the dependencies satisfied. However, end user discovery and update management remain a challenge. Snaps fill this gap, letting you distribute a Rust app in an app store experience for end users.

In just a few steps, you’ll have an example Rust app in the Snap Store.

Continue ›

Here's how xsv defines snapcraft.yaml:

name: xsv
version: git
summary: A fast CSV command line toolkit written in Rust
description: |
  xsv is a command line program for indexing,
  slicing, analyzing, splitting and joining CSV
  files. Commands should be simple, fast and
  composable:
  - Simple tasks should be easy.
  - Performance trade offs should be exposed
    in the CLI interface.
  - Composition should not come at the
    expense of performance.

confinement: devmode
base: core18

parts:
  xsv:
    plugin: rust
    source: .

apps:
  xsv:
    command: bin/xsv