laforceit-blog/public/blog/posts/filebrowser-setup.md

6.1 KiB
Executable File

title description pubDate updatedDate category tags heroImage
Setting Up FileBrowser for Self-Hosted File Management A step-by-step guide to deploying and configuring FileBrowser for secure, user-friendly file management in your home lab environment. 2025-04-19 2025-04-18 Services
filebrowser
self-hosted
kubernetes
docker
file-management
/blog/images/posts/prometheusk8.png

I've said it before, and I'll say it again - the journey to a well-organized digital life begins with proper file management. If you're like me, you've got files scattered across multiple devices, cloud services, and servers. What if I told you there's a lightweight, sleek solution that puts you back in control without relying on third-party services?

Enter FileBrowser, a simple yet powerful self-hosted file management interface that I've been using in my home lab for the past few months. Let me show you how to set it up and some cool ways I'm using it.

What is FileBrowser?

FileBrowser is an open-source, single binary file manager with a clean web interface that lets you:

  • Access and manage files from any device with a browser
  • Share files with customizable permissions
  • Edit files directly in the browser
  • Perform basic file operations (copy, move, delete, upload, download)
  • Search through your files and folders

The best part? It's lightweight (< 20MB), written in Go, and runs on pretty much anything - from a Raspberry Pi to your Kubernetes cluster.

Getting Started with FileBrowser

Option 1: Docker Deployment

For the Docker enthusiasts (like me), here's how to get FileBrowser up and running in seconds:

docker run -d \
    --name filebrowser \
    -v /path/to/your/files:/srv \
    -v /path/to/filebrowser/database:/database \
    -e PUID=$(id -u) \
    -e PGID=$(id -g) \
    -p 8080:80 \
    filebrowser/filebrowser:latest

This will start FileBrowser on port 8080, with your files mounted at /srv inside the container.

Option 2: Kubernetes Deployment with Helm

For my fellow Kubernetes fanatics, here's a simple Helm chart deployment:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: filebrowser
  labels:
    app: filebrowser
spec:
  replicas: 1
  selector:
    matchLabels:
      app: filebrowser
  template:
    metadata:
      labels:
        app: filebrowser
    spec:
      containers:
      - name: filebrowser
        image: filebrowser/filebrowser:latest
        ports:
        - containerPort: 80
        volumeMounts:
        - name: config
          mountPath: /database
        - name: data
          mountPath: /srv
      volumes:
      - name: config
        persistentVolumeClaim:
          claimName: filebrowser-config
      - name: data
        persistentVolumeClaim:
          claimName: filebrowser-data
---
apiVersion: v1
kind: Service
metadata:
  name: filebrowser
spec:
  type: ClusterIP
  ports:
  - port: 80
    targetPort: 80
  selector:
    app: filebrowser

Don't forget to create the necessary PVCs for your configuration and data.

Configuring FileBrowser

Once you have FileBrowser running, you can access it at http://your-server:8080. The default credentials are:

  • Username: admin
  • Password: admin

Pro tip: Change these immediately! You can do this through the UI or by using the FileBrowser CLI.

Custom Configuration

You can customize FileBrowser by modifying the configuration file. Here's what my config looks like:

{
  "port": 80,
  "baseURL": "",
  "address": "",
  "log": "stdout",
  "database": "/database/filebrowser.db",
  "root": "/srv",
  "auth": {
    "method": "json",
    "header": ""
  },
  "branding": {
    "name": "LaForceIT Files",
    "disableExternal": false,
    "files": "",
    "theme": "dark"
  },
  "cors": {
    "enabled": false,
    "credentials": false,
    "allowedHosts": []
  }
}

Securing FileBrowser

Security is crucial, especially when hosting a file manager. Here's how I secure my FileBrowser instance:

  1. Reverse Proxy: I put FileBrowser behind a reverse proxy (Traefik) with SSL encryption.

  2. Authentication: I've integrated with my Authelia setup for SSO across my services.

  3. User Isolation: I create separate users with their own root directories to keep things isolated.

Here's a sample Traefik configuration for FileBrowser:

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: filebrowser
  namespace: default
spec:
  entryPoints:
    - websecure
  routes:
    - match: Host(`files.yourdomain.com`)
      kind: Rule
      services:
        - name: filebrowser
          port: 80
      middlewares:
        - name: auth-middleware
  tls:
    certResolver: letsencrypt

My Top 5 FileBrowser Use Cases

  1. Home Media Management: I organize my photos, music, and video collections.

  2. Document Repository: A central place for important documents that I can access from anywhere.

  3. Code Snippet Library: I keep commonly used code snippets organized by language and project.

  4. Backup Verification: An easy way to browse my automated backups to verify they're working.

  5. Sharing Files: When I need to share large files with friends or family, I create a temporary user with limited access.

Power User Tips

Here are some tricks I've learned along the way:

  • Keyboard Shortcuts: Press ? in the UI to see all available shortcuts.
  • Custom Branding: Personalize the look and feel by setting a custom name and logo in the config.
  • Multiple Instances: Run multiple instances for different purposes (e.g., one for media, one for documents).
  • Command Runner: Use the built-in command runner to execute shell scripts on your server.

Wrapping Up

FileBrowser has become an essential part of my home lab setup. It's lightweight, fast, and just gets the job done without unnecessary complexity. Whether you're a home lab enthusiast or just looking for a simple way to manage your files, FileBrowser is worth checking out.

What file management solution are you using? Let me know in the comments!


This post was last updated on December 15, 2023 with the latest FileBrowser configuration options and security recommendations.