UniSite Documentation Center

Automated Markdown Deployment Matrix Calculating...

Homelab Git Deployment Guide

Secure Repository Integration: Local Machine to Gitea Server Instance

Part 1: Architecture Overview

Infrastructure Network Pipeline

Future projects utilize an end-to-end unproxied DNS stream translated through an internal reverse proxy layer to pass raw SSH traffic securely through port 22.

Verified Traffic Pipeline:

[External Workspace Workspace]
       │  (SSH Connection via Standard Port 22)
[Cloudflare DNS Only] ──> gitea.reichelt.org.za
[Home Router] ──────────> Maps External Port 22 ──> Internal Port 2222
[Nginx Proxy Manager LXC] (Listening on Port 2222 via Manual stream.conf file)
[Gitea Container] ──────> Arrives at Local IP 192.168.18.64 on Port 22

Part 2: Authentication

Generating & Adding an SSH Key to Gitea

Using SSH keys allows you to securely establish an authentication connection between your local computer and your Gitea server without having to input your password for every single operation.

Step 2.1: Generate a New SSH Key Pair

Open your local terminal and execute the following command to create a modern key signature configuration block:

ssh-keygen -t ed25519 -C "homelab-developer-key"

Note: If your system doesn't support Ed25519, fall back to RSA: ssh-keygen -t rsa -b 4096 -C "homelab-developer-key"

When prompted to "Enter a file in which to save the key," press Enter to accept the default file location. Next, choose a secure passphrase when prompted, or press Enter again to leave it blank.

Step 2.2: Start the SSH Agent & Add Key

Ensure the SSH agent is active in your terminal system background environment and securely register your private key:

# Start the ssh-agent in the background
eval "$(ssh-agent -s)"

# Add your private SSH key to the agent
ssh-add ~/.ssh/id_ed25519

Step 2.3: Copy your Public SSH Key

Print the contents of your public key file to the terminal window and copy the complete output text cleanly to your system clipboard:

cat ~/.ssh/id_ed25519.pub
  1. Log in to your private Gitea web portal dashboard.
  2. Click on your user avatar icon in the upper-right corner and select Settings from the menu list.
  3. Navigate to the left-hand navigation sidebar menu and click on SSH / GPG Keys.
  4. Locate the Manage SSH Keys section panel and click the Add Key button.
  5. Provide a descriptive text name in the Key Name input field (e.g., "Developer Machine").
  6. Paste your copied clipboard public key text explicitly into the main Content box.
  7. Click the blue Add Key button to complete your registration interface workflow.

Part 3: Project Deployment

Initialize, Commit, and Push Your Project

With authorization parameters configured, you can execute standard local tree commits and securely stream your localized data elements to the repository server structure tracking layer.

Step 3.1: Initialize Git in your project folder

Open your terminal console window, navigate into your root target source project folder path, and initiate tracking structures:

git init

Step 3.2: Stage your project files

Add all file structures within your directory environment to the tracking indexes layer staging block:

git add .

Best Practice Note: If you maintain local dynamic transient artifacts, credential variables, or folders (such as node_modules/ or .env) that should not be published, construct a valid .gitignore configuration file prior to initiating staging.

Step 3.3: Create your first formal commit

Save snapshots of your staged data structures directly into your local storage database with an explicit context tag:

git commit -m "Initial commit"

Step 3.4: Set default branch target mapping

Standardized Gitea repositories utilize the main master nomenclature structure line. Force branch compliance targeting explicitly via:

git branch -M main

Step 3.5: Connect your local project to Gitea via SSH

Point your local git configuration tree parameters cleanly to your remote Gitea target via the SSH URL string (Replace [repository-name] with your actual target project repository folder structure path name):

git remote add origin gitea@gitea.reichelt.org.za:Dieter/[repository-name].git

Note: If an origin target already matches this reference path workspace container layout profile, replace add origin with set-url origin.

Step 3.6: Push your local repository to Gitea

Securely transfer your local commit stream upward to the tracking branches matrix. The -u flag sets up your upstream tracking profiles natively:

git push -u origin main

Quick Reference Sequence Command Matrix

For subsequent setup sequences, you can run this streamlined block after your public configuration registration is active. Simply replace [repository-name] with your actual tracking string profile:

git init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin gitea@gitea.reichelt.org.za:Dieter/[repository-name].git
git push -u origin main

Diagnostics

Pipeline Flow Connection Test

If a push ever hangs or is rejected, verify authentication statuses via:

ssh -vT gitea@gitea.reichelt.org.za

Built for the Homelab Environment | Gitea Infrastructure Setup | 2026