Skip to content

xFTP Server - TFTP, FTP, and SFTP for Network Device File Transfers

xFTP Server: Secure File Transfer for Network Devices

Section titled “xFTP Server: Secure File Transfer for Network Devices”

After reading this page, I can deploy and configure the rConfig xFTP server, choose the right protocol (TFTP, FTP, or SFTP) for my devices, and set up automated file uploads with device-matched processing and retention policies.


Network devices upload files via TFTP, FTP, or SFTP into a shared inbox directory (/srv/xftp/). A scheduled sweeper then moves matched files into each device’s xftpuploads/ directory and records the lifecycle in the xftp_uploads database table.

ProtocolPortAuthEncryptionWhen to use
TFTP69 (UDP)NoneNoneLegacy or isolated environments
FTP21 (TCP)Username + passwordNoneDevices lacking SFTP support
SFTP/SCPConfigurable (e.g. 2222)Username + passwordSSHProduction and sensitive data
  • Inbox (raw uploads): /srv/xftp/
  • Processed device storage (moved files):
Terminal window
/var/www/html/rconfig8/storage/app/rconfig/data/<Category>/<device-name>/xftpuploads/

The sweeper runs on a configured schedule and moves matched inbox files to device storage:

Terminal window
php artisan rconfig:sweep-xftp-dir

To trigger a sweep manually:

Terminal window
cd /var/www/html/rconfig8
php artisan rconfig:sweep-xftp-dir

Use xFTP when devices need to push non-configuration files, binary data, firmware images, or archive content to rConfig for centralised storage. If you need only configuration backups, use the standard backup workflow instead.


  • Docker installed on the rConfig server (the setup wizard can install it automatically)
  • Network firewall rules open for the protocol ports you plan to use (69/UDP, 21/TCP, and/or your chosen SFTP port)
  • rConfig V8 installed and accessible
  • Admin access to Settings in the rConfig UI

Manage xFTP Docker microservices through the UI or CLI.

Web interface: Navigate to Platform → Network Services → XFTP

rConfig V8 xFTP Services settings dashboard displaying service status and configuration options

CLI:

Terminal window
php artisan rconfig:xftp-toggle

Check service status at any time:

Terminal window
php artisan rconfig:xftp-toggle --status
rConfig V8 xFTP Services management dashboard showing Docker container running status rConfig V8 CLI terminal output displaying xFTP service status and Docker container information

Run the interactive toggle command and choose which protocol to deploy:

Terminal window
php artisan rconfig:xftp-toggle

TFTP provides basic file transfer without authentication. Suitable for legacy devices and isolated environments.

  1. Run php artisan rconfig:xftp-toggle and choose TFTP from the protocol list.

    rConfig V8 xFTP setup wizard TFTP service selection interface
  2. Docker pulls the TFTP image on first deployment.

  3. The TFTP container starts automatically.

  4. Verify the service shows TFTP running on port 69.

    rConfig V8 CLI terminal output confirming TFTP service running on port 69

Default configuration: port 69 (UDP), no authentication, upload directory /srv/xftp/. Any device with network access to the rConfig server can upload files.

To stop: run php artisan rconfig:xftp-toggle, select TFTP, and confirm removal. Files already in /srv/xftp/ or device storage are not deleted.


FTP provides authenticated file transfer with credential-based access.

  1. Run php artisan rconfig:xftp-toggle and choose FTP.

    rConfig V8 xFTP setup wizard FTP service selection interface
  2. Enter the FTP username and password when prompted.

  3. Docker pulls the FTP image on first deployment.

  4. The FTP container starts with the configured credentials.

  5. Verify the service shows FTP running on port 21.

    rConfig V8 FTP service running confirmation showing active status on port 21

Default configuration: port 21 (TCP), username and password authentication, active and passive transfer modes, upload directory /srv/xftp/.

Credential storage: FTP credentials are stored in .env and referenced in device commands using {ftpusername} and {ftppassword}. When redeploying, the wizard prompts to reuse existing credentials or enter new ones.

To stop: run php artisan rconfig:xftp-toggle, select FTP, and confirm removal. Credentials in .env are preserved.


SFTP provides encrypted, authenticated file transfer over SSH. Use for production environments and sensitive data.

  1. Run php artisan rconfig:xftp-toggle and choose SFTP.

    rConfig V8 xFTP setup wizard SFTP service selection for secure encrypted file transfers
  2. Enter the SFTP port (must not conflict with host SSH on port 22 — 2222 is a common choice).

  3. Enter the SFTP username and password.

  4. Docker pulls the SFTP image on first deployment.

  5. The SFTP container starts with the configured port and credentials.

  6. Verify the service shows SFTP running on your chosen port.

    rConfig V8 CLI terminal output confirming SFTP service running on the configured custom port

