Need help with git-lfs-s3?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

208 Stars 36 Forks 19 Commits 11 Opened issues


A Git LFS server that uses S3 as the storage backend.

Services available


Need anything else?

Contributors list

# 23,820
19 commits

Git LFS S3

A Git LFS server that stores your large Git files on S3.

It works by generating a presigned URL that the Git LFS client can use to upload directly to S3. It also provides download URLs that allow Git clients to download directly from S3. No data is proxied through the Git LFS server.


Git LFS S3 is available on RubyGems.

gem install git-lfs-s3

Or add it to your Gemfile if you wish to bundle it as a part of another application.

gem 'git-lfs-s3'



All configuration is done via environment variables. All of these configuration variables must be set.

    - the region where your S3 bucket is.
    - your AWS access key.
    - your AWS secret key.
    - the bucket you wish to use for LFS storage. While not required, I recommend using a dedicated bucket for this.
    - the URL where this server can be reached; needed to fetch download URLs.

You can (and should) also set authentication information. When you push for the first time from git, you will be prompted to enter a username and password when authentication is enabled. You can configure these with environment variables as well.

    - the login username.
    - the login password.


If you are bundling the service inside of another application, such as Rails, or a different server of your choosing, you can set the configuration directly on

. See bin/git-lfs-s3 for an example.

You can also hook the authentication into your own service this way. For example:

GitLfsS3::Application.on_authenticate do |username, password|
  user = User.find(username: username)

The logger can be configured as well. This is especially handy if you want to hook it into your Rails logger:

GitLfsS3::Application.set :logger, Rails.logger

Git Setup

If you are new to Git LFS, make sure you read the Getting Started guide first. Once that's done, you can configure your Git client to use this server by creating a

file in the root of your repository and adding this config, but with your server address:
    url = ""

Once that is done, you can tell Git LFS to track files with

git lfs track "*.psd"
, for example.


This repository contains an executable that will run a basic WEBrick server. Since this service is so lightweight, that's likely all you'll need. The port will default to 8080, but can be configured with an environment variable.

PORT=4000 git-lfs-s3

However, because this is a Sinatra application, it can also be mounted within other Rack based projects or other Rack-based servers such as Unicorn or Puma. For example, if you wanted to add this to your Rails project, configure

in an initializer, and add this your routes:
mount GitLfsS3::Application => '/lfs'


  • Cloudfront support

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.