Self-Hosted Git Server (Forgejo v17) on Proxmox LXC: 123.9 MiB RAM, 5.3 GB Repos & systemd 1.5 OK Hardening
Cloud Git hosts throttle or reject repositories once assets cross the 100 MB ceiling. We provisioned Forgejo v17.0.2 inside an unprivileged Debian 13 (trixie) Proxmox LXC container (CT 104) in 43 seconds, pushed 7 private repositories totaling 5.3 GB over 2.5GbE SSH, measured just 123.9 MiB RAM under load, and tightened systemd-analyze security from 9.6 UNSAFE down to 1.5 OK.
Proxmox Mini PC Nodes, DRAM NVMe Primary Storage, SATA Backup SSDs & FIDO2 Keys
Everything needed to host an ultra-quiet Forgejo LXC vault on NVMe, isolate weekly vzdump snapshots onto a separate physical SATA SSD, and protect admin logins with hardware keys. Links route automatically to your regional Amazon store (UK / US / PL).
1. Why Self-Host Forgejo v17 in an Unprivileged Proxmox LXC (Not Docker on Root)
Every developer eventually hits the same friction with hosted Git: hard 100 MB per-file caps, push timeouts on multi-gigabyte print or media repositories, silent rate limits, and third-party AI training policies hovering over private codebases. Hosting your own Git server solves all four problems in one afternoon—provided you do not bloat it with a 4 GB Java stack or an exposed Docker socket.
Forgejo v17.0.2 compiles down to a single static Go runtime binary with zero external runtime dependencies. Paired with SQLite in WAL mode and Forgejo's native Bleve repository search index inside an unprivileged Debian 13 (trixie) LXC container, it boots cleanly alongside your existing Proxmox stack while keeping the host kernel isolated via UID/GID namespace mapping.
43-Second NVMe Provisioning
Unpacking the 528 MiB Debian 13 template on local-btrfs finishes in 10 seconds at 334 MiB/s. Allocated 2 vCPU, 1024 MB RAM cap, 0 MB swap, and a 20 GB sparse disk with onboot: 1.
123.9 MiB RAM & 2–24 ms UI
Measured directly from cgroup memory.current: 106.7 MiB (111,984,640 B) idle, rising to just 123.9 MiB (129,982,464 B) after indexing 7 private repositories up to 5.3 GB.
6.1 GB → 4.5 GB Bare Repos
Workstation .git directories totaling ~6.1 GB compacted down to 4.5 GB inside /var/lib/forgejo/repositories, keeping the entire OS + binary + 7 repos at 5.5 GB on disk.
# 1. Create unprivileged Debian 13 (trixie) container on Proxmox VE host pct create 104 local:vztmpl/debian-13-standard_13.6-1_amd64.tar.zst \ --hostname forgejo-git --arch amd64 --ostype debian \ --unprivileged 1 --features nesting=1 \ --cores 2 --memory 1024 --swap 0 --rootfs local-btrfs:20 \ --net0 name=eth0,bridge=vmbr0,ip=192.168.0.254/23,gw=192.168.0.1,type=veth \ --nameserver "1.1.1.1 9.9.9.9" --onboot 1 --start 1 # 2. Inside CT 104: verify Forgejo v17.0.2 binary (Go runtime) via SHA-256 cd /tmp curl -fsSLO https://codeberg.org/forgejo/forgejo/releases/download/v17.0.2/forgejo-17.0.2-linux-amd64.xz curl -fsSLO https://codeberg.org/forgejo/forgejo/releases/download/v17.0.2/forgejo-17.0.2-linux-amd64.sha256 xz -df forgejo-17.0.2-linux-amd64.xz sha256sum -c forgejo-17.0.2-linux-amd64.sha256 install -m 0755 forgejo-17.0.2-linux-amd64 /usr/local/bin/forgejo
2. Measured Telemetry & 2.5GbE SSH Push Benchmarks (Including a 5.3 GB Repo)
Instead of quoting synthetic microbenchmarks, we pushed 7 real-world private repositories from our workstation over 2.5GbE Ethernet using Ed25519 SSH keys and timed both the client push and server-side index-pack delta resolution. Even the heaviest 5.3 GB 300 DPI print archive—which GitHub rejects outright under its 100 MB file and push ceilings—completed cleanly without touching swap or triggering OOM.
| Anonymized Repository | Local .git Size |
2.5GbE SSH git push + index-pack |
Workload & Engineering Notes |
|---|---|---|---|
repo-oem-tools |
852 KB |
0.79 s | OEM component lookup tables and spreadsheet exporter scripts. |
repo-docs-kb |
9.1 MB |
1.32 s | 282 Markdown architecture runbooks and automation scripts. |
repo-static-site |
27 MB |
2.58 s | 73 static HTML pages, vector graphics, and build helpers. |
repo-legal-portal |
52 MB |
4.46 s | 72 client-side tools and sub-modules across 59 commits. |
repo-engineering-hub |
131 MB |
7.40 s | 4-language engineering portal and diagnostics suite across 153 commits. |
repo-media-showcase |
568 MB |
26.45 s (~21.5 MB/s) |
Static storefront with compressed WebP and PDF preview assets. |
repo-print-assets-300dpi |
5.3 GB |
401.69 s (6 min 41 s) |
93 commits of 300 DPI print masters—rejected by GitHub's 100 MB limit, ingested cleanly over SSH on Forgejo. |
3. Hardening systemd from 9.6 UNSAFE Down to 1.5 OK :-)
Default service units installed from generic tutorials usually run with an exposure score around 9.6 UNSAFE in systemd-analyze security: the web process can read kernel tunables, inspect other processes in /proc, invoke arbitrary syscalls, and hold writable access outside its data path. Even adding basic ProtectSystem=strict flags only improves the score to 6.2 MEDIUM.
Because Forgejo is compiled with the native Go runtime (no JIT code generation required), we can enable MemoryDenyWriteExecute=yes, drop every Linux capability, isolate /proc to the service's own PID, and restrict syscalls to @system-service—achieving a production score of 1.5 OK :-) while keeping SSH pushes, HTTP UI rendering, and Bleve indexing 100% functional.
[Unit] Description=Forgejo Sovereign Git Server After=syslog.target network.target [Service] Type=notify User=git Group=git UMask=0027 WorkingDirectory=/var/lib/forgejo Environment=USER=git HOME=/var/lib/forgejo FORGEJO_WORK_DIR=/var/lib/forgejo ExecStart=/usr/local/bin/forgejo web --config /etc/forgejo/app.ini Restart=always RestartSec=3s TimeoutStopSec=30s # Systemd Sandboxing (systemd-analyze security: 9.6 UNSAFE -> 6.2 MEDIUM -> 1.5 OK) NoNewPrivileges=yes PrivateTmp=yes PrivateDevices=yes ProtectSystem=strict ProtectHome=yes ProtectHostname=yes ProtectClock=yes ProtectKernelTunables=yes ProtectKernelModules=yes ProtectKernelLogs=yes ProtectControlGroups=yes ProtectProc=invisible ProcSubset=pid CapabilityBoundingSet= AmbientCapabilities= RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 RestrictNamespaces=yes RestrictRealtime=yes RestrictSUIDSGID=yes LockPersonality=yes MemoryDenyWriteExecute=yes SystemCallArchitectures=native SystemCallFilter=@system-service SystemCallErrorNumber=EPERM ReadWritePaths=/var/lib/forgejo /etc/forgejo [Install] WantedBy=multi-user.target
Notice one subtle detail inside [Service]: we grant ReadWritePaths=/var/lib/forgejo /etc/forgejo only while setting UMask=0027. Once your initial secrets (SECRET_KEY, INTERNAL_TOKEN, JWT_SECRET, LFS_JWT_SECRET) and INSTALL_LOCK = true are written into /etc/forgejo/app.ini, even a compromised web handler cannot touch system binaries, other user directories, kernel devices, or raw sockets.
4. Three Live Debian 13 LXC & Forgejo v17 Production Traps Caught in the Lab
systemctl reload sshCrashes Withstatus=255/EXCEPTION (fatal: Cannot bind any address): On Debian 13 (trixie), OpenSSH runs alongsidessh.socketsystemd socket activation. SendingSIGHUPviasystemctl reload sshtriggers a bind collision on port::22and drops your SSH daemon. Always apply/etc/ssh/sshd_config.d/forgejo.confchanges withsystemctl restart sshinstead ofreload.adduser --system --disabled-passwordSilently Locks Out OpenSSH Keys: Creating thegitservice account with--disabled-passwordwrites an exclamation mark (!) into/etc/shadow. In hardened OpenSSH setups withPasswordAuthentication noand without PAM password bypass, OpenSSH treats!as a locked account and refusesEd25519public-key login. Fix it cleanly withusermod -p '*' git—this unlocks key-based SSH while keeping password authentication impossible.- Deprecated
[server] LFS_CONTENT_PATHWarning in Forgejo v17/admin/config: Older Gitea tutorials placeLFS_CONTENT_PATHinside the[server]block, which raises a red deprecation alert in Forgejo v17's Admin Configuration audit. Move it to a dedicated[lfs]section usingPATH = /var/lib/forgejo/data/lfs(while keepingLFS_START_SERVER = trueunder[server]) so/admin/configreports zero configuration warnings.
5. Private Access (Zero Public Registration) + 3-2-1 Proxmox Backup Integration
A self-hosted Git vault holding private infrastructure code and proprietary assets should never expose sign-up forms or repository listings to unauthenticated visitors. Inside /etc/forgejo/app.ini, lock the instance down with four settings: DISABLE_REGISTRATION = true, REQUIRE_SIGNIN_VIEW = true, FORCE_PRIVATE = true, and DEFAULT_THEME = forgejo-dark (for a clean Dark OLED UI that renders in 2–24 ms).
Keep the Forgejo HTTP port (3000) and SSH port (22) bound strictly to your internal LAN and private Tailscale Subnet Router—never forward them to the public internet. For physical disaster resilience, integrate CT 104 directly into a layered 3-2-1-1-0 air-gapped Restic & rclone backup architecture:
- Layer 1 (Workstation): Local working directories and full
.githistory for sub-secondgit revert/git checkout. - Layer 2 (Proxmox NVMe + Weekly
vzdump zstdto Second Physical SATA SSD):CT 104lives on your primary NVMe pool (local-btrfs), while Proxmox's Sunday03:00job (mode=snapshot,compress=zstd,keep-last=3) writes an independent container archive onto a second physical SATA SSD—alongside a localResticrepository for heavy non-Git assets. - Layer 3 (Zero-Knowledge Off-Site Cloud): Encrypted client-side
Restic + rclonesnapshots (AES-256) pushed off-site so fire or theft at home cannot wipe your code history.
🛡️ Interactive Forgejo Proxmox LXC & systemd 1.5 OK Builder (100% In-RAM)
Select your repository workload, database backend, and systemd isolation level to compute exact Proxmox LXC sizing and generate copy-ready forgejo.service, app.ini privacy/LFS blocks, and pct create commands.
6. Trap-Free Hardware Stack for Proxmox Git Vaults & Secondary Backups
Running Forgejo 24/7 inside an unprivileged container requires very little compute, yet storage endurance and backup separation matter enormously. Pair an energy-efficient Mini PC with a DRAM-cached NVMe boot/container drive, a physically separate 2.5" SATA SSD for vzdump snapshots, and hardware FIDO2 keys for administrative protection.
Mini PC for Proxmox LXC (Minisforum / GMKtec)
Hosts CT 104 alongside Tailscale and monitoring containers at a fraction of a desktop tower's wall draw while saturating 2.5GbE on multi-gigabyte Git pushes. Compare compact nodes in our Proxmox Mini PC hierarchy and sub-15W server tuning guide.
NVMe SSD with DRAM Cache (TLC Endurance)
SQLite WAL commits and multi-gigabyte git index-pack delta compression generate random small-block writes. Using a true TLC NVMe drive with onboard DRAM cache avoids DRAM-less HMB latency spikes and sustains fast container unpacks (334 MiB/s).
2.5" SATA SSD for Secondary vzdump Backup
Never store Proxmox vzdump backups on the same NVMe stick that runs your LXC rootfs. Dedicated SATA SSD storage catches mode=snapshot zstd container archives cleanly so a dead primary M.2 drive never takes your backups with it.
YubiKey 5C NFC Hardware Security Key
Pair Forgejo WebAuthn 2FA and OpenSSH ed25519-sk hardware-touch keys with your Proxmox root login and password manager holding your Restic master key. See our FIDO2 hardware key blueprint for backup key rules.
7. Related SpecInfo Proxmox, Backup & Linux Hardening Guides
- Bulletproof 3-2-1-1-0 Backup Against Ransomware, Fire & Theft: Restic, rclone & Air-Gapped Storage
- Silent Linux & Proxmox Log Errors Everyone Ignores Until the Server Dies (PCIe AER, TBW & LXC Traps)
- Low-Power 24/7 Homelab & Proxmox Server Under 15W: Intel N100 / N150 & Deep C-States
- FIDO2 Hardware Security Keys (YubiKey 5C NFC) & Hardware SSH Keys Guide
- 24-Hour Home Network & IoT Telemetry Audit: AdGuard Home, WatchYourLAN & OpenSnitch