File Sharing Protocols: SMB vs. NFS

Here's the difference between two protocols you'll frequently run into when setting up a NAS or home server.

What is SMB?

Short for Server Message Block, this is the default file- and printer-sharing protocol on Windows. Connecting through a File Explorer address like \\device-name\shared-folder is a classic example of SMB in use, and its default port is 445.

What is NFS?

Short for Network File System, this has long been the default file-sharing protocol on Linux and Unix-based systems. Its defining feature is mounting a remote folder so it behaves like it's part of your own local system.

AFP is barely used anymore

Apple Filing Protocol used to be the Mac-only file-sharing protocol, but as Apple strengthened its SMB support, current macOS versions now recommend SMB over AFP by default.

Differences in permissions and account systems

SMB is built around account-based authentication using a username and password, while NFS has traditionally relied more on controlling access by allowed IP address or user ID (UID). Newer versions of NFS also support account-based authentication.

Differences in speed and compatibility

Between two Linux machines, NFS tends to be lighter and faster; in an environment that includes Windows machines, SMB is convenient because it works right out of the box with no extra setup. Most NAS products support both protocols so you can choose based on the situation.

Which should you choose on a NAS?

If your home or office has a mix of Windows and Mac machines, SMB is a safe default choice; if your setup is mostly Linux servers or media servers, NFS often has the edge in performance. Most NAS admin panels also let you enable both protocols on the same shared folder at once.

New to NAS?

If you're still curious about the basic concept of a NAS itself, it's worth reading an introduction to what network-attached storage is first, then coming back here to decide which sharing protocol fits your setup.

Connecting a network drive

If you're wondering how to map a folder shared over SMB to a drive letter on your own computer, a guide to network drive mapping is worth checking as a follow-up to this page.

Frequently Asked Questions

Can I turn on SMB and NFS at the same time on the same folder?

Most NAS devices can have both SMB and NFS enabled on a single shared folder at once. That said, because the two protocols have different permission systems, enabling only the protocol you actually need is safer when multiple devices access the folder at the same time, to avoid permission conflicts.

Is the speed difference actually noticeable?

In a typical home setup with gigabit Ethernet, the difference is often hard to notice in practice. In a Linux server environment that frequently transfers large files, NFS's advantage tends to show up more clearly.