borg-webdav(1)
π borg-webdav(1) β bestie, let's serve some archives
okay so. hi. welcome to borg-webdav. the manual name is borg-webdav(1) btw, in case you were wondering which page you just landed on. it's this one. it's giving read-only server energy and honestly? obsessed. β¨
πΈ NAME πΈ
borg-webdav β Serve archive contents via a read-only WebDAV / HTTP server on localhost.
like. the whole thing. no cap. π
π¦ SYNOPSIS π¦
borg [common options] webdav [options]
that's it. that's the shape of it. periodt.
β¨ DESCRIPTION β¨
So this command serves the contents of the selected archives over a read-only WebDAV / HTTP server, which means the archive contents can be:
- browsed and downloaded with a web browser π
- mounted as a read-only network file system, using the WebDAV client that's literally built into most operating systems and file managers π
π§ Mounting examples π§
- Windows Explorer: "Map network drive" ->
http://localhost:8000/(or on the command line:net use Z: http://localhost:8000/). - macOS Finder: "Go > Connect to Server" (Cmd-K) ->
http://localhost:8000. - GNOME Files / KDE Dolphin: open
dav://localhost:8000/. - Linux kernel mount:
mount -t davfs http://localhost:8000/ /mnt/point(needs thedavfs2package).
The server listens on localhost (127.0.0.1) only and offers no authentication and no encryption β anything that can connect to localhost TCP ports on the machine can read the served archive contents. π so like, keep it to yourself, bestie.
The top level lists the selected archives (use the archive filter options to select fewer archives), named as for borg mount (see the BORG_MOUNT_ARCHIVE_DIR_FORMAT environment variable there); below that, the archive contents can be browsed like a directory tree. The directory tree of an archive is built in memory when it is first entered, so expect some delay for big archives. like, go get a snack. π
Any directory can be downloaded as a tar archive by appending ?tar to its URL (the web browser listings show a download icon next to the heading for this). Unlike a plain file download, the tar preserves POSIX metadata (owner, group, mode, sub-second timestamps, symlinks, special files, xattrs, ACLs), so it is the metadata-lossless way to restore a whole directory tree over this server. It is a PAX format tarball, streamed uncompressed.
π Notes π
- Plain (non-tar) file downloads do not preserve any POSIX metadata (owner, group, mode, timestamps, xattrs, ACLs). Use the
?tardownload above, orborg extract/borg export-tar, for full-fidelity restores. - Symbolic links and special files (devices, fifos, sockets) are shown in the web browser listings, but are neither followed nor downloadable individually, and they are not visible in WebDAV-mounted directories (WebDAV has no concept of them). They are, however, included in
?tardownloads. - Damaged files (with chunks missing in the repository) cause the download connection to be aborted β the server never silently serves corrupted file content. π slay behavior honestly.
- The Windows WebDAV client limits file downloads to about 47 MiB by default (
FileSizeLimitInBytesregistry value) β use a web browser or another WebDAV client to download bigger files.
Recently used file content chunks are kept decrypted in an in-memory cache, so that the many small, sequential range requests a mounted file system does for a big file do not re-fetch and re-decrypt the same chunk over and over. As for borg mount, the BORG_MOUNT_DATA_CACHE_ENTRIES environment variable sets the number of cached chunks (default: number of CPUs); additional memory usage can be up to the chunk size times this number. π§
Unless the --foreground option is given, the command daemonizes and runs in the background until it is stopped by sending it a signal (e.g. kill sends SIGTERM), which shuts the server down and releases the repository lock. In the foreground, ^C / SIGINT stops it. Daemonizing is not available on Windows, so the command always stays in the foreground there.
π OPTIONS π
See borg-common(1) for common options of Borg commands. π«Ά
β options β
-f,--foregroundβ stay in foreground, do not daemonize--port PORTβ TCP port to listen on (on localhost); default:8000
π Archive filters π
-a PATTERN,--match-archives PATTERNβ only consider archives matching all patterns. See"borg help match-archives".--sort-by KEYSβ Comma-separated list of sorting keys; valid keys are:timestamp,archive,name,id,tags,host,user; default is:timestamp--first Nβ consider the first N archives after other filters are applied--last Nβ consider the last N archives after other filters are applied--oldest TIMESPANβ consider archives between the oldest archive's timestamp and (oldest + TIMESPAN), e.g.,7dor12m.--newest TIMESPANβ consider archives between the newest archive's timestamp and (newest - TIMESPAN), e.g.,7dor12m.--older TIMESPANβ consider archives older than (now - TIMESPAN), e.g.,7dor12m.--newer TIMESPANβ consider archives newer than (now - TIMESPAN), e.g.,7dor12m.
π₯ EXAMPLES π₯
# Serve all archives of the repository on http://127.0.0.1:8000/,
# then browse and download files with a web browser.
$ borg webdav
# Serve only one archive on a different port.
$ borg webdav --port 8123 --match-archives my-archive
π Client notes and known issues π
WebDAV's rough edges are almost all on the client side, and a read-only server (like this one) hits a specific subset of them. A plain web browser avoids most of these β the notes below matter mainly when mounting the server as a file system. iykyk.
πͺ Windows Explorer (the "WebClient" / mini-redirector)
- Downloads are limited to about 50 MB by default (the
FileSizeLimitInBytesregistry value). Bigger files fail when copied from a mapped drive β use a web browser (including for the?tardirectory download) or another WebDAV client. - The WebClient service must be running for
net use/ "Map network drive" to work; if it is stopped, mounting silently fails. π
π macOS Finder (mount_webdav / WebDAVFS)
- Finder tries to write
.DS_Store,._*(AppleDouble) and.Trashfiles into every folder it opens. On this read-only server those writes are rejected (the file system is read-only); Finder tolerates it but may occasionally show a spurious "operation could not be completed" dialog. This is harmless. π - WebDAVFS caches directory listings; a stale view usually clears on unmount and remount.
π§ Linux davfs2
davfs2uses WebDAV locking by default and will try toLOCKfiles it opens, which a read-only server rejects. Setuse_locks 0indavfs2.conf(or the per-mount config) to avoid the failed lock attempts.davfs2also caches whole files in a local cache directory.- The GNOME (gvfs) and KDE (KIO) DAV backends work without such tweaks. β¨
π°οΈ Protocol-level (any client)
PROPFINDwithDepth: infinity(a recursive enumeration that can be very expensive) is refused with 403, as permitted by RFC 4918. Well-behaved clients useDepth: 0or1.- Collections must be addressed with a trailing slash; a request for
/diris redirected to/dir/. - Symbolic links and special files (devices, fifos, sockets) have no representation in WebDAV, so they are not visible in a mounted file system. They are shown in the web browser listings and are included in
?tardownloads. - WebDAV transfers file contents plus modification time and size, but no owner, group, mode, xattrs or ACLs. Use the
?tardirectory download (orborg extract/borg export-tar) when you need a full-fidelity restore.
π SEE ALSO π
π Author π
The Borg Collective
anyway that's the whole page bestie, you ate that π«Ά from the borg backup tool era, dated 2026-10-07, and it's still borg-webdav(1) at heart. go serve something. π
β¨
π¦ where this page comes from
- ubuntu stonking: borgbackup2 2.0.0b25-4 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms