Ultra-fast & lightweight cgit clone.
License: WTFPL. Built with: Rust, HTML, Nix, SCSS, Dockerfile, Shell. Source: https://github.com/w4/rgit.
#### From Source (manually) Clone the repository and build: ```shell git clone https://github.com/w4/rgit.git cd rgit cargo build --release ``` The rgit binary will be found in the `target/release` directory. ### Usage To get up and running quickly, run rgit with the following: ```shell rgit [::]:3333 /path/to/my-bare-repos -d /tmp/rgit-cache.db ``` **Notes:** - Repository indexing is recursive. - The database is quick to generate, so this can be pointed to temporary storage. ### Configuration #### Repository Description To set a repository description, edit the file named `description` inside the bare git repository. Add your desired description text to this file. #### Repository Owner To assign an owner to a repository, edit the file named `config` inside the bare git repository and include the following content: ```ini [gitweb] owner = "Al Gorithm" ``` Replace `Al Gorithm` with the desired owner's name. ### NixOS Running rgit on NixOS is straightforward, simply import the module into your `flake.nix` and use the provided service: ```nix { inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05"; rgit = { url = "github:w4/rgit"; inputs.nixpkgs = "nixpkgs"; }; }; outputs = { nixpkgs, ... }: { nixosConfigurations.mySystem = nixpkgs.lib.nixosSystem { modules = [ rgit.nixosModules.default { services.rgit = { enable = true; bindAddress = "[::]:3333"; dbStorePath = "/tmp/rgit.db"; repositoryStorePath = "/path/to/my-bare-repos"; }; } ... ]; }; }; } ``` ### Docker Running rgit in Docker is straightforward. Follow these steps, ensuring that your repository directory is correctly mounted: ```shell docker run --mount type=bind,source=/path/to/my-bare-repos,target=/git \ --user $UID:$GID \ -it ghcr.io/w4/rgit:main ``` **Note**: Replace `$UID` and `$GID` with the UID and GID of the user that owns the directory containing your repositories. If these values are incorrect, errors will occur. Learn how to find the UID of a user [here](https://linuxhandbook.com/uid-linux/). #### Docker Compose An example `docker-compose.yml` is provided for those who prefer using Compose. To configure the UID and GID, the user can be specified in `docker-compose.override.yml`. An example override file has been has been provided with the repository. To use it, remove the `.example` extension from `docker-compose.override.yml.example`, and adjust the UID and GID to match the user that owns the directory containing your repositories. To configure automatic refresh in Docker, an environment variable is also provided. ```yml version: '3' services: rgit: image: ghcr.io/w4/rgit:main command: - "[::]:8000" - /git - -d /tmp/rgit-cache.db volumes: - /volume/git:/git ports: - 8000:8000 environment: - REFRESH_INTERVAL=5m restart: unless-stopped
Self-hosting gives you three things SaaS can’t: data ownership (the files live on disks you control), cost predictability (a one-time setup vs. recurring per-seat fees that grow with your household or team), and longevity (open-source means the app keeps working even if the maintainers move on, since you can pin a working version). The trade-off is that you take on the operational work of running a server, applying updates, and handling backups.
Most self-hosted apps run comfortably on modest hardware — a Raspberry Pi 4, a mini PC, a NAS with Docker support, or a small VPS is usually enough for personal or family use. CPU and RAM requirements scale with how many simultaneous users or how much data you push through rgit. Storage requirements depend on the kind of data you keep; check the README for guidance on data retention.
Last verified: 2026-04-28