October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

How to Self-Host Gerrit Code Review on an Ubuntu VPS

A production-focused guide to installing Gerrit on Ubuntu, binding it privately, configuring a reverse proxy with HTTPS, onboarding authenticated users, and backing up repositories, NoteDb metadata, configuration, and plugins.
Length11 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Self-hosting Gerrit on an Ubuntu VPS means installing Gerrit’s server software in a persistent site directory, keeping its listener private, and publishing it through a reverse proxy that terminates HTTPS. For the release line covered by the current standalone installation guide, the host must provide JRE 21. A production setup should use production authentication, a dedicated service identity, monitored storage, and tested off-site backups—not the quickstart’s development mode.

What self-hosting Gerrit involves

With a self-hosted deployment, you control the Ubuntu operating system, VPS firewall, DNS name, Gerrit site directory, authentication integration, upgrades, logs, and recovery process. Gerrit is not merely a command-line Git helper: it is a long-running web application that stores repositories, code-review metadata, configuration, plugins, and indexes.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

This guide assumes one Ubuntu VPS and a domain name that you control. It does not cover a hosted Git service, a multi-node high-availability design, or a specific VPS provider. Those alternatives change the networking, storage, and failure-recovery decisions.

Choose the architecture before installing

The safest simple topology is:

Internet
   |
DNS name (for example, review.example.net)
   |
Nginx or Apache: public ports 80/443, TLS termination
   |
Gerrit: loopback proxy-http or proxy-https listener
   |
Site directory: repositories, NoteDb metadata, configuration, plugins

Gerrit’s configuration reference strongly encourages a reverse proxy for externally facing production sites so that SSL/TLS is handled at the proxy and Gerrit uses a proxy-https:// listener scheme. The proxy becomes the only publicly reachable HTTP endpoint. Gerrit itself should listen on a loopback address when the proxy is on the same VPS.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.

A direct Gerrit HTTPS listener can be useful for a private lab, but it gives you a different certificate, header, logging, and renewal workflow. For a public VPS, reverse-proxy TLS is the easier boundary to audit and restrict.

Prepare the Ubuntu VPS

Use a hostname and a dedicated administrative account

Point a DNS record at the VPS before requesting a certificate. Use a dedicated administrator account with sudo rather than performing routine work as root. Create a separate service identity for Gerrit and keep the site directory owned by that identity. The exact account and service-supervision method are operational choices; validate them on the Ubuntu version you deploy.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install the required Java runtime

The official standalone installation guide states: “To run the Gerrit service, the following requirement must be met on the host: JRE, version 21.” Install a Java 21 runtime that is supported by the Gerrit release you selected, then verify the runtime before initialization:

java -version

Do not assume that an older system Java or a newer, unlisted runtime is interchangeable. Gerrit releases can change their supported Java versions, so check the installation guide for the exact release you download.

Size from workload, not a universal minimum

The authoritative installation pages do not publish a universal CPU, RAM, disk, or concurrent-user minimum for an Ubuntu VPS deployment. Start with the workload you actually expect: repository count, total history, large binaries, indexing activity, and the number of simultaneous reviewers. Leave room for operating-system overhead, temporary files, upgrades, and backup staging. Monitor memory pressure, CPU saturation, disk latency, repository growth, and log volume after launch, then resize the VPS when measurements show a constraint.

Limit the network surface

Allow administration only from the networks you need. The public web service should ultimately expose the reverse proxy on ports 80 and 443; the Gerrit backend port should be reachable only through loopback or a tightly restricted private network. Do not expose an unrestricted proxy-http or proxy-https listener to the Internet: Gerrit warns that untrusted clients could spoof forwarded headers.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed

Download and initialize Gerrit

1. Select a release and persistent site directory

Download the desired current WAR from the Gerrit releases site. Keep the downloaded file outside the runtime data directory, and choose a site directory on persistent storage—for example, a directory dedicated to Gerrit rather than a temporary home directory. The site directory becomes the recovery unit you will back up.

2. Run initialization as the service identity

Initialize the site with the documented java -jar ... init workflow. A quickstart form looks like this:

export GERRIT_SITE=/srv/gerrit
authentication-command java -jar gerrit-version.war init --batch --dev -d "$GERRIT_SITE"

The command demonstrates the shape of initialization, but the quickstart explicitly labels its --dev authentication mode for demonstration. Do not carry that mode into a public installation. During production initialization, select an authentication method appropriate for your organization and complete its identity setup before inviting collaborators.

3. Keep production configuration deliberate

Review every initialization choice rather than accepting a tutorial’s defaults. Confirm the site directory, authentication backend, listener URL, administrator identity, and any plugin installation. Run the service under the dedicated Gerrit account, not under a personal login. Arrange supervised startup using the service-management practice you already operate on Ubuntu, and test a clean stop and start before opening the firewall.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

4. Record the release and local changes

