MCPSERV.CLUB
minimal-git-server

minimal-git-server

Self-Hosted

Lightweight Git server with CLI and multi‑user support

Active(80)
35stars
0views
Updated 13 days ago
minimal-git-server screenshot

Overview

Discover what makes minimal-git-server powerful

minimal‑git‑server is a lightweight, container‑first Git hosting solution designed for developers who need an isolated, self‑managed repository backend without the overhead of full‑featured platforms. The application exposes a minimal SSH service that accepts Git commands and provides a terse command line interface (CLI) for repository lifecycle management. Its core idea is to keep the operational footprint small while still offering a robust account‑based access model that can be driven entirely from a single YAML configuration file.

Account isolation

CLI for repo management

SSH‑only interface

Public key enforcement

Overview

minimal‑git‑server is a lightweight, container‑first Git hosting solution designed for developers who need an isolated, self‑managed repository backend without the overhead of full‑featured platforms. The application exposes a minimal SSH service that accepts Git commands and provides a terse command line interface (CLI) for repository lifecycle management. Its core idea is to keep the operational footprint small while still offering a robust account‑based access model that can be driven entirely from a single YAML configuration file.

Technical Stack

The server is built in Go, leveraging the language’s native SSH and Git plumbing libraries. This choice yields a single‑binary distribution that can run on any Linux host with Docker or Podman support. The binary is bundled inside a minimal Alpine‑based container, which keeps the image size under 30 MB and removes unnecessary dependencies. Persistent data is stored in three bind mounts: /srv/ssh for host keys, /srv/git for bare repositories, and /srv/config.yml for account definitions. The configuration is parsed with the standard gopkg.in/yaml.v2 package, allowing developers to declare users, UIDs, and SSH public keys in a declarative style.

Core Capabilities

  • Account isolation: Each user is assigned a unique UID; repositories are created under /srv/git/<user>/, ensuring file‑system level isolation.
  • CLI for repo management: The server accepts commands such as list, create, rename, and remove over an SSH session, making it scriptable from CI/CD pipelines or custom tooling.
  • SSH‑only interface: No HTTP/REST API is provided; all interactions happen over the standard Git SSH protocol, which reduces surface area and simplifies firewall rules.
  • Public key enforcement: Only keys listed in config.yml are authorized, allowing fine‑grained access control without an external authentication provider.

Deployment & Infrastructure

Because the application runs as a single container, it integrates seamlessly into existing Docker or Podman ecosystems. For production use, the recommended deployment pattern is a stateless container backed by persistent volumes for /srv/ssh and /srv/git. The image supports automatic updates via tools like Watchtower or Podman‑auto‑update, and the semantic versioning scheme ensures backward compatibility. Scaling horizontally is straightforward: you can run multiple replicas behind a load balancer that terminates SSH, though each replica would need access to the same NFS or shared storage for repositories.

Integration & Extensibility

While minimal‑git‑server deliberately eschews a rich plugin architecture, it offers several hooks for developers:

  • Webhooks: By wrapping the SSH session with a wrapper script, users can trigger external services on push events.
  • Custom scripts: The CLI commands can be called from any language that supports SSH, enabling integration into build pipelines or monitoring tools.
  • Configuration templating: The YAML file can be generated programmatically (e.g., via Terraform or Ansible) to automate account provisioning.

Developer Experience

The project places a strong emphasis on clarity and reproducibility. Documentation is concise, with examples that cover both manual usage and scripted interactions. The repository includes a test.sh script demonstrating typical workflows, making it easy to bootstrap local tests. Community support is modest but active; the maintainers respond quickly on GitHub issues, and the MIT license removes any legal friction for internal or commercial use.

Use Cases

  • CI/CD environments: A single, self‑hosted Git server can serve as a source of truth for internal pipelines without relying on external providers.
  • Educational labs: Instructors can spin up isolated Git servers for students, controlling access via SSH keys in a single config file.
  • Rapid prototyping: Developers who need a quick Git backend for a microservice can deploy the container in minutes, focusing on business logic rather than infrastructure.

Advantages

  • Simplicity: No database, no web UI, and a single binary reduce attack surface and maintenance overhead.
  • Performance: Go’s efficient SSH implementation delivers low‑latency Git operations, suitable for small to medium teams.
  • Licensing: The MIT license allows unrestricted use in proprietary projects, a key consideration for many enterprises.
  • Container‑first: The image is ready for any container orchestrator, making it future‑proof against shifting deployment paradigms.

In summary, minimal‑git‑server offers a pragmatic blend of control and convenience for developers who need a lightweight, scriptable Git hosting solution without the bloat of full‑featured platforms.

Open SourceReady to get started?

Join the community and start self-hosting minimal-git-server today

Weekly Views

Loading...
Support Us
Most Popular

Infrastructure Supporter

$5/month

Keep our servers running and help us maintain the best directory for developers

Repository Health

Loading health data...

Information

Category
development-tools
License
MIT
Stars
35
Technical Specs
Pricing
Open Source
Database
None
Docker
Official
Supported OS
Docker
Author
mcarbonne
mcarbonne
Last Updated
13 days ago