Access Linux NFS Share Folders from macOS
In this article
To access a Linux NFS share from macOS, you use the built-in mount_nfs command or the Finder's "Connect to Server" feature. The quickest way is Finder > Go > Connect to Server (Cmd+K), enter nfs://server/share, and click Connect. You'll need the Linux server's IP address or hostname, the exported share path, and network access to the NFS port (2049). No extra software is required—macOS includes NFS client support.
What You'll Need
- A Linux server with NFS service running and a share exported (e.g., in
/etc/exports). - The server's IP address or hostname (e.g.,
192.168.1.100orfileserver.local). - The exact export path on the server (e.g.,
/srv/nfs/share). - macOS with network access to the server (same LAN or VPN).
- Optionally, a username/password if the share is secured with Kerberos or an export option like
sec=krb5.
Step-by-Step
- Find the NFS export path on the Linux server. On the server, run
exportfs -vor check/etc/exportsto see the shared directory and its options. For example,/srv/nfs/share 192.168.1.0/24(rw,sync,no_subtree_check). - Note the server's IP address. On the Linux server, run
ip addrorhostname -Ito get its IP. Make sure your Mac can ping it. - Open Finder on your Mac. Click the Finder icon in the Dock.
- Go to "Connect to Server". Press
Cmd+Kor click Go > Connect to Server in the menu bar. - Enter the NFS URL. Type
nfs://without spaces. For example:/ nfs://192.168.1.100/srv/nfs/share. If your server uses a hostname, you can use that instead. - Click "Connect". A dialog may appear asking for authentication. If the share is open (no auth), it will mount immediately. If it requires Kerberos, you'll be prompted for your Kerberos ticket (usually via
kinitfirst). - Select the volume in Finder. The share appears under Locations in the Finder sidebar. You can now browse and copy files.
- To mount automatically at login (optional): Go to System Settings > General > Login Items, click the + button, and add the mounted volume (it appears as a network volume). Or use the command line: create a launchd plist that runs
mount_nfsat login.
Command-line alternative: Open Terminal and run:
mkdir -p ~/mnt/nfs
mount_nfs -o resvport 192.168.1.100:/srv/nfs/share ~/mnt/nfs
This mounts the share to a local folder. To unmount, use umount ~/mnt/nfs.
Common Mistakes
- Using the wrong export path. The path in the URL must exactly match the one in
/etc/exports, not just the server's root directory. - Forgetting the
nfs://prefix. Finder will interpret//server/shareas SMB, not NFS. Always usenfs://. - Port 2049 blocked. macOS uses NFSv3 or v4 on port 2049. If a firewall on the Linux server blocks it, the connection fails.
- Using NFSv4 with Kerberos without a ticket. If the export has
sec=krb5, you must have a valid Kerberos ticket (kinit user@REALM) before mounting. - Mounting as root without privileges. Some NFS exports restrict root access. Use a regular user account.
Tips
- Use a static IP or hostname. If the server's IP changes, the mount breaks. Configure a DHCP reservation or use a local DNS name.
- Enable NFSv4 if possible. It's more secure and supports locking better than v3. On the server, set
vers=4in/etc/nfs.confor export options. - For large transfers, use
rsyncover the mount. It's more reliable than Finder's copy for many small files. - If you need to reconnect after sleep, unmount and remount. You can create a small script or use an app like Automator to do it automatically.
- Check permissions. NFS uses the user ID (UID) of the client. If your Mac user's UID doesn't match the Linux user's UID, you'll get permission errors. You can map UIDs in the export options (
all_squash,anonuid, etc.).
Troubleshooting
If the mount fails or is not visible:
- Ping the server.
ping 192.168.1.100. If no reply, check network and firewall. - Check the NFS service on Linux. On the server, run
systemctl status nfs-server(orservice nfs status). Ensure it's active. - Verify the export is reachable. On the Mac, run
showmount -e 192.168.1.100to list available exports. If this fails, the server's NFS daemon may not be listening or firewall is blocking. - Try mounting with verbose output. In Terminal, run
sudo mount_nfs -v 192.168.1.100:/srv/nfs/share ~/mnt/nfs. Look for error messages like "Permission denied" or "No such file or directory". - Check macOS firewall. Go to System Settings > Network > Firewall. Ensure it's not blocking NFS (port 2049). You may need to allow incoming connections for
mount_nfs. - If you get "Operation not permitted", it's often a UID mismatch. On the Linux server, check the export options in
/etc/exports. Addinsecureif the client uses a port above 1024 (macOS does). Restart NFS after changes:sudo exportfs -ra. - If the share mounts but is read-only, check the export options (
rwvsro) and the filesystem permissions on the server.
Frequently Asked Questions
Can I use NFS with macOS over the internet?
Yes, but it's not recommended due to security. NFS has no built-in encryption. Use a VPN or SSH tunnel instead.
Does macOS support NFSv4?
Yes, macOS supports NFSv3 and NFSv4. The Finder's Connect to Server will negotiate the highest version supported by both sides.
How do I unmount an NFS share?
In Finder, click the eject icon next to the volume. In Terminal, run umount /path/to/mountpoint.
Why do I get "Permission denied" when I try to access files?
Usually because the UID of your Mac user doesn't match the UID of the file owner on the Linux server. Check the server's export options for all_squash or use anonuid to map to a specific user.
Can I mount an NFS share at startup automatically?
Yes, you can add a login item in System Settings > General > Login Items, or use a launchd agent that runs the mount command at login.
Is there a GUI way to manage NFS mounts?
Finder's Connect to Server is the built-in GUI. Third-party tools like NFS Manager exist, but the built-in method is sufficient for most users.