Skip to main content

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.

Quick Summary

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

ProtocolCommandDefault PortUse Case
HTTPrclone serve http8080Web browser access, downloads
WebDAVrclone serve webdav8080Mountable file server (macOS Finder, Windows)
SFTPrclone serve sftp2022Secure file transfers
FTPrclone serve ftp2121Legacy FTP clients
DLNArclone serve dlna7879Media streaming to TVs/devices
Dockerrclone serve dockerDocker 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

/etc/systemd/system/rclone-webdav.service
[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

FlagDescription
--addr HOST:PORTListen address and port
--user USERNAMEAuthentication username
--pass PASSWORDAuthentication password
--read-onlyServe in read-only mode
--vfs-cache-mode MODECache mode: off, minimal, writes, full
--vfs-cache-max-size SIZEMaximum cache size
--log-file PATHWrite log to file

Common Pitfalls

PitfallConsequencePrevention
No authenticationAnyone with network access can read/modify filesAlways set --user and --pass
Serving on 0.0.0.0 publiclyExposed to internetBind to 127.0.0.1 or use a firewall
No --read-only when sharingUsers can delete/modify filesAdd --read-only for share-only scenarios
No VFS cache with write accessSlow writes, potential failuresUse --vfs-cache-mode writes
Foreground process diesServer stops when session endsUse 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/..."