AI & Agents

How to Run an FTP Server on Raspberry Pi with an OpenClaw Agent

vsftpd served 4,000 concurrent downloads on a single 1GB machine in Red Hat's stress tests, yet most Raspberry Pi FTP guides stop at basic configuration. This guide covers full vsftpd setup with TLS, SFTP as a simpler alternative, and deploying an OpenClaw agent that watches your upload directory, sorts incoming files by type, and forwards them to persistent cloud storage on Fastio.

Fastio Editorial Team 9 min read
AI agent sharing files through a cloud workspace

Why FTP Still Matters for Raspberry Pi Projects

vsftpd handled 4,000 concurrent file transfers on a single machine with 1GB of RAM during Red Hat's 7.2 release distribution. The server consumed just 21% system CPU at peak load with 500 simultaneous connections transferring 10KB files. Those benchmarks are from x86 hardware, but they demonstrate that vsftpd's process-per-connection model stays lean enough for ARM boards with constrained memory.

FTP remains the default upload protocol for IP cameras, industrial sensors, and IoT gateways. Almost every network camera ships with FTP upload support baked into its firmware. When you need a local endpoint that accepts file pushes from devices on your network, a Raspberry Pi running vsftpd handles the job at a fraction of the power draw of a full server.

The gap in existing guides is what happens after the file lands. Your camera uploads a snapshot every 30 seconds. Your sensor dumps a CSV every hour. Without automation, those files pile up on an SD card until you run out of space or forget to check them. An OpenClaw agent running on the same Pi can watch the upload directory, categorize incoming files, and forward them to cloud storage where they are indexed and searchable.

What You Need to Run vsftpd and OpenClaw on a Pi

You need a Raspberry Pi 4 (4GB+ RAM) or Pi 5 running 64-bit Raspberry Pi OS. The Pi 5 is fastest, but a Pi 4 with 4GB is the practical sweet spot for running both vsftpd and OpenClaw simultaneously. Use a USB SSD rather than an SD card for the upload directory. SD cards wear out under continuous write loads from FTP uploads, and USB SSDs deliver better sustained write throughput.

Software requirements:

  • Raspberry Pi OS Lite 64-bit (Bookworm or newer)
  • Node.js 24 (required by OpenClaw)
  • An API key for Anthropic Claude or OpenAI (OpenClaw uses cloud LLMs, not local inference)
  • Network connectivity: wired Ethernet preferred for file transfer reliability

Update your system before starting:

sudo apt update && sudo apt upgrade -y
sudo apt install -y git curl build-essential

If your Pi has 2GB or less RAM, configure a 2GB swap file. OpenClaw's Node.js runtime benefits from the headroom during startup:

sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
Organized workspace structure for file management

How to Install and Configure vsftpd with TLS

Install vsftpd from the default repositories:

sudo apt install -y vsftpd

The service starts automatically after installation. Before enabling external access, create a dedicated FTP user and lock it to a specific upload directory:

sudo adduser --home /srv/ftp/uploads --shell /usr/sbin/nologin ftpuser
sudo mkdir -p /srv/ftp/uploads/incoming
sudo chown ftpuser:ftpuser /srv/ftp/uploads/incoming

Edit the vsftpd configuration at /etc/vsftpd.conf. These settings enable local user login, restrict users to their home directory, and open a passive port range for NAT traversal:

listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
chroot_local_user=YES
allow_writeable_chroot=YES
pasv_min_port=30000
pasv_max_port=30100
local_umask=022

Enabling TLS Encryption Plain FTP sends credentials in cleartext. Generate a self-signed certificate and enable TLS:

sudo openssl req -x509 -nodes -days 3650 \
  -newkey rsa:2048 \
  -keyout /etc/ssl/private/vsftpd.key \
  -out /etc/ssl/certs/vsftpd.pem \
  -subj "/CN=pi-ftp-server"

Add these lines to /etc/vsftpd.conf:

ssl_enable=YES
rsa_cert_file=/etc/ssl/certs/vsftpd.pem
rsa_private_key_file=/etc/ssl/private/vsftpd.key
force_local_data_ssl=YES
force_local_logins_ssl=YES
ssl_tlsv1=YES
ssl_sslv2=NO
ssl_sslv3=NO

Restart the service:

sudo systemctl restart vsftpd

