Git LFS server / Rust / MPL-2.0

Your assets. Your disk.

LFSX stores the large binaries of a Git repository, game assets, textures, models and video, so they never touch your host's LFS quota.

docker run -p 8080:8080 ghcr.io/ferrlabs/lfsx:latest

Where the bytes go

git push

Your forgeunchanged

git lfs

LFSXone binary, no database

asks the forgeWhat may this token do?

writes each object once toYour disk or an S3 bucket

The repository stays where it is. One committed .lfsconfig redirects the transfer, and clients need no plugin.

71%
smaller on disk with zstd, measured on two real Unity projects
1 call
to the forge API for a push of two hundred objects
0 accounts
to manage, permissions come live from GitHub, GitLab or Gitea
1 binary
in Rust, configured by environment variables, no database

Why self-host

A 3 GB asset pack cloned by a CI job ten times a month is 30 GB of metered traffic.

GitHub bills LFS storage and bandwidth separately from your plan, and a Unity or Unreal project burns through the free tier in a single push. Self-hosting removes the meter entirely: the cost becomes a disk you already own.

What actually changes
GitHub / GitLab LFSLFSX
Storage and bandwidth metered, billed in packsA disk you already own, with no meter on it
Objects sit with the same vendor as the repositoryThe repository is unchanged, and only the transfer is redirected
Access control is the forge's, and so is the billStill the forge's permissions, asked live, with no second user list
A CI job pulling the same pack pays for it every timeOne committed .lfsconfig, and clients need no plugin

Quick start

Running in four steps.

Run it

A container, a Helm chart, a statically linked binary, or a cargo install.

docker run -d --name lfsx \
  -p 8080:8080 \
  -v lfsx-data:/var/lib/lfsx \
  -e LFSX_PUBLIC_URL=https://lfs.example.com \
  ghcr.io/ferrlabs/lfsx:latest

The volume holds every object. LFSX_PUBLIC_URL is the address clients reconnect to for each transfer.

Point a repository at it

# .lfsconfig
[lfs]
	url = https://lfs.example.com/my-org/my-project

The last two path segments are the organisation and the project, and together they scope the storage. Two repositories sharing a URL share their objects.

Then use Git LFS as usual

git lfs install
git lfs track "*.psd"
git add .gitattributes assets/hero.psd
git commit -m "add hero artwork"
git push

Run git lfs install before cloning. Without it, files arrive as 130-byte pointer stubs, and the tools that read them, Unity, Unreal and image editors, fail in confusing ways.

Verify it works

npm install -g @ferrlabs/lfsx
lfsx --url https://lfs.example.com \
  doctor --repo my-org/my-project

The doctor checks the server is up, its storage is writable, your token is accepted, and that the URL it advertises for transfers is the one you reached it on, which is the mismatch that lets negotiation succeed while every transfer fails.

Auth

There are no accounts to manage.

A client presents the token it would use to clone over HTTPS, and LFSX asks the forge what that token is allowed to do. Each answer is cached, so a push of two hundred objects costs one API call rather than two hundred.

In CI, the token the workflow already holds is enough, with no secret to provision.

- run: |
    printf 'protocol=https\nhost=lfs.example.com\nusername=git\npassword=%s\n' "${{ secrets.GITHUB_TOKEN }}" \
      | git credential approve
    git lfs pull
Role on the forge What it may do with objects
admindownload, upload, and force a lock open
pushdownload, upload, and take locks
pull onlydownload
nonerejected

Storage

A bucket, compression and encryption are each one variable.

Objects live on the filesystem by default, addressed by digest. The three options compose.

LFSX_STORAGE=s3

Objects in a bucket

An S3-compatible bucket, MinIO, Garage, Backblaze or AWS, instead of the volume, which is what unties capacity from one machine.

The locks move with the objects, taken with a conditional write so the store itself decides who arrived first, and that is what makes a second replica possible. The server checks at startup that the store really performs it. Transfers stream through the server by default; LFSX_S3_PRESIGN=true redirects them to the bucket instead.

How a bucket deployment works

LFSX_COMPRESSION=zstd

Compression

The received wisdom is that an LFS store is already compressed, and for PNG, MP3 and OGG that is true. It is badly wrong for meshes.

  • .tga10.4× smaller

    A .tga keeps about a tenth of its size
  • .fbx2.9 to 6.7× smaller

    An .fbx keeps between 15 and 34 percent of its size
  • .png1% smaller, stored as it arrived

    A .png keeps about 99 percent of its size

Measured on two real Unity projects: 71% smaller overall.

Objects are compressed in four-megabyte frames with an index, so ranges still work and memory stays flat. Anything that will not compress is stored as it arrived.

Bars show the size left on disk.

LFSX_ENCRYPTION_KEY_FILE, ChaCha20-Poly1305

Encryption at rest

For most self-hosted deployments the better answer is the volume: LUKS, an encrypted EBS volume, a storage class that does it transparently. Reach for this when the storage itself is what you do not trust: a shared NAS, a bucket somebody else operates, a disk you will one day return under warranty.

The key is a file path, never the key itself: a key in an environment variable is in the pod spec, in docker inspect, and in every log that dumps the environment. Rotation is a new line at the top of the file. Compression runs first when both are on.

It does not protect against anyone who has the running server, because that process holds the key by construction.

All configuration is by environment variable.

No config file to template, no database to migrate.

LFSX_PUBLIC_URL is echoed in the batch response and the client reconnects to it for every object. If it is wrong, negotiation succeeds and every transfer then fails.

Every variable

FAQ

Do my clients need a plugin?

No. Git LFS 3.0.2 and later are exercised on Linux, macOS and Windows, including the copies bundled by Git for Windows, GitHub Desktop, Sourcetree, Rider and Unity.

Can authentication live in the proxy?

No, and this rules out the approach most people reach for first. Behind an authenticating proxy, git-lfs calls the transfer URLs with no credentials at all and retries in a loop. LFSX never claims a transfer through itself is pre-authenticated, so the client authenticates each one.

Which forges are supported?

GitHub, GitLab, and Gitea together with Forgejo, including Enterprise and self-managed instances through their API URL. GitLab grants inherited from a group count the same as ones set on the project.

Does it handle file locks?

Yes, for the assets that cannot be merged, with force-open reserved for the levels a forge treats as administrative: admin on GitHub and Gitea, Maintainer or Owner on GitLab. In a bucket the server checks at startup that the store really refuses a conditional write, and gives locking up rather than hand the same lock to two people.

Can I contribute a forge?

Three providers exist, so the shape is settled rather than guessed: one module under server/src/auth/ exposing three functions, plus a config variant and three arms in auth.rs. The caching, the challenge handling and the rejection accounting are shared and provider-blind.

Self-hosting removes the meter entirely.