Snap vs APT on Ubuntu Server: what I use and why (and how to stop surprise service restarts)
retained text
I kept getting confused about when to use snap and when to use apt on my Ubuntu servers, so I wrote down what I do now. Sharing in case it helps someone.
**The thing that bit me:** snap checks for updates about 4 times a day and refreshes by itself. When it refreshes, the service restarts. APT only updates when you run it, or through unattended-upgrades (which does security fixes only by default).
**My rule: APT by default, snap only when there’s a reason.**
Use APT (or the vendor’s APT repo) for:
* Nginx, PostgreSQL, MySQL, Redis
* Core system tools
* Docker (use Docker’s own repo, since the snap version restricts file access)
Use snap for:
* Tools where the publisher recommends it (Certbot, LXD)
* Cases where you need a newer version and there’s no APT option
**Other quick differences:**
* APT keeps the major version fixed for the whole Ubuntu release and only adds security patches. Snap versions come from the publisher and are often newer.
* Snaps bundle their own libraries and keep old revisions, so they use more disk. That’s also why `df -h` suddenly shows lots of loop devices.
* Snap has built-in rollback (`sudo snap revert certbot`). With APT you pin or reinstall an older version.
* Snap config lives in `/var/snap`, not `/etc`, which confuses people.
**Commands I actually use:**
# only let snap refresh on Saturday nights
sudo snap set system refresh.timer=sat,03:00-05:00
# pause snap refreshes for 3 days
sudo snap refresh --hold=72h
# keep fewer old revisions (saves disk)
sudo snap set system refresh.retain=2
# freeze an apt package
sudo apt-mark hold nginx
# check which copy of a tool is active
which -a toolname
Also, don’t install the same tool twice, once from APT and once from snap. It causes confusing problems later.
I wrote a longer version with more detail here, if anyone wants it: [https://www.geekdas.in/blog/snap-vs-apt-on-ubuntu-server-which-to-use](https://www.geekdas.in/blog/snap-vs-apt-on-ubuntu-server-which-to-use)
Curious what others do. Do you avoid snap completely on servers, or use it for a few tools?document fetched 2026-11-15 00:27 · canonical https://reddit.com/r/selfhosted/comments/1xw7mru/snap_vs_apt_on_ubuntu_server_what_i_use_and_why