Default configuration: port configurable (recommended 2222, cannot be 22), SSH/TCP encryption, username and password authentication, upload directory /srv/xftp/. The same container handles both SFTP and SCP connections.

SFTP vs SCP: SFTP is preferred for modern devices and supports directory listing and resumable transfers. SCP is simpler and suits legacy devices and scripting.

Connection syntax:

Terminal window
# SFTP
sftp -P 2222 username@rconfig-server-ip
# SCP
scp -P 2222 localfile.txt username@rconfig-server-ip:/remote/path/

To stop: run php artisan rconfig:xftp-toggle, select SFTP, and confirm removal. Credentials and port settings in .env are preserved.


For rConfig to associate an uploaded file with a device, the filename must include the device ID before a dash:

{deviceid}-filename.ext

Valid patterns:

  • tftp://192.168.1.131/{deviceid}-vlan.dat
  • ftp://server/{deviceid}-config.log
  • sftp://server/{deviceid}-firmware.bin

Invalid patterns:

  • tftp://192.168.1.131/vlan-{deviceid}.dat (device ID not before the dash)
  • ftp://server/{deviceid}config.log (no dash separator)

Find the device ID in the rConfig UI on the device list or device detail page. It is also available in the devices table (id column) and is automatically substituted when you use the {deviceid} variable in commands.

TFTP (Cisco IOS):

Terminal window
Router(config)#file prompt quiet
Router#copy vlan.dat tftp://192.168.1.131/1234-vlan.dat

FTP (Cisco IOS):

Terminal window
Router#copy vlan.dat ftp://ftpuser:ftppass@192.168.1.131/1234-vlan.dat

Using credential variables (recommended):

Terminal window
Router#copy vlan.dat ftp://{ftpusername}:{ftppassword}@192.168.1.131/{deviceid}-vlan.dat

SFTP (Cisco IOS):

Terminal window
Router#copy vlan.dat sftp://sftpuser:sftppass@192.168.1.131:2222/1234-vlan.dat

Using credential variables:

Terminal window
Router#copy vlan.dat sftp://{sftpusername}:{sftppassword}@192.168.1.131:2222/{deviceid}-vlan.dat

Incorporate upload commands into rConfig command categories so files transfer automatically during device polling.

  1. Navigate to Settings → Commands in the rConfig UI.

  2. Create or open the command category used by the target devices.

  3. Add the upload command with variables:

    Terminal window
    copy vlan.dat tftp://192.168.1.131/{deviceid}-vlan.dat
  4. Assign the category to the relevant devices.

  5. When rConfig runs a backup, the upload command executes automatically.


When filenames do not contain a numeric device ID, use pattern-based routing to map uploads to devices.

Where: Platform → Network Services → XFTP → File Matching Rules tab

rConfig V8 xFTP File Matching patterns configuration page

Pattern types: regex, prefix, suffix, contains, exact

Rule precedence: First match wins (ordered by pattern ID). If no rule matches, rConfig falls back to legacy ID extraction from the filename.


Viewing and managing uploaded files (V8.1.2+)

Section titled “Viewing and managing uploaded files (V8.1.2+)”

Navigate to Platform → Network Services → XFTP → File Directory tab to see files physically present in /srv/xftp/ that are awaiting the sweep or were not yet matched to a device.

The table columns are: File name, Type, Device ID, File Size, Created, Action. rConfig infers file type (text, binary, archive) automatically.

Available actions per file: Download, Copy path, Peek (eye icon — text only, capped at 1 MB), Metadata info (info icon), Delete. A Delete all files button clears the entire inbox.

rConfig V8 xFTP Services dashboard displaying unprocessed files in the inbox directory

Navigate to Devices → [Device Name] and scroll to the uploaded files section.

rConfig V8 device page showing processed xFTP uploads table with file metadata and action buttons

The table shows a paginated, database-backed history of moved files. Actions are the same as the File Directory: download, copy path, peek (text only), metadata info, and delete.

rConfig V8 full file listing interface with view, download, and delete management actions

Click View All to access the full file management interface.


If you upgraded and already have files on disk without tracking rows, populate xftp_uploads from the filesystem:

Terminal window
php artisan rconfig:xftp-backfill-uploads
# Dry run (no changes made)
php artisan rconfig:xftp-backfill-uploads --dry-run
# Limit scanned files (0 = unlimited)
php artisan rconfig:xftp-backfill-uploads --limit=1000

xFTP retention integrates with the existing purge framework (settings_purge).

Targets:

TargetCoversDefault retention
xftp_rootTracked inbox files (/srv/xftp/)30 days
xftp_device_uploadsTracked moved device uploads90 days

Run via CLI:

Terminal window
# Run all purge targets
php artisan rconfig:data-purge
# Run only xFTP targets
php artisan rconfig:data-purge --table=xftp_root
php artisan rconfig:data-purge --table=xftp_device_uploads
# Dry run
php artisan rconfig:data-purge --table=xftp_root --dry-run

