selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

GitHub
lufin logo

Self-host lufin

v1.0.0

Modern self-hosted file sharing with end-to-end encryption

ReleaseOpen SourceMIT
Updated9 months ago
LanguageTypescript
Setup difficultyModerate
Stars
234
Port
3000 (backend API)
Install with Docker Compose
Lufin file sharing interfaceLufin file sharing interface - second view

What is lufin?

Lufin is a modern self-hosted file sharing service built with React, Elysia, and Bun. It provides client-side end-to-end encryption using AES-GCM, password protection for shared files, and configurable data retention based on file size. The service offers rich previews for images, audio, video, archives, spreadsheets, text files, and PDFs directly in the browser. It supports multiple database backends including PostgreSQL, MongoDB, and SQLite, along with storage options such as local filesystem, S3-compatible services like Cloudflare R2, and local MinIO. Deployment uses Docker Compose with automatic HTTPS via Caddy, or manual installation from source. The frontend is fully static with no server-side rendering required. The interface is available in 26 languages. There is no user authentication system — files are shared via links stored in browser LocalStorage.

Should you self-host lufin?

lufin scores 45/100 on selfhost.directory (how scoring works) and ranks #62 of 86 in File Sharing. It has 234 GitHub stars.

There was no stable release in the past 12 months, so check the repository's recent activity before you rely on it.

Setup is moderate: expect some configuration beyond a single command. It is MIT-licensed and written mostly in Typescript.

Its closest alternative on selfhost.directory is copyparty (82/100, 47 153 stars). It scores higher overall, so compare the two before you pick. See lufin vs copyparty side by side.

Features

  • Automatic file renaming
  • Client-side Archive Generation
  • Client-side file previews
  • Client-side Image Compression
  • Configurable data retention
  • Delete at first download
  • Docker Compose Deployment
  • End-to-end encryption
  • File sharing via links
  • LocalStorage link management
  • Metadata stripping
  • Multi-language Support
  • Multiple database support
  • Password Protection

lufin README

How to install lufin

Install lufin with Docker Compose

Docker Engine and Docker Compose installed
Environment variables
DOMAIN, EMAIL, BACKEND_PORT, CADDY_HTTP_PORT, AUTO_HTTPS, POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB, MONGODB_USERNAME, MONGODB_PASSWORD, MONGODB_DB_NAME, S3_ENDPOINT, S3_ACCESS_KEY, S3_SECRET_ACCESS_KEY, S3_BUCKET_NAME, S3_REGION, SQLITE_DB_DIR
  1. Clone lufin to your machine & cd into project's root
  2. Run ./configure.sh file and answer questions
    • If you're running lufin as part of a larger platform or with other web services, or using Cloudflare, or want to manage TLS certificates yourself, you will need a reverse proxy running in front of it. Answer "no" when asked whether you want to enable Caddy automatic HTTPS. In all other cases, it's recommended that you answer "yes".
    • Tip: if you want to keep automatic HTTPS but change the default binding to 80/443 ports, you can answer "yes" and then manually change ports in the generated .env file!
    • Choose database and storage for lufin
    • Databases:
      • PostgreSQL is recommended for most cases
      • SQLite is a good alternative for low-end machines
      • MongoDB can be used as your personal preference
    • Storages:
      • Local uploads is fastest and recommended for most cases
      • Local Minio S3 can be beneficial for very high load due to caching
      • Remote S3 can be used for machines with small disk capacity
  3. Run ./run.sh command with selected database and storage passed as arguments

Start:

./run.sh start

Stop:

./run.sh stop

Reload:

./run.sh reload

Stop everything and permanently delete everything, including databases and locally uploaded files:

./run.sh permadel

Recommended installation method

How to configure lufin

  • AUTO_HTTPSEnable automatic HTTPS

    Enable automatic HTTPS

  • BACKEND_PORT3000Port that the backend is running on in internal lufin containers network

    Port that the backend is running on in internal lufin containers network

  • CADDY_HTTP_PORT80HTTP port for Caddy

    HTTP port for Caddy

  • CORS_ORIGINValue for Access-Control-Allow-Origin header in responses

    Value for Access-Control-Allow-Origin header in responses

  • DOMAINDomain name for automatic TLS certificate

    Domain name for automatic TLS certificate

  • GRACE_PERIOD7200Time in seconds to keep the page files after expiration to allow initialized downloads to complete

    Time in seconds to keep the page files after expiration to allow initialized downloads to complete

  • MONGODB_CONNECTION_STRINGMongoDB connection string with database

    MongoDB connection string with database

  • MONGODB_DB_NAMEMongoDB database name

    MongoDB database name

  • MONGODB_PASSWORDMongoDB root password

    MongoDB root password

  • MONGODB_USERNAMEMongoDB root username

    MongoDB root username

  • PORT3000Backend API port

    Backend API port

  • POSTGRES_DBPostgreSQL database name

    PostgreSQL database name

  • POSTGRES_PASSWORDPostgreSQL password

    PostgreSQL password

  • POSTGRESQL_CONNECTION_STRINGPostgreSQL connection string with database

    PostgreSQL connection string with database

  • POSTGRES_USERPostgreSQL username

    PostgreSQL username

  • S3_ACCESS_KEYS3 Access Key ID

    S3 Access Key ID

  • S3_BUCKETS3 bucket name

    S3 bucket name

  • S3_BUCKET_NAMES3 bucket name

    S3 bucket name

  • S3_ENDPOINTS3 endpoint

    S3 endpoint

  • S3_REGIONS3 region, if your provider requires one

    S3 region, if your provider requires one

  • S3_SECRET_ACCESS_KEYS3 Access Key Secret

    S3 Access Key Secret

  • SQLITE_DB_DIR/usr/src/app/sqliteSQLite database directory

    SQLite database directory

  • SQLITE_DB_PATHSQLite database file path

    SQLite database file path

  • UPLOADS_DIRWritable directory for uploaded files

    Writable directory for uploaded files

  • VITE_API_URLFull URI to API

    Full URI to API

  • VITE_CONTACT_EMAILContact admin email

    Contact admin email

lufin releases & version history

More in File Storage

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…