Analytics cookies only (Google Analytics, PostHog). No ad networks, no cross-site tracking. See our privacy policy.
A server that analyses source code for bugs, vulnerabilities and code smells and applies quality gates; scanners run in your CI and send results to it. The free Community Build is LGPL-3.0 and its bundled analyzers are under the Sonar Source-Available License (SSALv1); the Developer, Enterprise and Data Center editions are commercial. It embeds Elasticsearch, so the host needs raised kernel limits, and upstream asks for 4 GB of RAM to start and recommends 8 GB for production.
Runs on a VPS from $24/mo (Kamatera 8GB, 8 GB RAM) · prices checked Nov 2026
Fits home hardware (2,147 MB measured idle, RAM only): Raspberry Pi 4 (4 GB) (arm64 untested), Raspberry Pi 5 (8 GB) (arm64 untested), Repurposed laptop (8 GB), Intel N100 mini PC (16 GB), AMD Ryzen mini PC (32 GB).
Paid link — we earn a commission if you shop through it.
Run these commands on your server:
# SonarQube Community Build + PostgreSQL — based on SonarSource's sq-with-postgres Compose example, pinned to 26.11.0.134175-community
# Changed from upstream: pinned tags, generated database password, no read-only root filesystem, and the default admin/admin password replaced through the web API
mkdir sonarqube && cd sonarqube
# the embedded Elasticsearch needs at least these host limits; they are only raised if yours are lower (persist any raised value in /etc/sysctl.d/)
[ "$(sysctl -n vm.max_map_count)" -ge 524288 ] || sudo sysctl -w vm.max_map_count=524288
[ "$(sysctl -n fs.file-max)" -ge 131072 ] || sudo sysctl -w fs.file-max=131072
# the password policy wants 12+ characters with upper, lower, digit and special: the Aa1- prefix covers the classes
printf 'DB_PASSWORD=%s\nADMIN_PASSWORD=Aa1-%s\n' "$(openssl rand -hex 16)" "$(openssl rand -hex 16)" > .env
cat > docker-compose.yml <<'EOF'
services:
sonarqube:
image: sonarqube:26.11.0.134175-community
restart: unless-stopped
depends_on:
db:
condition: service_healthy
environment:
SONAR_JDBC_URL: jdbc:postgresql://db:5432/sonar
SONAR_JDBC_USERNAME: sonar
SONAR_JDBC_PASSWORD: ${DB_PASSWORD}
ulimits:
nofile:
soft: 131072
hard: 131072
nproc: 8192
ports:
- "9000:9000"
volumes:
- sonarqube_data:/opt/sonarqube/data
- sonarqube_extensions:/opt/sonarqube/extensions
- sonarqube_logs:/opt/sonarqube/logs
db:
image: postgres:18
restart: unless-stopped
environment:
POSTGRES_USER: sonar
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: sonar
volumes:
- postgresql_data:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -d sonar -U sonar"]
interval: 10s
timeout: 5s
retries: 10
volumes:
sonarqube_data:
sonarqube_extensions:
sonarqube_logs:
postgresql_data:
EOF
docker compose up -d
timeout 600 bash -c 'until curl -s http://localhost:9000/api/system/status | grep -q "\"status\":\"UP\""; do sleep 5; done'
. ./.env
curl -sf -u admin:admin -X POST http://localhost:9000/api/users/change_password --data-urlencode login=admin --data-urlencode previousPassword=admin --data-urlencode "password=$ADMIN_PASSWORD"
# → http://SERVER_IP:9000 — log in as admin with ADMIN_PASSWORD from .envSonarQube Community Build used 2147 MB of RAM at idle on GCP e2-standard-2 · Ubuntu 26.04 LTS · Docker 29.10.1 (first boot, measured Nov 2026). We list a minimum of 4096 MB.
The SonarQube Community Build install snippet is marked verified on Ubuntu 26.04 (Nov 2026).