---
title: "Deploy SonarQube"
description: "Automatic code review tool that helps you deliver Clean Code."
category: "Automation"
url: https://railway.com/deploy/68DDoI
---

# Deploy SonarQube

Automatic code review tool that helps you deliver Clean Code.

**[Deploy SonarQube on Railway](https://railway.com/template/68DDoI)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/68DDoI/manifest.json

- **Creator:** Mex Delgado
- **Category:** Automation
- **Total deploys:** 94

## Template content

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:latest

### sonarqube:lts-community

- **Image:** sonarqube:lts-community
- **Public domain:** Yes

## Documentation

<div align="center">
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://scm.thm.de/sonar/images/logo.svg">
    <source media="(prefers-color-scheme: light)" srcset="https://cdn.worldvectorlogo.com/logos/sonarqube.svg">
    <img alt="SonarQube: Continuous Code Quality and Security." src="https://cdn.worldvectorlogo.com/logos/sonarqube.svg" height="80">
  </picture>
  <h3>Continuous Code Quality and Security</h3>
  <a href="https://www.sonarsource.com/products/sonarqube/">Website</a> |
  <a href="https://docs.sonarsource.com/sonarqube/latest/">Documentation</a> |
  <a href="https://github.com/SonarSource/sonarqube">GitHub</a>
</div>

**SonarQube** is an open-source platform for continuously inspecting code quality and security. It detects bugs, vulnerabilities, and code smells, providing actionable insights to improve the maintainability and reliability of your codebase.

---

# Deploy and Host

## About Hosting SonarQube

SonarQube is designed to run as a containerized service alongside a PostgreSQL database. It offers a powerful web interface for developers and teams to track code quality metrics over time, integrating seamlessly with popular CI/CD pipelines.

On Railway, you can deploy SonarQube and its PostgreSQL backend without worrying about low-level infrastructure setup. This makes it easy to integrate static code analysis into your workflow and enforce quality gates on pull requests or builds.

---

## Common Use Cases

- **Automated Code Quality Checks in CI/CD**  
  Run SonarQube as part of GitHub Actions, GitLab CI, Jenkins, or other pipelines.

- **Enforce Quality Gates**  
  Prevent code merges or deployments when certain quality or security thresholds are not met.

- **Track and Reduce Technical Debt**  
  Identify and refactor problematic code to improve long-term maintainability.

---

## 🌟 Key Features

### 🛡️ Security and Vulnerability Detection  
Spot known CVEs and unsafe code practices in real time.

### 🧠 Code Smells and Complexity Analysis  
Catch bad practices and overly complex methods before they enter production.

### 📈 Test Coverage and Duplications  
Visualize test coverage and highlight duplicated code across large projects.

### 🧪 Language Coverage  
Supports 30+ languages including JavaScript, TypeScript, Python, Java, Go, C#, and more.

### 📊 Customizable Dashboards and Reports  
Configure views to focus on what's most important for your team or project.

---

## Dependencies for SonarQube Hosting

- PostgreSQL instance (recommended: version 12+)
- Minimum 2GB RAM for SonarQube
- Railway environment with Docker support

---

### Deployment Dependencies

- [SonarQube Docker Image](https://hub.docker.com/_/sonarqube)  
- [PostgreSQL Docker Image](https://hub.docker.com/_/postgres)  
- [SonarQube Docs](https://docs.sonarsource.com/sonarqube/latest/)  
- [SonarQube GitHub](https://github.com/SonarSource/sonarqube)

---

## Default Login

**user:** `admin`  
**password:** `admin`

&gt; It is strongly recommended to change the default credentials on first login.

---

## Why Deploy SonarQube on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying SonarQube on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


## Similar templates

- [N8N Main + Worker](https://railway.com/deploy/n8n-main-worker) — Deploy and Host N8N with Inactive worker.
- [Evolution API with n8n](https://railway.com/deploy/evolution-api-with-n8n) — Automate WhatsApp workflows with Evolution API, n8n, and Postgres.
- [Postgres Backup](https://railway.com/deploy/postgres-s3-backups) — Cron-based PostgreSQL backup to bucket storage

Open this page in a browser: https://railway.com/deploy/68DDoI