Organizations can deploy their own FTP/SFTP services and configure rConfig to process files from a custom directory.

  1. Edit .env to set the custom path:

    Terminal window
    XFTP_ROOT_DIR=/path/to/custom/upload/directory
  2. Create the directory with correct permissions:

    Terminal window
    sudo mkdir -p /path/to/custom/upload/directory
    sudo chown www-data:www-data /path/to/custom/upload/directory
    sudo chmod 755 /path/to/custom/upload/directory
  3. Verify rConfig can access it by running a manual sweep.

  4. Point your external FTP/SFTP service to upload files into XFTP_ROOT_DIR.

All three services can run simultaneously on separate ports. Deploy them one at a time using php artisan rconfig:xftp-toggle and selecting each protocol in turn.

Once deployed, assign protocols to device groups based on capability:

  • Legacy switches: TFTP (port 69)
  • Modern routers: FTP (port 21)
  • Security appliances: SFTP (port 2222)

Protocol comparison:

ProtocolAuthenticationEncryptionRecommended for
TFTPNoneNoneIsolated lab networks only
FTPUsername + passwordNoneDevices without SFTP
SFTPSSH credentialsFull (SSH)Production and compliance

Network-level restrictions:

Terminal window
# Limit upload sources to trusted networks
sudo firewall-cmd --permanent --add-rich-rule='
rule family="ipv4"
source address="10.0.0.0/8"
port protocol="tcp" port="21"
accept'
sudo firewall-cmd --permanent --add-rich-rule='
rule family="ipv4"
source address="10.0.0.0/8"
port protocol="tcp" port="2222"
accept'
sudo firewall-cmd --reload

Credential management:

Terminal window
# Restrict .env file permissions
chmod 600 /var/www/html/rconfig8/current/.env
chown www-data:www-data /var/www/html/rconfig8/current/.env

To rotate credentials: update .env, redeploy the affected service, then update device configurations or rely on credential variables for automatic substitution.



  1. Check the inbox for the file:

    Terminal window
    ls -la /srv/xftp/
  2. Verify the filename contains the device ID before a dash (e.g. 1234-vlan.dat).

  3. Confirm the device ID exists in rConfig:

    Terminal window
    mysql -u rconfig -p rconfig -e "SELECT id, device_name FROM devices WHERE id = 1234;"
  4. Run a manual sweep:

    Terminal window
    php artisan rconfig:sweep-xftp-dir
  5. Check sweep logs for errors:

    Terminal window
    tail -50 /var/www/html/rconfig8/current/storage/logs/laravel.log | grep sweep

Service not running:

Terminal window
php artisan rconfig:xftp-toggle --status
php artisan rconfig:xftp-toggle # restart if needed

Firewall blocking:

Terminal window
telnet <rconfig-server-ip> 69 # TFTP
telnet <rconfig-server-ip> 21 # FTP
telnet <rconfig-server-ip> 2222 # SFTP
# Open ports if blocked
sudo firewall-cmd --add-port=69/udp --permanent
sudo firewall-cmd --add-port=21/tcp --permanent
sudo firewall-cmd --add-port=2222/tcp --permanent
sudo firewall-cmd --reload

Authentication failure (FTP/SFTP):

Terminal window
grep -E 'FTP_USERNAME|FTP_PASSWORD|SFTP_USERNAME|SFTP_PASSWORD' /var/www/html/rconfig8/current/.env
# Test FTP manually
ftp <rconfig-server-ip>
# Test SFTP manually
sftp -P 2222 username@<rconfig-server-ip>

Disk space:

Terminal window
df -h /srv/xftp/
  1. Check container logs:

    Terminal window
    docker ps -a
    docker logs rconfig-tftp
    docker logs rconfig-ftp
    docker logs rconfig-sftp
  2. Check for port conflicts:

    Terminal window
    sudo netstat -tulpn | grep :69
    sudo netstat -tulpn | grep :21
    sudo netstat -tulpn | grep :2222
  3. Check directory permissions:

    Terminal window
    ls -la /srv/xftp/
    sudo chown -R www-data:www-data /srv/xftp/
    sudo chmod 755 /srv/xftp/
  4. Restart Docker if needed:

    Terminal window
    sudo systemctl restart docker
    sudo journalctl -u docker -n 50

After resolving the issue, remove the failed container and redeploy:

Terminal window
docker rm rconfig-<service>
php artisan rconfig:xftp-toggle
  1. Navigate to Tasks → Scheduled Tasks and confirm the TFTP Directory Sweep task is enabled.

  2. Check the task run history for errors.

  3. Run manually and check output:

    Terminal window
    php artisan rconfig:sweep-xftp-dir
  4. Verify the Laravel scheduler cron is active:

    Terminal window
    crontab -u www-data -l | grep schedule