Write down the WAR version, Java version, initialization options, installed plugins, DNS name, proxy configuration, and backup destination. This small change record prevents an emergency restore from becoming a memory exercise and gives you a baseline for future upgrades.

Bind Gerrit to a private listener

When Nginx or Apache runs on the same VPS, bind Gerrit to a loopback address such as 127.0.0.1. The quickstart recommends changing a wildcard listener to localhost for this reason. In the Gerrit configuration, set httpd.listenUrl to a proxy scheme and private port, for example:

Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)
httpd.listenUrl = proxy-https://127.0.0.1:8081

Use proxy-http:// when the proxy-to-Gerrit hop is plain HTTP and proxy-https:// when that hop is HTTPS. In the common same-host design, TLS terminates at the reverse proxy and Gerrit receives the proxy protocol on loopback. Keep the port and scheme consistent with the proxy configuration.

The proxy listener mode trusts headers such as the original host and client address. Therefore, only the trusted reverse proxy should be able to connect to that listener. If you bind it to a public interface, an attacker can send forged forwarded headers and undermine URL generation, audit information, or access controls.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Put Nginx or Apache in front and enable HTTPS

Match the public path exactly

Gerrit’s reverse-proxy guidance requires the proxy path to match Gerrit’s listenUrl. Decide whether Gerrit is served at the domain root, such as https://review.example.net/, or beneath a deliberate path. Then use the same mapping at both layers. A path mismatch causes broken redirects, missing assets, failed API calls, or unusable encoded Git paths.

Be especially careful with Nginx’s proxy_pass: adding a URI suffix can rewrite the path. Do not add a suffix unless you intentionally designed and tested that rewrite. Preserve the path that Gerrit expects, including encoded characters used by repository and change URLs.

Preserve host and client-IP headers

The proxy must preserve the public Host value so Gerrit generates links for the real domain rather than its loopback address. Forward the client IP in X-Forwarded-For and configure the proxy as the only trusted source of that header. Keep the forwarding behavior consistent across HTTP-to-HTTPS redirects, web requests, and Git traffic.

Nginx and Apache are both valid choices

Decision axis Nginx Apache
TLS termination Terminates public HTTPS and forwards to Gerrit. Terminates public HTTPS and forwards to Gerrit.
Header behavior Set and preserve the public host and forwarded-client-IP headers explicitly. Set and preserve the same headers using the equivalent proxy directives.
Path handling Be cautious with proxy_pass URI rewriting. Keep the proxied path aligned with Gerrit’s configured listener path.
Logging Use access and error logs alongside Gerrit logs. Use the web-server logs alongside Gerrit logs.
Operational fit Choose it if your team already operates Nginx. Choose it if your team already operates Apache.

Neither proxy is inherently required. Familiarity, existing certificate automation, logging standards, and the ability to test path and header behavior are better selection criteria than brand preference.

Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC

Terminate TLS at the proxy

Obtain a certificate for the public hostname, configure the proxy to listen on HTTPS, and redirect plain HTTP to HTTPS if you retain port 80 for certificate issuance or redirects. The proxy then forwards requests to the private Gerrit listener using the matching proxy-http or proxy-https scheme. Renew the certificate before expiry and test renewal without interrupting the backend.

After enabling HTTPS, test the browser interface, a clone, an authenticated fetch, a push, redirects, and a repository or change URL containing encoded characters. A page that loads is not enough: Git transport and review actions exercise different proxy paths.

Configure collaborator access before accepting pushes

Gerrit supports authenticated uploads over SSH and HTTP/HTTPS. Users must have authentication configured before they can push; anonymous access to the web page does not provide push authorization.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

SSH access

  1. Have each collaborator create an SSH key pair on their workstation and protect the private key.
  2. Register the public key in the user identity system configured during Gerrit initialization.
  3. Give the collaborator the Gerrit SSH hostname, port, and repository URL format used by your deployment.
  4. Test an authenticated read first, then a push to a permitted review branch or change reference.

Use separate keys for automation where practical, document ownership, and revoke keys when people or systems no longer need access.

HTTP or HTTPS access

HTTP/HTTPS uploads require the authentication and credential mechanism selected for the installation. Configure the user’s credential according to that identity backend, store it in an approved credential helper rather than shell history, and test a clone followed by a push. Do not paste long-lived secrets into scripts or URLs.

Grant the minimum useful permissions

Create projects and groups deliberately. Start collaborators with the permissions needed to read repositories and submit changes, then add review, merge, or administrative rights only when their role requires them. Validate permissions with a test account before onboarding a larger team.

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Back up Gerrit before inviting users

A useful backup is more than a copy of bare Git objects. Gerrit’s repositories contain code and modern NoteDb review metadata, so a recovery set must preserve both. Include configuration, secrets, plugins, and any required data directories.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Data Why it matters Recovery treatment
Git repositories Contain source history and modern review metadata stored with the repository. Back up consistently with the site snapshot.
etc configuration and secrets Defines listeners, authentication, storage, and credentials needed to restart the site. Encrypt and restrict access; do not store publicly.
Installed plugins May provide authentication, workflow, or integration behavior not present in core Gerrit. Archive exact plugin versions with the backup.
Other required data directories May be necessary for the selected deployment and integrations. Identify them in your restore runbook and include them.
Search indexes and caches Usually rebuildable, but retaining them can shorten recovery. Optional to retain when storage and consistency allow.

