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.
How xFTP works
Section titled “How xFTP works”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.
Protocols
Section titled “Protocols”| Protocol | Port | Auth | Encryption | When to use |
|---|---|---|---|---|
| TFTP | 69 (UDP) | None | None | Legacy or isolated environments |
| FTP | 21 (TCP) | Username + password | None | Devices lacking SFTP support |
| SFTP/SCP | Configurable (e.g. 2222) | Username + password | SSH | Production and sensitive data |
Directory layout
Section titled “Directory layout”- Inbox (raw uploads):
/srv/xftp/ - Processed device storage (moved files):
/var/www/html/rconfig8/storage/app/rconfig/data/<Category>/<device-name>/xftpuploads/Scheduled sweep
Section titled “Scheduled sweep”The sweeper runs on a configured schedule and moves matched inbox files to device storage:
php artisan rconfig:sweep-xftp-dirTo trigger a sweep manually:
cd /var/www/html/rconfig8php artisan rconfig:sweep-xftp-dirWhen to use xFTP
Section titled “When to use xFTP”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.
Prerequisites
Section titled “Prerequisites”- 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
Managing xFTP services
Section titled “Managing xFTP services”Manage xFTP Docker microservices through the UI or CLI.
Web interface: Navigate to Platform → Network Services → XFTP
CLI:
php artisan rconfig:xftp-toggleCheck service status at any time:
php artisan rconfig:xftp-toggle --status
Deploying xFTP services
Section titled “Deploying xFTP services”Run the interactive toggle command and choose which protocol to deploy:
php artisan rconfig:xftp-toggleTFTP service deployment
Section titled “TFTP service deployment”TFTP provides basic file transfer without authentication. Suitable for legacy devices and isolated environments.
-
Run
php artisan rconfig:xftp-toggleand choose TFTP from the protocol list.
-
Docker pulls the TFTP image on first deployment.
-
The TFTP container starts automatically.
-
Verify the service shows TFTP 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 service deployment
Section titled “FTP service deployment”FTP provides authenticated file transfer with credential-based access.
-
Run
php artisan rconfig:xftp-toggleand choose FTP.
-
Enter the FTP username and password when prompted.
-
Docker pulls the FTP image on first deployment.
-
The FTP container starts with the configured credentials.
-
Verify the service shows FTP running 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/SCP service deployment
Section titled “SFTP/SCP service deployment”SFTP provides encrypted, authenticated file transfer over SSH. Use for production environments and sensitive data.
-
Run
php artisan rconfig:xftp-toggleand choose SFTP.
-
Enter the SFTP port (must not conflict with host SSH on port 22 — 2222 is a common choice).
-
Enter the SFTP username and password.
-
Docker pulls the SFTP image on first deployment.
-
The SFTP container starts with the configured port and credentials.
-
Verify the service shows SFTP running on your chosen 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:
# SFTPsftp -P 2222 username@rconfig-server-ip
# SCPscp -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.
Uploading files from devices
Section titled “Uploading files from devices”File naming and device ID
Section titled “File naming and device ID”For rConfig to associate an uploaded file with a device, the filename must include the device ID before a dash:
{deviceid}-filename.extValid patterns:
tftp://192.168.1.131/{deviceid}-vlan.datftp://server/{deviceid}-config.logsftp://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.
Manual upload examples
Section titled “Manual upload examples”TFTP (Cisco IOS):
Router(config)#file prompt quietRouter#copy vlan.dat tftp://192.168.1.131/1234-vlan.datFTP (Cisco IOS):
Router#copy vlan.dat ftp://ftpuser:ftppass@192.168.1.131/1234-vlan.datUsing credential variables (recommended):
Router#copy vlan.dat ftp://{ftpusername}:{ftppassword}@192.168.1.131/{deviceid}-vlan.datSFTP (Cisco IOS):
Router#copy vlan.dat sftp://sftpuser:sftppass@192.168.1.131:2222/1234-vlan.datUsing credential variables:
Router#copy vlan.dat sftp://{sftpusername}:{sftppassword}@192.168.1.131:2222/{deviceid}-vlan.datAutomated uploads via command categories
Section titled “Automated uploads via command categories”Incorporate upload commands into rConfig command categories so files transfer automatically during device polling.
-
Navigate to Settings → Commands in the rConfig UI.
-
Create or open the command category used by the target devices.
-
Add the upload command with variables:
Terminal window copy vlan.dat tftp://192.168.1.131/{deviceid}-vlan.dat -
Assign the category to the relevant devices.
-
When rConfig runs a backup, the upload command executes automatically.
xFTP-only devices (inbound-only connectivity)
Section titled “xFTP-only devices (inbound-only connectivity)”A device can use inbound-only configuration collection: it pushes its configuration to xFTP instead of waiting for rConfig to retrieve it. rConfig skips the normal outbound SSH, Telnet, script, or TL1 download session for that device. This is the opposite direction from the pull-based protocols covered in Device Connectivity & Backup, and it’s useful for devices that only support pushing files out, or that sit somewhere rConfig can’t initiate a session to.
Enabling it
Section titled “Enabling it”There’s no device-level toggle or database flag for this. The connect.protocol value in the assigned connection template is the source of truth:
-
Open Inventory → Templates and use the built-in xFTP Inbound Only - No Outbound Connection template. Alternatively, create or edit a template and set its
connect:block as follows:This template also ships ready-made in the xFTP templates folder in our templates repository.# rConfig connection template## Edition: pro## Status: untested-starter## Tested-on: rConfig V8## Docs: https://docs.rconfig.com/device-management/connection-templates/## Community: https://github.com/rconfig/rConfig-templates## Note: all free-text values must be wrapped in double quotes " "main:name: 'XFTP Inbound Only - No Outbound Connection' # For devices that push their config into rConfig via xFTPdesc: 'Marks a device as XFTP-only (inbound). rConfig never connects out to it; config arrives via an xFTP upload and reachability comes from ping.'connect:timeout: 30 # Unused: no outbound connection is ever attempted for this protocol# xftp is the canonical inbound-only protocol value from rConfig Pro V8.3.2 onwards.# Releases before V8.3.2 accept only ftp, which stays accepted for templates already# in the field.protocol: xftp # Inbound-only device: skips SSH/Telnet/script/tl1 outbound connection entirelyport: 21 # Unused: no outbound connection is ever attempted for this protocol -
Save the template and assign it to the device through the normal template assignment workflow.
-
Configure the device to push its configuration to xFTP. Ensure the uploaded filename contains its rConfig device ID or matches an enabled file matching pattern.
The reference template ships at storage/app/rconfig/templates/xftp-inbound-only.yml, alongside built-in templates such as ios-ssh-noenable.yml. The value must appear under connect:; a template name containing “xFTP” does not make a device inbound-only. Because rConfig does not start a CLI download session for this protocol, SSH/Telnet authentication, prompt, and command settings do not participate in configuration collection.
rConfig flags inbound-only status wherever templates or devices are listed: a small xFTP icon with an “xFTP-only (inbound) device” tooltip appears next to the template in Inventory → Templates and next to the device in the device list and device pickers. Use the xFTP filter button on the device list to show only inbound-only devices.
What happens during download runs
Section titled “What happens during download runs”xFTP-only devices are omitted from task, tag, category, and device outbound-download selections. If an xFTP-only record reaches the download service by another path, rConfig stops before creating the outbound connection.
As a result, a skipped outbound run:
- does not attempt SSH, Telnet, script, or TL1 configuration collection;
- does not change the device to Config Failed (
STATUS_CONFIG_FAILED); and - does not send the database or email connection-failure notifications used for failed outbound downloads.
Changing an existing device to inbound-only requires assigning a template whose connect.protocol is xftp (or ftp). Changing the template back to an outbound protocol restores the normal download behavior; no device column or UI flag needs to be changed.
Status lifecycle and reachability
Section titled “Status lifecycle and reachability”An xFTP-only device is tracked with two related signals:
- Ping reachability: rConfig queues an ICMP reachability check for enabled xFTP-only devices every 15 minutes. A successful ping sets the device to Reachable; a failed ping sets it to Unreachable. The queue worker and scheduler must be running for these periodic checks to execute.
- Inbound arrival: when the xFTP sweeper successfully matches and moves an uploaded file into the device’s storage, it sets the device to Reachable and updates
last_seen. Use the device’s xFTP upload history to confirm that configuration delivery is current.
No separate xFTP-only status is introduced. The latest completed ping or successful inbound upload determines the displayed reachable/unreachable state, so these signals can appear to disagree with upload history:
- A device can show Reachable (ping succeeds) with no uploads recorded yet, for example before its first scheduled push, or if the push command on the device itself is broken.
- A device can show Unreachable after a successful upload if a later scheduled ping fails because ICMP is blocked. The successful upload remains in its history and its arrival time remains available through
last_seen.
Ping status alone doesn’t confirm the push pipeline is working, and a blocked ping doesn’t mean uploads have stopped. Check the device’s upload history when in doubt. If uploads aren’t appearing at all, work through Files not appearing on the device page below. See Basic Connectivity Verification for general ping diagnostics.
File matching patterns (V8.1.2+)
Section titled “File matching patterns (V8.1.2+)”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
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+)”File Directory (raw /srv/xftp/ inbox)
Section titled “File Directory (raw /srv/xftp/ inbox)”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.
Device view: processed uploads
Section titled “Device view: processed uploads”Navigate to Devices → [Device Name] and scroll to the uploaded files section.
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.
Click View All to access the full file management interface.
Backfilling upload tracking (V8.1.2+)
Section titled “Backfilling upload tracking (V8.1.2+)”If you upgraded and already have files on disk without tracking rows, populate xftp_uploads from the filesystem:
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=1000Retention and auto-cleanup (V8.1.2+)
Section titled “Retention and auto-cleanup (V8.1.2+)”xFTP retention integrates with the existing purge framework (settings_purge).
Targets:
| Target | Covers | Default retention |
|---|---|---|
xftp_root | Tracked inbox files (/srv/xftp/) | 30 days |
xftp_device_uploads | Tracked moved device uploads | 90 days |
Run via CLI:
# Run all purge targetsphp artisan rconfig:data-purge
# Run only xFTP targetsphp artisan rconfig:data-purge --table=xftp_rootphp artisan rconfig:data-purge --table=xftp_device_uploads
# Dry runphp artisan rconfig:data-purge --table=xftp_root --dry-runAdvanced configuration
Section titled “Advanced configuration”Custom upload directory
Section titled “Custom upload directory”Organizations can deploy their own FTP/SFTP services and configure rConfig to process files from a custom directory.
-
Edit
.envto set the custom path:Terminal window XFTP_ROOT_DIR=/path/to/custom/upload/directory -
Create the directory with correct permissions:
Terminal window sudo mkdir -p /path/to/custom/upload/directorysudo chown www-data:www-data /path/to/custom/upload/directorysudo chmod 755 /path/to/custom/upload/directory -
Verify rConfig can access it by running a manual sweep.
-
Point your external FTP/SFTP service to upload files into
XFTP_ROOT_DIR.
Running multiple services
Section titled “Running multiple services”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)
Security
Section titled “Security”Protocol comparison:
| Protocol | Authentication | Encryption | Recommended for |
|---|---|---|---|
| TFTP | None | None | Isolated lab networks only |
| FTP | Username + password | None | Devices without SFTP |
| SFTP | SSH credentials | Full (SSH) | Production and compliance |
Network-level restrictions:
# Limit upload sources to trusted networkssudo 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 --reloadCredential management:
# Restrict .env file permissionschmod 600 /var/www/html/rconfig8/current/.envchown www-data:www-data /var/www/html/rconfig8/current/.envTo rotate credentials: update .env, redeploy the affected service, then update device configurations or rely on credential variables for automatic substitution.
Common gotchas
Section titled “Common gotchas”Troubleshooting
Section titled “Troubleshooting”Files not appearing on the device page
Section titled “Files not appearing on the device page”-
Check the inbox for the file:
Terminal window ls -la /srv/xftp/ -
Verify the filename contains the device ID before a dash (e.g.
1234-vlan.dat). -
Confirm the device ID exists in rConfig:
Terminal window mysql -u rconfig -p rconfig -e "SELECT id, device_name FROM devices WHERE id = 1234;" -
Run a manual sweep:
Terminal window php artisan rconfig:sweep-xftp-dir -
Check sweep logs for errors:
Terminal window tail -50 /var/www/html/rconfig8/current/storage/logs/laravel.log | grep sweep
Upload failures
Section titled “Upload failures”Service not running:
php artisan rconfig:xftp-toggle --statusphp artisan rconfig:xftp-toggle # restart if neededFirewall blocking:
telnet <rconfig-server-ip> 69 # TFTPtelnet <rconfig-server-ip> 21 # FTPtelnet <rconfig-server-ip> 2222 # SFTP
# Open ports if blockedsudo firewall-cmd --add-port=69/udp --permanentsudo firewall-cmd --add-port=21/tcp --permanentsudo firewall-cmd --add-port=2222/tcp --permanentsudo firewall-cmd --reloadAuthentication failure (FTP/SFTP):
grep -E 'FTP_USERNAME|FTP_PASSWORD|SFTP_USERNAME|SFTP_PASSWORD' /var/www/html/rconfig8/current/.env
# Test FTP manuallyftp <rconfig-server-ip>
# Test SFTP manuallysftp -P 2222 username@<rconfig-server-ip>Disk space:
df -h /srv/xftp/Container fails to start
Section titled “Container fails to start”-
Check container logs:
Terminal window docker ps -adocker logs rconfig-tftpdocker logs rconfig-ftpdocker logs rconfig-sftp -
Check for port conflicts:
Terminal window sudo netstat -tulpn | grep :69sudo netstat -tulpn | grep :21sudo netstat -tulpn | grep :2222 -
Check directory permissions:
Terminal window ls -la /srv/xftp/sudo chown -R www-data:www-data /srv/xftp/sudo chmod 755 /srv/xftp/ -
Restart Docker if needed:
Terminal window sudo systemctl restart dockersudo journalctl -u docker -n 50
After resolving the issue, remove the failed container and redeploy:
docker rm rconfig-<service>php artisan rconfig:xftp-toggleSweep task not processing files
Section titled “Sweep task not processing files”-
Navigate to Tasks → Scheduled Tasks and confirm the TFTP Directory Sweep task is enabled.
-
Check the task run history for errors.
-
Run manually and check output:
Terminal window php artisan rconfig:sweep-xftp-dir -
Verify the Laravel scheduler cron is active:
Terminal window crontab -u www-data -l | grep schedule
What’s next
Section titled “What’s next”- Configure device backups - Set up automated configuration backups alongside xFTP file uploads
- Manage devices in rConfig - Add and configure the devices that will push files to xFTP
- Set up scheduled tasks - Configure the xFTP sweep frequency and other automated jobs