The Simplest Way to Make Gerrit and Ubuntu Work Like They Should
Running gerrit and ubuntu together gives your team a fast, safe code review host. Ubuntu runs the base system, while Gerrit checks every code change before it merges. This pairing lets engineers push code, run automated tests, and approve changes in one place. Still, setting up both tools takes clear rules for users, keys, and disk space. When teams skip these rules, access drifts and host disks fill up fast. A clean setup keeps your code history safe and your Linux host easy to run. How gerr
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 gerrit and ubuntu together gives your team a fast, safe code review host. Ubuntu runs the base system, while Gerrit checks every code change before it merges.
This pairing lets engineers push code, run automated tests, and approve changes in one place. Still, setting up both tools takes clear rules for users, keys, and disk space. When teams skip these rules, access drifts and host disks fill up fast. A clean setup keeps your code history safe and your Linux host easy to run.
How gerrit and ubuntu share users, keys, and data
Gerrit runs as a Java service on top of an Ubuntu host. Ubuntu manages the network ports, local disks, and system users for the whole machine. You should create a single dedicated Linux user just to run the Gerrit service. That user owns the Git files and the local review data on the disk.
Developers do not log in to the Ubuntu host shell to review code. Instead, they log in to the Gerrit web app or push code over SSH. Gerrit runs its own internal SSH server on a separate port from Ubuntu. When a user pushes a change, Gerrit checks their SSH public key and project role.
If the user has the right role, Gerrit writes the new Git objects to Ubuntu storage. Next, Gerrit sends events to build bots so they can test the new change. Ubuntu handles the disk writes and network traffic, while Gerrit controls every repo rule.
Common failure modes and how to scope host roles
Many teams make mistakes when they set up host access and bot accounts. The biggest risk is sharing one Linux root account across the whole engineering team. When everyone uses the same Ubuntu login, you cannot tell who changed a system file. Someone might edit a repo on disk and bypass the Gerrit review check.
Broad bot tokens are another common failure mode in this setup. Build bots need to read code and post test scores back to Gerrit. Teams often give these bots full admin rights across all Gerrit projects by mistake. If a build server leaks its SSH key, an attacker can rewrite your main branches.
End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Unlogged host commands also create blind spots during security audits. If an admin fixes a broken Git repo on Ubuntu, standard logs miss the details. You can fix these gaps by separating code review access from host shell access. Keep developers inside Gerrit and block direct SSH to the Ubuntu system port.
Give each build bot a narrow role that only scores specific project branches. Set up firewall rules on Ubuntu so only trusted networks reach the host ports. Rotate SSH keys and HTTP tokens on a strict schedule for every user and bot.
Keeping repo storage and host updates clean
Git repos grow fast when large teams push code all day. If the Ubuntu disk fills up, Gerrit stops taking new changes and crashes. Put the Git repo folder on its own disk volume so system logs stay safe. Run regular Git cleanup tasks to pack loose files and keep read times fast.
You also need a clear plan for Java and Ubuntu security updates. Match your Java version on Ubuntu to the exact release your Gerrit version needs. Pin that Java package so an automated Ubuntu update does not break the review app. Test host updates in a staging setup before you touch your main code server.
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
Do developers need Linux user accounts on the Ubuntu host?
No, developers only need accounts inside the Gerrit app to push and review code. Only system admins who maintain the server need shell access to Ubuntu.
How do we stop build bots from merging code on their own?
Create a dedicated bot group in Gerrit with rights to vote on test labels only. Never add build bots to admin groups or let them push directly to main branches.
Why did an Ubuntu system update stop our Gerrit service?
Unattended Ubuntu updates can upgrade the local Java runtime to an unsupported version. Lock your Java package version on Ubuntu so system patches do not break Gerrit.
Related guides
In this post