• Skip to primary navigation
  • Skip to main content
  • Skip to footer

Miguel Ángel Antolín Bermúdez

Personal portfolio & Blog

  • Home
  • Blog & posts
You are here: Home / Engineering / how to / Raspberry Pi / Bitbucket server on Raspberry Pi

DevOps, Engineering, how to, Raspberry Pi, Self-hosting, Software engineering / 20th September 2017

Bitbucket server on Raspberry Pi

Self-hosting a Git server gives you full control over your source code — no third-party access, no storage limits, no subscription fees. Bitbucket Server (now Bitbucket Data Center) is a mature option, and while running it on a Raspberry Pi 2 is not a high-performance setup, it works well for personal projects and small teams. This post covers overclocking the Pi for the extra JVM headroom, installing Bitbucket Server, and backing it with PostgreSQL.

Note: Atlassian discontinued Bitbucket Server in favour of Bitbucket Data Center. If setting this up fresh today, consider Gitea — a lightweight Git server purpose-built for low-resource environments that runs excellently on a Raspberry Pi.

Step 1 — Overclock the Pi

Bitbucket Server is a Java application. JVM startup alone stresses a stock Pi 2, so a modest overclock helps:

sudo nano /boot/config.txt
hdmi_force_hotplug=1
force_turbo=1
boot_delay=1
arm_freq=1000
core_freq=500
sdram_freq=500
over_voltage=2
gpu_mem=16

gpu_mem=16 frees as much RAM as possible for the JVM. hdmi_force_hotplug=1 prevents a known issue where removing HDMI could cause SD card data loss. Reboot after saving.

Step 2 — Download and install Bitbucket Server

Check your Git version — Bitbucket Server 4.14.9 requires Git 2.11.x or below:

git --version

Download and run the binary installer from Atlassian’s archive:

wget https://www.atlassian.com/software/stash/downloads/binary/atlassian-bitbucket-4.14.9-x64.bin
sudo chmod a+x atlassian-bitbucket-4.14.9-x64.bin
sudo ./atlassian-bitbucket-4.14.9-x64.bin

Run as root so it can register the service to start on boot. Follow the on-screen prompts. The default port is 7990.

Step 3 — Install PostgreSQL and create the database

sudo apt-get install postgresql
sudo -i -u postgres
psql
CREATE ROLE bitbucketuser WITH LOGIN PASSWORD 'your_secure_password' VALID UNTIL 'infinity';
CREATE DATABASE bitbucket WITH ENCODING='UTF8' OWNER=bitbucketuser CONNECTION LIMIT=-1;
\q
exit

Step 4 — Finish setup and tune the JVM

Reboot, then navigate to http://<your-pi-ip>:7990. The setup wizard guides you through connecting to PostgreSQL and creating an admin account.

Once running, tune the JVM heap to fit within the Pi 2’s ~1 GB RAM:

sudo nano /opt/atlassian/bitbucket/4.14.9/bin/setenv.sh
JVM_MINIMUM_MEMORY="256m"
JVM_MAXIMUM_MEMORY="512m"

Restart the Bitbucket service. With these settings the server should be responsive for everyday personal use. More Raspberry Pi tutorials on the blog.

Filed Under: DevOps, Engineering, how to, Raspberry Pi, Self-hosting, Software engineering Tagged With: Atlassian, Bitbucket, bitbucket,git,self-hosting,raspberry-pi,atlassian,postgresql,repositories, Git, Overclock, PostgreSQL, Raspberry Pi, Repositories, Server

Footer

Find me at

  • GitHub
  • LinkedIn

Recent Posts

  • Git for solo developers: the workflow that actually works
  • Self-hosting Vaultwarden on a VPS: your own Bitwarden server
  • Docker on a Raspberry Pi: running containers on ARM
  • WireGuard VPN on a Raspberry Pi: replace OpenVPN in 15 minutes
  • Claude Code on Mac: the complete setup guide

© 2026 · Made with ❤️ in Seville