Back to all templates
SonarQube logo

SonarQube

Development2048MB+ RAM

Code quality and security analysis

code-qualitysecurityanalysis

Deploy SonarQube in 3 Steps

1

Connect Your VPS

Add your server credentials to Server Compass

2

Select SonarQube

Choose from our template library

3

Deploy & Configure

Fill in settings and click Deploy

No Docker knowledge required
Step-by-step deployment guide

Deploy SonarQube on a VPS with Server Compass

Use the SonarQube template in Server Compass to deploy a self-hosted code quality and security analysis platform with PostgreSQL on your VPS, then verify the SonarQube login screen in a browser.

About 10 minutesBrowser verified
1
Step 1

Open the server Apps tab

Select the tutorial-vps VPS, open the Apps tab, and start a new app deployment. Keep sensitive server details hidden before capturing or sharing screenshots.

Server Compass Apps tab before creating a SonarQube app
2
Step 2

Choose an app template

Click New App and choose the template deployment path so Server Compass can load the built-in catalog.

Choosing to deploy an app from a Server Compass template
3
Step 3

Search for SonarQube

Use the template picker search to find SonarQube in the Server Compass template catalog.

Searching for SonarQube in the Server Compass template picker
4
Step 4

Select the SonarQube template

Choose the SonarQube template. Server Compass fills the SonarQube service, PostgreSQL service, persistent SonarQube volumes, and the required database password.

SonarQube template selected in Server Compass
5
Step 5

Review the SonarQube settings

Confirm the app name and compose services. In this run, the app was named sonarqube-demo and used host port 9000.

Reviewing SonarQube project settings and compose services
6
Step 6

Deploy SonarQube

Review the generated environment values, keep the database password masked, confirm the web port is available, and click Deploy Now.

Reviewing SonarQube environment variables and port before deployment
7
Step 7

Watch the deployment progress

Keep the deployment modal open while Server Compass uploads the compose file, pulls the SonarQube and PostgreSQL images, starts the containers, and verifies the stack.

Server Compass deploying the SonarQube template on the VPS
8
Step 8

Confirm SonarQube is running

After deployment finishes, return to the Apps tab and confirm the SonarQube app is marked Running with its application URL available.

SonarQube template running in the Server Compass Apps tab
9
Step 9

Open SonarQube in the browser

Click Open Application or open the application URL in a browser. The SonarQube login screen confirms the deployed analysis platform is reachable and ready for final setup.

The deployed SonarQube login screen loaded in a browser

After SonarQube Opens

  • Sign in with the default administrator account and change the password immediately.
  • Store the administrator credentials in a secure password manager.
  • Keep the database password masked in screenshots and docs.
  • Add a domain and HTTPS before inviting users or pushing repositories over the public internet.
  • Configure projects, quality gates, scanners, and CI integration before production use.
  • Back up the SonarQube data, extensions, logs, and PostgreSQL data volumes.

Verified Result

The SonarQube app loaded successfully in a browser and displayed the login screen.

SonarQube deployment questions

What does the SonarQube template deploy?

It deploys the SonarQube Community container with PostgreSQL 16, persistent SonarQube data/logs/extensions volumes, and a persistent database volume.

Which port did the tutorial use?

The tutorial used host port 9000, which maps to the SonarQube web UI on container port 9000.

Why does the browser verification stop at the login screen?

A fresh SonarQube deployment is considered reachable when the login screen loads. The public guide stops before signing in because production credentials and project setup are environment-specific.

Should this become a blog post?

No. The deployment guide should live on the SonarQube template detail page and be linked from the reusable template deployment docs page.

Self-Deploy Guide

DIY SonarQube Deployment

Learn how to self-host SonarQube with this hands-on deployment guide.

1

Open a Terminal Connection

Start by opening a terminal window and connecting to your VPS via SSH.

terminal
# Connect to your VPS
ssh root@your-server-ip

# Or with a specific SSH key
ssh -i ~/.ssh/your-key root@your-server-ip

First time? Docker required! Install it with: curl -fsSL https://get.docker.com | sh

2

Create Application Directory

Create a dedicated space for your application deployment.

terminal
# Create and navigate to project directory
mkdir -p ~/apps/sonarqube
cd ~/apps/sonarqube
3

Create Deployment Configuration

Create a docker-compose.yml file with the following configuration:

docker-compose.yml
services:
  sonarqube:
    image: sonarqube:community
    ports:
      - "9000:9000"
    environment:
      - SONAR_JDBC_URL=jdbc:postgresql://db:5432/sonarqube
      - SONAR_JDBC_USERNAME=sonarqube
      - SONAR_JDBC_PASSWORD=<your-db-password>
    volumes:
      - sonarqube_data:/opt/sonarqube/data
      - sonarqube_logs:/opt/sonarqube/logs
      - sonarqube_extensions:/opt/sonarqube/extensions
    restart: unless-stopped
    depends_on:
      - db

  db:
    image: postgres:16-alpine
    environment:
      - POSTGRES_USER=sonarqube
      - POSTGRES_PASSWORD=<your-db-password>
      - POSTGRES_DB=sonarqube
    volumes:
      - postgres_data:/var/lib/postgresql/data
    restart: unless-stopped

volumes:
  sonarqube_data:
  sonarqube_logs:
  sonarqube_extensions:
  postgres_data:
Setup Variables
PORTHost port(default: 9000)
DB_PASSWORDDB password
4

Launch Your Application

Deploy the stack and monitor the startup process.

terminal
# Spin up containers
docker compose up -d

# Verify deployment
docker compose ps

# Check logs for errors
docker compose logs -f
5

Enable External Access

Set up firewall rules to permit incoming connections.

terminal
# Allow the application port through firewall
sudo ufw allow 9000/tcp
sudo ufw reload

# Access your app at:
# http://your-server-ip:9000
Skip the Terminal

Skip the command line. Deploy visually.

Let Server Compass handle the complexity. Deploy SonarQube with a simple, intuitive interface.

  • Visual config editor
  • Instant deployment
  • Automatic HTTPS
  • Smooth updates
  • Live monitoring
  • Quick rollbacks
Download Server Compass$29 one-time • Lifetime license

After Deployment

After deploying SonarQube with Server Compass, complete these steps to finish setup

1

Set vm.max_map_count on host

2

Log in (admin/admin)

3

Change password

4

Create projects

Need help? Check out our documentation for detailed guides.

SonarQube FAQ

Common questions about self-hosting SonarQube

How do I deploy SonarQube with Server Compass?

Simply download Server Compass, connect to your VPS, and select SonarQube from the templates list. Fill in the required configuration and click Deploy. The entire process takes under 3 minutes.

What are the system requirements for SonarQube?

SonarQube requires a minimum of 2048MB RAM. We recommend a VPS with at least 4096MB RAM for optimal performance. Any modern Linux server with Docker support will work.

Can I migrate my existing SonarQube data?

Yes! Server Compass provides volume mapping that allows you to import existing data. You can also use standard SonarQube backup and restore procedures.

How do I update SonarQube to the latest version?

Server Compass makes updates easy. Simply click the Update button in your deployment dashboard, and the latest SonarQube image will be pulled and deployed with zero downtime.

Is SonarQube free to self-host?

SonarQube is open-source software. You only pay for your VPS hosting (typically $5-20/month) and optionally Server Compass ($29 one-time). No subscription fees or per-seat pricing.

Ready to Self-Host SonarQube?

Download Server Compass and deploy SonarQube to your VPS in under 3 minutes. No Docker expertise required.

Download Server Compass