I recently upgraded my web servers from Ubuntu 16.04 to 20.04. I notice that snapd is running and taking a lot of memory. I've read up a bit on the Snap Package Manager and it most of what I read seems to be in the context of a desktop environment. It seems that for a server, apt is still at the core. Do I really need this thing running?
2 Answers
As mentioned, if you do not make use of any snap packages, you may remove the snapd
service altogether.
First, run the following to view what snaps have been installed. In this example, you can see that snapd
is installed (that's a foundation package), and core18
(also a foundation package). The only actual service is lxd
, therefore you decide here whether you have used LXD or not.
$ snap list
Name Version Rev Tracking Publisher Notes
core18 20210128 1988 latest/stable canonical✓ base
lxd 4.0.5 19188 4.0/stable/… canonical✓ -
snapd 2.48.2.1 11036 latest/stable canonical✓ snapd
To remove those snaps, you would do it in the following order:
sudo snap remove lxd
sudo snap remove core18
sudo snap remove snapd
Having said that, you mention that you host websites. If that is the case, then you would benefit from using LXD in the first place. With LXD, you create system containers, which are lightweight virtual machines. Being lightweight virtual machines, you can create such a container for a reverse proxy server, and then individual containers for each of your websites. By doing so, each website will be separate from each other. In addition, each container (including the reverse proxy) would be isolated from the host! If all these sound somewhat interesting, you can try it out in action using a guide such as this one, https://www.linode.com/docs/guides/beginners-guide-to-lxd-reverse-proxy/

- 8,911
No; if you don't plan to install snaps (which is indeed very unlikely on a server), you can safely uninstall snapd.

- 3,385
-
-
-
Yes both Canonical Livepatch and LXD are distributed as snaps - the same with Multipass. Those are all solid reasons to keep snapd on a server. – Artur Meinild Mar 17 '21 at 11:27
snap list
Name Version Rev Tracking Publisher Notes core18 20210128 1988 latest/stable canonical* base lxd 4.0.5 19188 4.0/stable/… canonical* - snapd 2.49 11107 latest/stable canonical* snapd
– Rob Brandt Mar 15 '21 at 22:19