Test the connection from another machine using a client that supports FTPS, such as FileZilla or lftp. If your IoT devices do not support TLS (many older IP cameras do not), you can set force_local_data_ssl=NO for those users while keeping TLS mandatory for interactive sessions.

SFTP as a Simpler Alternative

Raspberry Pi OS ships with OpenSSH and its SFTP subsystem preinstalled. You do not need to install any additional packages. Enable SSH via sudo raspi-config under Interface Options, and SFTP works immediately on port 22.

SFTP advantages over FTPS:

  • Single port (22) simplifies firewall rules
  • No passive port range configuration needed
  • Encryption is mandatory by design, not optional
  • Key-based authentication eliminates password brute-force attacks

The tradeoff: many IoT devices and IP cameras only speak FTP, not SFTP. If your upload sources are programmable (scripts, modern devices), prefer SFTP. If they are firmware-locked to FTP, use vsftpd with TLS.

Deploying OpenClaw as a File Transfer Agent

OpenClaw turns your Raspberry Pi into an always-on AI agent runtime. It connects to cloud LLMs (Claude, GPT) for reasoning while keeping state and file operations local on the Pi. The agent persists its workspace in ~/.openclaw/workspace/, surviving reboots and power cycles.

Install OpenClaw on the same Pi that runs your FTP server:

curl -fsSL https://openclaw.ai/install.sh | bash
openclaw onboard --install-daemon

The onboarding wizard configures your LLM API key and sets up a systemd service that restarts automatically on failure. The daemon runs alongside vsftpd without resource conflicts on a Pi 4 with 4GB RAM or a Pi 5.

Once running, OpenClaw can monitor your FTP upload directory and act on new files. The agent's strength is handling the logic that vsftpd cannot: deciding what to do with each file based on its name, size, type, or content. A camera might upload motion_2026-05-29_143022.jpg and the agent recognizes the motion prefix, moves it to an alerts folder, and triggers a notification.

What OpenClaw Handles vs. What It Does Not

OpenClaw is the automation brain, not the FTP server itself. vsftpd accepts the uploads. OpenClaw watches the landing directory and executes workflows. This separation means your FTP server stays fast and stable regardless of what the agent is doing downstream.

The agent connects to external services through its cloud LLM's tool-use capabilities. It can interact with APIs, run shell commands, and manage files. For persistent cloud storage and team handoff, connect OpenClaw to a workspace platform like Fastio that provides MCP-native access for agent reads and writes.

Audit log showing automated file operations
Fastio features

Give your Raspberry Pi agent persistent cloud storage

generous storage workspace with MCP-native access. Upload from your Pi, search by meaning, hand off to your team. No credit card, no expiration.

Automating File Routing to Cloud Storage

Files sitting on a Raspberry Pi's local storage have a single point of failure. The SD card corrupts, the Pi loses power, or the disk fills up. For production file collection, you want incoming uploads forwarded to cloud storage where they are durable, searchable, and accessible to your team.

Local Storage Options

Before going to the cloud, consider local redundancy. You can rsync the upload directory to a NAS or second drive on a cron schedule. This protects against SD card failure but does not help with remote access or search.

S3-Compatible Storage

AWS S3, Backblaze B2, or MinIO give you durable object storage. The agent can use aws s3 cp or equivalent CLI tools to push files. The downside: you manage buckets, IAM policies, lifecycle rules, and have no built-in way to search file contents.

Fastio as the Persistence Layer

Fastio provides an intelligent workspace where uploaded files are automatically indexed for semantic search. When the OpenClaw agent forwards a file to Fastio via its MCP server, that file becomes queryable by meaning, not just filename. Your team can ask "show me all motion alerts from the front camera this week" and get results without writing search queries.

The workflow looks like this:

  1. IoT device uploads file to Pi via FTP
  2. OpenClaw agent detects the new file
  3. Agent categorizes it based on filename, metadata, or content
  4. Agent uploads to Fastio workspace via MCP
  5. File is indexed by Intelligence Mode for search and RAG
  6. Team accesses files through the Fastio UI or API

Fastio's Business Trial includes 50GB storage, included credits per month, and 5 workspaces with no credit card required. The MCP server exposes 19 consolidated tools accessible via Streamable HTTP at /mcp, so OpenClaw can create workspaces, upload files, set permissions, and create branded shares for downstream recipients.

