Snap vs apt

Since Ubuntu 16.04, Canonical has promoted snap packages as an alternative to traditional apt packages. Both systems coexist on Ubuntu and each has real advantages. Understanding the technical difference — not just the marketing — helps you decide which to use for each situation and explains why some applications behave differently depending on how they were installed.

How snap packages work

A snap is a self-contained application bundle that includes the application plus all its dependencies. It runs in a sandboxed environment using Linux namespaces and AppArmor, isolated from the rest of the system. The snap filesystem is mounted as a loop device at /snap/name/revision/.

# See mounted snap filesystems
mount | grep snap
df -h | grep snap

# List all installed snaps
snap list

# See snap services (running daemons)
snap services

# Check snap automatic update schedule
snap refresh --time

Snap mount points

/dev/loop0   /snap/core22/1234   squashfs   ro,relatime   ← read-only squashfs
/dev/loop1   /snap/lxd/28373    squashfs   ro,relatime
/dev/loop2   /snap/snapd/21759  squashfs   ro,relatime

How apt packages work

An apt package (deb) extracts its files directly into the standard filesystem (/usr/bin, /etc, /var, etc.) and shares libraries with other apt packages via /usr/lib. It integrates with the system’s user, group, and service management. When you install nginx via apt, it creates a www-data user, registers a systemd unit, and puts config in /etc/nginx.

Key differences

Featuresnapapt (deb)
DependenciesBundled inside the snapShared with other packages via /usr/lib
Configuration location~/snap/name/ or /var/snap/name//etc/name/
Update modelAutomatic background updatesManual: apt upgrade
RollbackBuilt-in: snap revert nameManual: pin version, use dpkg
Filesystem isolationYes (sandboxed)No (integrates with filesystem)
Startup speedSlower (squashfs mount overhead)Faster
Disk usageHigher (bundled deps)Lower (shared deps)
DistributionSnap Store (Canonical)Official Ubuntu repos, PPAs

When to use snap

  • Desktop applications: Firefox, Thunderbird, VS Code, and many GUI apps are distributed as snaps on Ubuntu Desktop. Snaps are the primary distribution channel for these applications.
  • Applications with frequent updates: Snap’s automatic update model means you always get the latest version without running apt upgrade.
  • LXD and Microk8s: These are distributed exclusively as snaps and the snap version is the official, recommended installation method.
  • Isolation requirements: When you want an application sandboxed from the rest of the system.

When to use apt

  • Server software: nginx, apache, mysql, postgresql, php-fpm, redis — these should be installed via apt on servers. APT versions integrate properly with /etc, systemd, and logrotate.
  • When you need full control over versions: apt lets you pin exact versions and control when upgrades happen. Snap updates automatically and silently.
  • When config files belong in /etc: Snap config is in non-standard locations, which complicates automation and configuration management tools like Ansible.

Snap on servers: real-world considerations

# Disable automatic snap updates (if needed for production stability)
sudo snap set system refresh.hold=$(date --date='366 days' +%Y-%m-%dT%H:%M:%S%:z)

# Or schedule updates for a specific time window
sudo snap set system refresh.timer=04:00-06:00

# Check what snaps have updates available
snap refresh --list

# Update all snaps manually
sudo snap refresh

# Remove a snap
sudo snap remove lxd

📝 NOTE: Snap packages mount as loop devices, which means df -h and lsblk output includes one line per installed snap. On a server with many snaps installed, this clutters the output. To hide snap loop devices from df: df -h -x squashfs.

Conclusion

For server software (web servers, databases, application runtimes), use apt — it integrates with the standard filesystem, systemd, and /etc, and gives you control over when updates happen. For desktop applications and tools like LXD and Microk8s where the vendor recommends snap, use snap. Both systems coexist on Ubuntu without conflict, so you can use each for what it is good at.

FAQ

Why should administrators understand Snap vs APT?+

Because this topic affects planning decisions, server lifecycle, compatibility, support expectations, or how you reason about Ubuntu systems before making operational changes.

Do I need a lab for this topic?+

A lab is useful for checking commands and seeing the concept on a real Ubuntu machine, but the main value is understanding the decision, tradeoff, or system behavior clearly.

How should I use this knowledge in production?+

Use it to make better choices, document why those choices were made, and avoid rushed changes that ignore support windows, compatibility, stability, or operational risk.

Need help with Ubuntu administration?

Work directly with Muhammad Irfan Aslam for Ubuntu Server, Linux, cloud, Docker, DevOps, CI/CD, or infrastructure troubleshooting support.

Hire Me for Support