The Simplest Way to Make Gitea and Rocky Linux Work Like They Should

Published
Length
4 min read

Luis Felipe Dias

All posts

Running gitea and rocky linux gives teams a fast, self-hosted Git setup on a stable host. This pair lets developers push code, run build jobs, and manage repos on their own servers. Gitea is a light Git service written in Go. Rocky Linux is an enterprise Linux OS built for long-term server stability. When you pair them, you get full control over your code and your operating system. You do not need to pay per seat or send code to outside clouds. Still, you must set up user roles, file rules, and

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Running gitea and rocky linux gives teams a fast, self-hosted Git setup on a stable host. This pair lets developers push code, run build jobs, and manage repos on their own servers.

Gitea is a light Git service written in Go. Rocky Linux is an enterprise Linux OS built for long-term server stability. When you pair them, you get full control over your code and your operating system. You do not need to pay per seat or send code to outside clouds. Still, you must set up user roles, file rules, and network paths the right way.

How gitea and rocky linux handle logins and data flow

In a standard setup, the Git app runs as a dedicated system user on the host. Rocky Linux uses systemd to start, stop, and watch the background service. When a developer pushes code, the traffic hits the host over HTTPS or SSH. The host checks the network port and passes the request to the Git service.

For SSH pushes, the system uses a single service account on the Linux host. Gitea matches the developer's public SSH key to their profile in its own database. Then it checks if that person has write permissions for that specific repo. If the check passes, the app writes the new Git objects to the local Linux disk.

Web logins work in a similar way. Users log in through a browser or send API calls with a personal token. You can also link the app to an external identity provider using standard protocols. Meanwhile, Rocky Linux enforces mandatory access controls at the kernel level. Each binary and folder needs the right security label so the app can read and write files. The app also talks to a local or remote database to store issues, pull requests, and user roles.

Common failure modes and how to scope roles

Many teams make mistakes when they first set up this stack. The worst mistake is running the Git service as the root user on Rocky Linux. If an attacker finds a bug in the app, they gain full control of the host. Always create a locked-down system account with no shell login for the service.

Another common flaw is turning off kernel security rules when file errors happen. Admins often disable these checks to fix quick permission bugs during setup. Instead, keep the security policy active and set the right labels on your Git data folders. This stops a compromised web process from reading sensitive system files elsewhere on the server.

End-to-End Encryption + Linux Capabilities Management: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Shared tokens and broad admin roles also create huge risks for engineering teams. Teams often create one admin token for their build runners and reuse it everywhere. If that token leaks, anyone can read or delete every repo on the server. Give each build runner its own account with read-only permissions to specific repos. Set short expiration dates on all personal tokens and rotate deploy keys often.

Unlogged host logins are another big blind spot. When admins log into Rocky Linux over SSH to check disk space, they often share keys. If someone deletes a repo folder on disk, the team cannot tell who did it. Require unique host accounts for every engineer and send all system logs to a central server.

Locking down network paths and runner jobs

Network scoping is vital when your Git server runs automated build jobs. Build runners execute code from pull requests, which makes them high-risk targets. Never run your build agents on the same Rocky Linux host that stores your core Git repos. A malicious build script could try to read local database files or steal host keys.

Place your build runners on separate virtual machines in an isolated network zone. Set up the Rocky Linux firewall on the main server to block random inbound traffic. Allow only HTTPS and SSH traffic from known developer networks and runner nodes. Lock down the database port so only the Git app itself can talk to it.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Should Gitea use the built-in SSH server or Rocky Linux OpenSSH?

Use the host OpenSSH daemon on Rocky Linux for most production setups. It lets you keep standard host security rules while Gitea still manages repo keys. The built-in SSH server works well only when you run the app inside an isolated container.

How do we back up Gitea data on a Rocky Linux server?

Stop writes or take a consistent snapshot of both the Git repo folders and the database. Do not copy raw database files while the service is running, or you will corrupt data. Store your backups on a separate storage volume away from the main Linux host.

How can we stop build runners from getting too much permission?

Put runners on separate hosts and give them scoped tokens for single repos. Do not let runner machines talk to internal management ports on your main Rocky Linux server. Clear the runner workspace after every job so old secrets do not stay on disk.

The query runs. The emails stay hidden.