# NFS Server Access

> Export AgentFS over the network via NFS
> Canonical HTML: https://tursodb.cn/docs/agentfs/guides/nfs/
> Upstream Source (MIT): https://docs.turso.tech/agentfs/guides/nfs
> Language: en

---
AgentFS can expose filesystems over NFS, enabling remote access from other machines, containers, or virtual machines.

## Starting the NFS Server

```bash
agentfs serve nfs my-agent
```

By default, this listens on `127.0.0.1:11111`.

### Binding to All Interfaces

To allow remote access:

```bash
agentfs serve nfs my-agent --bind 0.0.0.0 --port 2049
```

<div class="doc-callout doc-callout-warning"><div class="doc-callout-title">WARNING</div><div class="doc-callout-body">

Exposing NFS on `0.0.0.0` makes the filesystem accessible to anyone who can reach your machine. Use firewall rules or a VPN for production deployments.

</div></div>


## Mounting the Filesystem

### From the Same Machine

```bash
mkdir /mnt/agentfs
mount -t nfs -o vers=3,tcp,port=11111,mountport=11111,nolock 127.0.0.1:/ /mnt/agentfs
```

### From a Remote Machine

```bash
mount -t nfs -o vers=3,tcp,port=2049,mountport=2049,nolock server-ip:/ /mnt/agentfs
```

### Mount Options Explained

| Option | Description |
| - | - |
| `vers=3` | Use NFSv3 protocol |
| `tcp` | Use TCP transport |
| `port=11111` | NFS server port |
| `mountport=11111` | Mount protocol port |
| `nolock` | Disable file locking (single-user) |

## Unmounting

```bash
umount /mnt/agentfs
```

If the mount is busy:

```bash
umount -f /mnt/agentfs  # Force unmount
# or
umount -l /mnt/agentfs  # Lazy unmount
```

## Next Steps

<div class="doc-cards">
<a class="doc-card" href="/docs/agentfs/guides/mcp/"><div class="doc-card-title"><span>MCP Server</span><span class="doc-card-arrow" aria-hidden="true">→</span></div><p class="doc-card-desc">Expose AgentFS via MCP</p></a>
<a class="doc-card" href="/docs/agentfs/guides/sync/"><div class="doc-card-title"><span>Sync with Turso Cloud</span><span class="doc-card-arrow" aria-hidden="true">→</span></div><p class="doc-card-desc">Back up and share agent state</p></a>
</div>
