1. Overview & Architecture
Gitea serves as the local “Sovereign” Source of Truth for all GitOps repositories and infrastructure-as-code.Architecture Specifications
- Target Host / Domain:
10.17.250.28(or your host IP / FQDN) - Database Backend: PostgreSQL 15 (Alpine)
- Application Server: Gitea 1.26.3
- HTTP/HTTPS Port:
3000(Mapped to container port3000over HTTPS) - SSH Port:
2222(Mapped to container port22for Git over SSH) - Security & Protocol: HTTPS enforced with TLS certificates signed by Sovereign CA.
- Automated Installation Bypass: The Gitea Web UI installer is bypassed programmatically via runtime environment variables (
GITEA__security__INSTALL_LOCK: "true").
2. Prerequisites
Before running any installation steps, verify the host system requirements:-
Enable User Linger:
Rootless container services run within unprivileged user space. Enabling linger ensures systemd user daemons and containers remain active across reboots and SSH session logouts:
-
Verify Podman & Dependencies:
Confirm that Podman (v4+ or v5+) and Podman Compose are installed:
3. Step-by-Step Installation Commands
Step A: Generate TLS Certificates & Directory Setup
-
Create Configuration and Certificate Directories:
-
Generate Private Key and Self-Signed / Sovereign Certificate:
Security & Rootless UID Mapping Note: In rootless Podman, the invoking host user UID (e.g. 1000) maps to UID 0 (root) inside the container namespace, whereas Gitea runs internally as unprivileged user
git(UID/GID 1000 inside container, mapped to host subuid range e.g. 100999). Because of this namespace mapping, a host key file with mode0600owned by host UID 1000 is inaccessible to container UID 1000 unless permissions are0644or group permissions allow access (chmod 0640with appropriate group ownership). If Gitea reports permission denied readinggitea.key, verify user mapping viapodman exec gitea-app idorpodman exec gitea-stack-gitea-app idand adjustgitea.keyread permissions accordingly. -
Install Sovereign CA in Host Trust Store:
-
On Debian / Ubuntu:
-
On Red Hat / AlmaLinux / CentOS:
-
On Debian / Ubuntu:
Step B: Create Storage Volumes & Podman Pod
-
Create Podman Pod with HTTP (3000) and SSH (2222) Port Mappings:
-
Create Storage Volumes:
Step C: Secure Secrets Management (gitea.env)
To prevent embedding plaintext credentials in CLI parameters or systemd unit files, generate a high-entropy password and store environment secrets in a strict 0600 file:
Step D: Deploy PostgreSQL Database Container
Deploy PostgreSQL 15 within the rootless pod:Step E: Deploy Gitea HTTPS Application Container
Deploy Gitea 1.26.3 with volume mounts for certificates (including:ro,Z for SELinux relabeling), application data, and timezone:
Step F: Systemd Quadlet & Unit File Integration
To manage the standalone stack via user-level systemd:Option 1: Podman Native Systemd Generation
Option 2: Podman 5 Native Quadlet Kube (gitea-stack.kube & gitea-stack.yaml)
-
Create
~/.config/containers/systemd/gitea-stack.kube: -
Create
~/.config/containers/systemd/gitea-stack.yamlwith mode0600(substituting${HOME}for your target user home path): -
Reload systemd user daemon and start Quadlet service:
4. Post-Installation Account, Token & Repository Setup (CLI & API)
Once Gitea is active over HTTPS on port 3000, perform initial administrative setup programmatically usingpodman exec (Gitea CLI) and curl (Gitea API).
A. Create Admin Account via Gitea CLI
Execute user creation directly inside the container. Note that under manual Podman Pod deployment the container is namedgitea-app, whereas under Quadlet Kube deployment Podman names the container gitea-stack-gitea-app:
B. Create Access Token & Organisation via API
To prevent exposing credentials in process listings or command history, pass authentication via a mode-0600curl config file (~/.gitea-auth-config):
C. Register Host SSH Public Key (Port 2222) & Revoke Token
5. Git Remote & Client Access (HTTPS & SSH)
HTTPS Setup
SSH Setup (Port 2222)
6. Maintenance & Troubleshooting
Service Status & Logs
Support commands cover both systemd unit names (pod-gitea-stack.service for generated systemd, gitea-stack.service for Quadlet Kube):
Troubleshooting: “Permission Denied” Reading gitea.key
If Gitea container fails to read key permissions on startup, check user namespace identity via podman exec gitea-app id or podman exec gitea-stack-gitea-app id:
Decommissioning & Cleanup
To ensure neither Option 1 nor Option 2 remains active after cleanup, stop and disable both unit names:Deep State of Mind (DSOM) For My AI Protocol | Harisfazillah Jamel (LinuxMalaysia) | 2026-08-20 Standard: UK English | DBP-standard Bahasa Melayu Malaysia (Piawai) | GNU General Public License v3.0