Take a consistent snapshot

Use a filesystem snapshot or an equivalent consistency method so repositories and configuration represent one coherent point in time. A file-by-file copy taken while writes are active can produce an unusable mixture of versions. Quiesce or coordinate the application according to the backup method you choose, capture the site data, and record the snapshot timestamp and Gerrit version.

Store the archive away from the VPS

Archive the consistent snapshot to storage separate from the VPS. A second disk attached to the same virtual machine does not protect against account loss, disk failure, or provider outage. Encrypt sensitive data, restrict backup credentials, retain multiple generations, and define how long each generation remains available.

Test a restore

Restore into an isolated Ubuntu environment, install the matching Java runtime, recover the site directory, and start Gerrit without exposing it publicly. Confirm that repositories, review discussions, accounts, plugins, configuration, and proxy integration behave as expected. Record the elapsed recovery time and update the runbook when the test reveals a missing file or undocumented step.

Operate and update the VPS

Monitor the parts that grow

  • Track disk usage for repositories, logs, temporary files, and backup staging.
  • Watch memory, CPU, and disk latency during indexing and busy review periods.
  • Review reverse-proxy and Gerrit logs for authentication failures, upstream errors, and unexpected paths.
  • Alert before certificates expire and before free disk space becomes a deployment risk.

Use a change window for upgrades

Before upgrading Gerrit or Java, verify support for the target versions, take a tested backup, record installed plugins, and announce a maintenance window. Upgrade first in an isolated copy when possible. After the change, test login, repository browsing, clone, fetch, push, review creation, merge permissions, and any external integrations.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keep the backend private

Recheck firewall rules after every proxy or VPS change. The only public route should be the intended HTTPS endpoint; the backend listener should remain loopback-only or restricted to the trusted proxy network. If a troubleshooting session temporarily exposes a port, remove that rule immediately after testing.

Deployment choices and their trade-offs

Choice Strength Cost or risk Best fit
Direct Gerrit HTTPS Fewer moving parts. Gerrit owns public TLS, headers, logging, and renewal. Private experiments or environments where a proxy is already unnecessary.
Reverse proxy with Nginx Centralized TLS and familiar high-performance proxying. Requires exact path and header configuration. Teams already operating Nginx.
Reverse proxy with Apache Centralized TLS with Apache’s established proxy and logging modules. Requires equivalent path and header discipline. Teams already operating Apache.
SSH uploads Strong key-based workflow and convenient Git transport. Keys must be registered, protected, and revoked. Developers and automation comfortable with SSH.
HTTP/HTTPS uploads Works through standard web transport and credential systems. Credentials require secure storage and careful rotation. Networks or tools where SSH is unavailable.
Local snapshots only Fast and simple restores on the same VPS. Does not survive VPS loss or provider failure. Short-lived staging data, never the only production copy.
Off-site archived snapshots Protects against loss of the VPS and enables disaster recovery. Storage, encryption, retention, and restore testing add operational work. Any repository whose history and reviews matter.
Single VPS Lowest complexity and cost. One host is a failure domain. Small teams that accept planned downtime and maintain tested backups.
Redundant architecture Can reduce downtime and isolate failures. Requires more infrastructure, coordination, and operational expertise. Organizations with availability requirements beyond one host.

Go-live checklist

  • DNS points to the VPS and the selected certificate covers the public hostname.
  • JRE 21 is installed for the documented Gerrit release line.
  • Gerrit runs under a dedicated service identity in a persistent site directory.
  • Production authentication is configured; development authentication is not used publicly.
  • httpd.listenUrl uses the intended proxy-http or proxy-https scheme and a private address.
  • The reverse proxy preserves Host, forwards the client IP, and matches Gerrit’s path exactly.
  • The backend port is not exposed to untrusted clients.
  • SSH or HTTP/HTTPS authentication has been tested with a non-administrator account.
  • Repositories, NoteDb metadata, configuration, secrets, plugins, and required data directories are in the backup scope.
  • A consistent snapshot is archived off the VPS and a restore has been demonstrated.
  • Monitoring covers disk growth, logs, certificate expiry, and service availability.

Conclusion

A dependable Ubuntu VPS deployment keeps Gerrit private behind a correctly configured HTTPS reverse proxy, uses the Java version required by the selected release, enables real authentication instead of quickstart development mode, and treats repositories plus review metadata as recoverable production data. The VPS is only the starting point: exact path and header handling, least-privilege access, monitored upgrades, and an off-site restore-tested backup determine whether the installation remains usable when the first failure or upgrade arrives.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.