Goal
Set up a personal Gerrit server to practice:
- Jujutsu (jj)
- Gerrit code review
- Stacked reviews
- Git internals
The objective is not merely to have a working server, but to understand
why Gerrit is designed the way it is.
Final Architecture
Internet
│
HTTPS (443)
│
Nginx
│
127.0.0.1:8080
│
Gerrit
│
├── H2 Database
├── Lucene Index
├── Git Repositories
└── SSH (29418)SSH is exposed directly on port 29418.
HTTP is reachable only through Nginx.
Installation Summary
Operating System
- Ubuntu 24.04 LTS
- Java 21
- Git 2.43
Gerrit Version
3.14.1
Configuration Choices
Git Repository Location
Default:
/site/gitWhy?
Keeps the whole Gerrit installation self-contained.
Database
Selected:
H2Why?
- Embedded
- No PostgreSQL setup
- Appropriate for a personal lab
- Easy backup
Search Index
Selected:
LuceneWhy?
- Built into Gerrit
- No Elasticsearch/OpenSearch
- Suitable for small installations
Authentication
Selected:
DEVELOPMENT_BECOME_ANY_ACCOUNTWhy?
Allows quickly becoming any account during experiments.
Excellent for learning.
Not suitable for production.
Signed Push
Selected:
DisabledWhy?
Signed Push authenticates the push operation, not commits.
Rarely used.
Can be explored later.
Verified Label
Selected:
InstalledWhy?
Separates:
- Human review (
Code-Review) - CI result (
Verified)
This resembles a real corporate Gerrit workflow.
SMTP
Selected:
noneWhy?
The server currently has no outbound mail server.
Email notifications can be configured later.
Reverse Proxy
Selected:
YesWhy?
Nginx terminates HTTPS.
Gerrit only listens locally.
HTTP
Selected:
127.0.0.1:8080Why?
Users should never access Gerrit directly.
All traffic passes through Nginx.
SSH
Final configuration:
*:29418Why?
Allows Git/jj clients to push over SSH.
Canonical URL
Selected:
https://gerrit.domain.comWhy?
Stable URL for browser access and future email links.
Internal Repositories
Immediately after installation Gerrit created:
- All-Projects.git
- All-Users.git
These are not ordinary projects.
They contain Gerrit’s own configuration and account data.
This is one of Gerrit’s defining design principles:
Store configuration in Git whenever possible.
Problems Encountered
Administrator creation failed
Cause:
The SSH public key path was incorrect.
Resolution:
Re-ran initialization and skipped importing the SSH key.
SSH listen address
Initially configured as:
127.0.0.1:29418Corrected to:
*:29418Reason:
Remote Git/jj clients must reach Gerrit’s SSH service.
HTTPS
After Gerrit was reachable locally:
- Added Nginx reverse proxy.
- Issued TLS certificate with Certbot.
- Verified access at:
https://gerrit.domain.comKey Takeaways
- Gerrit uses Git internally for much more than source code.
- HTTP should stay behind Nginx.
- SSH is the primary protocol for Git/jj interaction.
- H2 + Lucene is an excellent learning setup.
- Development authentication is ideal for experimentation.
Next Session
- Explore
All-Projects.git - Explore
All-Users.git - Understand Gerrit permissions
- Create the first project
- Upload SSH key
- Push with Git
- Push with Jujutsu
- Explore
Change-Id - Explore
refs/changes/* - Practice stacked reviews