Is GitBucket still the right choice in 2026?
Three sensible self-hosted Git options exist today:
- Gitea — Go, single binary, tiny footprint, active community. The default "I need a self-hosted Git server" choice.
- Forgejo — a Gitea fork governed by a non-profit; largely interchangeable with Gitea.
- GitBucket — this one. Best if your organization already operates JVM infrastructure (you want the same JMX monitoring, same JVM GC tuning, same deploy story). Also still the only Scala-native option.
If you've never run a JVM service before, start with Gitea. If your shop is already JVM-heavy, GitBucket is pleasant.
Prerequisites
sudo apt update
sudo apt install openjdk-21-jre-headless
java --version # should say 21.x.x
GitBucket supports Java 11+; Java 21 is the current LTS. Headless JRE is enough — we don't need AWT/Swing.
Download the latest release
mkdir -p /opt/gitbucket
cd /opt/gitbucket
GITBUCKET_VER=$(curl -s https://api.github.com/repos/gitbucket/gitbucket/releases/latest | grep -Po '"tag_name":\s*"\K[^"]*')
curl -L -o gitbucket.war "https://github.com/gitbucket/gitbucket/releases/download/${GITBUCKET_VER}/gitbucket.war"
Test it runs:
java -jar gitbucket.war --port=8080
# Open http://your-server:8080 in a browser
# Default login: root / root
# Change the password immediately
Ctrl-C to stop. The home directory defaults to ~/.gitbucket, which is fine for a solo use case. For real deployments, set --gitbucket.home=/var/lib/gitbucket explicitly.
Run as a dedicated user, not root
sudo adduser --system --group --home /var/lib/gitbucket --no-create-home gitbucket
sudo mkdir -p /var/lib/gitbucket
sudo chown gitbucket:gitbucket /var/lib/gitbucket
sudo chown gitbucket:gitbucket /opt/gitbucket/gitbucket.war
systemd service
sudo tee /etc/systemd/system/gitbucket.service <<'EOF'
[Unit]
Description=GitBucket
After=network.target
[Service]
Type=simple
User=gitbucket
Group=gitbucket
WorkingDirectory=/var/lib/gitbucket
Environment="GITBUCKET_HOME=/var/lib/gitbucket"
# Tune the heap to your server; 512M-2G is enough for small teams.
ExecStart=/usr/bin/java -Xmx1g -jar /opt/gitbucket/gitbucket.war --port=8080 --host=127.0.0.1
Restart=on-failure
RestartSec=5
# Security hardening
NoNewPrivileges=true
ProtectSystem=strict
ProtectHome=true
ReadWritePaths=/var/lib/gitbucket
PrivateTmp=true
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable --now gitbucket.service
sudo systemctl status gitbucket.service
Important: note --host=127.0.0.1. We don't expose the JVM HTTP server directly — the reverse proxy in front handles TLS and does the public-facing work.
Reverse proxy with OpenLiteSpeed
This assumes you've already set up an OpenLiteSpeed vhost for gitbucket.yoursite.com and the DNS A-record is pointing at the server. Use the existing Let's Encrypt cert (a wildcard or a multi-SAN cert covering the subdomain).
In WebAdmin, edit the vhost:
- External App → Add. Type: Web Server. Name:
gitbucket. Address:http://127.0.0.1:8080. - Context → Add. Type: Proxy. URI:
/. Web Server:gitbucket. - SSL → point at your certificate / key paths.
- Rewrite → enable, and add the canonical redirect-to-HTTPS rule.
- Graceful restart.
The equivalent for nginx, in case you're on that instead:
server {
server_name gitbucket.yoursite.com;
listen 443 ssl http2;
ssl_certificate /etc/letsencrypt/live/yoursite.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/yoursite.com/privkey.pem;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 0; # no limit on git push size
}
}
server {
listen 80;
server_name gitbucket.yoursite.com;
return 301 https://$host$request_uri;
}
Using a real database
The embedded H2 database is fine for single-user use and up to a few dozen repos. For anything production, move to PostgreSQL or MySQL:
sudo -u gitbucket mkdir -p /var/lib/gitbucket
sudo -u gitbucket nano /var/lib/gitbucket/database.conf
# Contents:
db.url = jdbc:postgresql://localhost:5432/gitbucket
db.user = gitbucket
db.password = REDACTED
Create the database in PostgreSQL (or MySQL) first, with UTF-8 encoding. Restart GitBucket; it migrates the schema automatically on first run.
Backups
Everything important is under /var/lib/gitbucket: the repos live in repositories/, the DB in data/ (for H2) or your separate DB server, and settings in conf/. A nightly tar czf of that directory plus a pg_dump of the DB is sufficient. Ship it off-box with restic or rclone copy to S3 / B2 / Backblaze.