For file handoff between the agent and humans, Fastio supports ownership transfer: the agent builds a workspace, organizes files, and transfers ownership to a team member who receives full control while the agent retains admin access for ongoing automation.

File sharing and delivery interface

Monitoring, Troubleshooting, and Security Hardening

Monitoring FTP Activity

vsftpd logs to /var/log/vsftpd.log by default. Enable detailed transfer logging:

xferlog_enable=YES
xferlog_std_format=NO
log_ftp_protocol=YES

Monitor disk usage on your upload partition. A full disk causes vsftpd to reject uploads silently. Set up a simple check:

df -h /srv/ftp/uploads | awk 'NR==2 {print $5}'

Security Hardening

Limit concurrent connections per IP to prevent a misbehaving device from exhausting server resources:

max_per_ip=5
max_clients=50

Restrict FTP access to your local network using firewall rules. On Raspberry Pi OS with nftables:

sudo nft add rule inet filter input ip saddr 192.168.1.0/24 tcp dport 21 accept
sudo nft add rule inet filter input tcp dport 21 drop

For SFTP, use key-based authentication and disable password login for SSH entirely once keys are deployed.

Common Issues

Passive mode failures behind NAT: Ensure your router forwards ports 30000-30100 to the Pi's LAN IP, and set pasv_address in vsftpd.conf to your Pi's static IP.

IoT device cannot connect with TLS: Older camera firmware lacks TLS support. Create a separate vsftpd instance on a different port without forced TLS, locked to the camera's IP address only.

OpenClaw agent not detecting new files: Verify the agent's workspace path includes the FTP upload directory. Check that file permissions allow the OpenClaw user to read uploaded files (add the openclaw user to the ftpuser group).

SD card wear: Move the upload directory to a USB SSD. Symlink /srv/ftp/uploads to the SSD mount point. This extends hardware life from months to years under continuous write loads.

Frequently Asked Questions

How do I set up an FTP server on Raspberry Pi?

Install vsftpd with sudo apt install vsftpd, create a dedicated FTP user with a locked home directory, edit /etc/vsftpd.conf to enable local users and chroot, then restart the service. The whole process takes about 10 minutes. For secure transfers, generate a TLS certificate and enable ssl_enable=YES in the configuration.

Is FTP secure on Raspberry Pi?

Plain FTP sends passwords and data in cleartext, so it is not secure by default. You have two options: enable TLS in vsftpd (FTPS) which encrypts the connection, or use SFTP which runs over SSH and is encrypted by design. SFTP is preinstalled on Raspberry Pi OS and requires zero additional packages. For IoT devices that only support plain FTP, restrict access to your local network with firewall rules.

What is the difference between FTP and SFTP on Raspberry Pi?

FTP uses a dedicated server like vsftpd, operates on port 21 with a passive port range, and optionally supports TLS encryption. SFTP runs through OpenSSH on port 22, always encrypts, uses a single port (no passive range needed), and supports key-based authentication. SFTP is simpler to configure and more secure, but many IoT devices and IP cameras only support FTP.

How do I transfer files to Raspberry Pi remotely?

For interactive transfers, use SFTP with a client like FileZilla or the sftp command-line tool. For automated uploads from IoT devices, run vsftpd and point the device at your Pi's IP address. For programmatic access from scripts, use scp or rsync over SSH. Each method has tradeoffs between compatibility, security, and ease of automation.

Can OpenClaw run alongside other services on a Raspberry Pi?

Yes. OpenClaw uses cloud LLMs for reasoning, so it does not run large AI models locally. Its runtime is a Node.js process that consumes modest RAM (under 500MB typical). On a Pi 4 with 4GB or a Pi 5, it runs comfortably alongside vsftpd, SSH, and other lightweight services without resource conflicts.

How many concurrent FTP connections can a Raspberry Pi handle?

vsftpd handled 4,000 concurrent downloads on a 1GB x86 machine in documented benchmarks. A Raspberry Pi 5 with 4-8GB RAM can comfortably serve hundreds of concurrent connections for typical IoT upload workloads. The bottleneck is usually network bandwidth or SD card write speed, not CPU or memory.

Related Resources

Fastio features

Give your Raspberry Pi agent persistent cloud storage

generous storage workspace with MCP-native access. Upload from your Pi, search by meaning, hand off to your team. No credit card, no expiration.