Dufs - A Simple Self Hosted File Server with Awesome Features

A powerful, self hosted file indexing app that can also serve static pages!

Dufs - A Simple Self Hosted File Server with Awesome Features

I absolutely love a good self hosted file indexing application. Dufs is the Cadillac of file indexing applications with so many useful features that you might not notice by just glancing at it. From authentication to user permissions, searching, web-dav and even static file serving.

What is Dufs?

Dufs is a distinctive utility file server that supports static serving, uploading, searching, accessing control, webdav and more.

Dufs Core Features

  • Serve static files
  • Download folders as zip file
  • Upload files and folders (Drag & Drop)
  • Search files
  • Partial responses (Parallel/Resume download)
  • Path level access control
  • Supports https
  • Supports webdav
  • Easy to use with curl

Install Dufs with Docker Compose

This compose stack has a very important command that dictates the permissions given to the directory that is mounted.

version: '3.3'
services:
    run:
        volumes:
            - '/docker:/data'
        ports:
            - '5000:5000'
        image: sigoden/dufs
        command: /data -A

Using the Dufs Option flags

This example says allow all permissions using -A to the /data directory which is /docker in this case because that is the folder we are mounting the volume to. You can change this to any folder on your system.

Dufs has several different options that allow you to control permissions such as uploading, downloading, searching, password protection and more.

Here is another example password protecting our mounted volume.

version: '3.3'
services:
    run:
        volumes:
            - '/docker:/data'
        ports:
            - '5000:5000'
        image: sigoden/dufs
        command: /data --allow-search -a "/@username:password"

Here, you can see I used the -a flag triggering authentication. Notice the "a" is lowercase.

One last example is showing how to use Dufs to serve up a static index.html page.

version: '3.3'
services:
    run:
        volumes:
            - '/docker:/data'
        ports:
            - '5001:5000'
        image: sigoden/dufs
        command: /data --render-index
``

That means inside my /docker folder there should be a file called index.html that Dufs will render with the included CSS style.

If you have a HTML website within the Dufs directory, you can browse all the pages.

Thanks to John Kruz for the example wesbite!

This would be very useful for developers who want to run a local apache server to test their code and designs.

More example flag options can be seen here on the Dufs Github repo. There are many more to choose from including more advanced options using permissions for multiple users and folders.

Dufs runs at just under 2.5mb of RAM usage on my Debian test system.

Dufs is a very lightweight application that can run on any system without being a system hog. But that can be said about most apps that run in a Docker container.

Final Notes and Thoughts

One key component that is missing that would really make Dufs a shining competitor to Filebrowser is file editing. It's not possible to edit files with Dufs currently and we won't assume it will never be added either. I already put in a feature request on the issue tracker. Swing by and click an emoji or respond if you agree and don't forget to give the project a star while you are there!