rclone Serve
rclone serve starts a local server that exposes a remote's contents over various protocols. It's a quick way to share files, serve media, or provide network access to cloud storage.
serve turns any rclone remote into a file server. Supported protocols: HTTP, WebDAV, SFTP, FTP, DLNA, and Docker volume plugin. Runs as a foreground process by default.
Basic Syntax
rclone serve PROTOCOL REMOTE:PATH [flags]
Available Protocols
| Protocol | Command | Default Port | Use Case |
|---|---|---|---|
| HTTP | rclone serve http | 8080 | Web browser access, downloads |
| WebDAV | rclone serve webdav | 8080 | Mountable file server (macOS Finder, Windows) |
| SFTP | rclone serve sftp | 2022 | Secure file transfers |
| FTP | rclone serve ftp | 2121 | Legacy FTP clients |
| DLNA | rclone serve dlna | 7879 | Media streaming to TVs/devices |
| Docker | rclone serve docker | — | Docker volume plugin |
Practical Examples
HTTP File Server
# Serve files via HTTP for download
rclone serve http remote:shared-files --addr :8080
# With directory listings
rclone serve http remote:media --addr :9000
Access at http://localhost:8080 in a browser.
WebDAV Server
# Serve as WebDAV — mountable from any OS
rclone serve webdav remote:my-bucket --addr :8080
# With authentication
rclone serve webdav remote:my-bucket \
--addr :8080 \
--user admin \
--pass secretpassword
Connect from:
- macOS Finder: Connect to Server →
http://server:8080 - Windows Explorer: Map Network Drive →
http://server:8080 - Linux:
mount -t davfs http://server:8080 /mnt/dav
SFTP Server
# Serve as SFTP (secure file transfer)
rclone serve sftp remote:my-bucket \
--addr :2022 \
--user sftpuser \
--pass sftppassword
Connect with: sftp -P 2022 sftpuser@localhost
Media Streaming (DLNA)
# Stream media to smart TVs and devices on your network
rclone serve dlna remote:media/movies --name "Rclone Media"
Background Server with systemd
[Unit]
Description=Rclone WebDAV Server
After=network.target
[Service]
ExecStart=/usr/bin/rclone serve webdav remote:shared \
--addr :8080 \
--user admin \
--pass secret \
--log-file /var/log/rclone/webdav.log
Restart=on-failure
User=rclone
[Install]
WantedBy=multi-user.target
Key Flags
| Flag | Description |
|---|---|
--addr HOST:PORT | Listen address and port |
--user USERNAME | Authentication username |
--pass PASSWORD | Authentication password |
--read-only | Serve in read-only mode |
--vfs-cache-mode MODE | Cache mode: off, minimal, writes, full |
--vfs-cache-max-size SIZE | Maximum cache size |
--log-file PATH | Write log to file |
Common Pitfalls
| Pitfall | Consequence | Prevention |
|---|---|---|
| No authentication | Anyone with network access can read/modify files | Always set --user and --pass |
Serving on 0.0.0.0 publicly | Exposed to internet | Bind to 127.0.0.1 or use a firewall |
No --read-only when sharing | Users can delete/modify files | Add --read-only for share-only scenarios |
| No VFS cache with write access | Slow writes, potential failures | Use --vfs-cache-mode writes |
| Foreground process dies | Server stops when session ends | Use systemd service or screen/tmux |
What's Next
Examples with Output
1. Host a temporary HTTP file server
Quickly share a remote folder with anyone on your network. Command:
rclone serve http remote:public-files --addr :8080
Output:
2024/01/15 12:00:00 NOTICE: http server listening on [::]:8080
2. Password-protected WebDAV bridge
Serve a remote via WebDAV for OS-native mounting with security. Command:
rclone serve webdav remote:my-bucket --addr :8081 --user admin --pass secret
Output:
2024/01/15 12:00:00 NOTICE: WebDAV server listening on [::]:8081
3. Expose remote as SFTP target
Allow traditional SFTP clients to upload directly to cloud storage. Command:
rclone serve sftp remote:bucket --addr :2022 --user sftpuser --pass sftppas
Output:
2024/01/15 12:00:00 NOTICE: SFTP server listening on [::]:2022
4. Stream media via DLNA
Make your cloud movie library visible to Smart TVs and game consoles. Command:
rclone serve dlna remote:media/movies --name "Cloud Library"
Output:
2024/01/15 12:00:00 NOTICE: DLNA server listening on [::]:7879
5. Use VFS cache for write support
Enable reliable file uploads when serving via WebDAV or SFTP. Command:
rclone serve webdav remote:bucket --vfs-cache-mode writes --addr :8080
Output:
2024/01/15 12:05:00 INFO : vfs cache: root is "/home/user/.cache/rclone/vfs/..."