[{"data":1,"prerenderedAt":178},["ShallowReactive",2],{"seo-verification":3,"blog-self-host-sonarqube-vps-code-quality-ma-en":6,"promo-bar-likely":133},{"google":4,"bing":5},"EycwPY2XMyTkVzas3n1ygeNJFGAH513qrMjfDljzsMQ","",{"key":7,"data":8},"blog-self-host-sonarqube-vps-code-quality-ma-en",{"id":9,"slug":10,"slugs":11,"title":15,"excerpt":16,"readTime":17,"views":18,"isPinned":19,"noindex":19,"publishedAt":20,"updatedAt":21,"category":22,"categories":28,"featuredImage":30,"bgImage":31,"posterImage":32,"relatedSolution":33,"intro":36,"keyPoints":37,"sections":38,"ctaTitle":118,"ctaBody":119,"ctaButton":120,"ctaUrl":121,"relatedPosts":122},581,"self-host-sonarqube-vps-code-quality",{"fr":12,"en":10,"ar":13,"es":14},"self-host-sonarqube-vps","استضافة-sonarqube-على-vps","autoalojar-sonarqube-vps-calidad-codigo","SonarQube on a VPS: self-hosted code quality and security","Install SonarQube Community Build on a VPS with Docker Compose: PostgreSQL, HTTPS behind nginx, an analysis token and a quality gate in your CI.",6,0,false,"2026-11-16T00:00:00+00:00","2026-11-20T14:16:42+00:00",{"id":23,"name":24,"slug":25,"color":26,"icon":27},7,"Self-hosting","self-hosting","bg-indigo-500\u002F10 text-indigo-400","cloud",[29],{"id":23,"name":24,"slug":25,"color":26,"icon":27},null,"\u002Fblog\u002Fcovers\u002Fbg.svg","\u002Fblog\u002Fcovers\u002Fself-host-sonarqube-vps-poster.svg",{"categorySlug":34,"appSlug":35},"development","sonarqube","A human code review sees the intent; it lets the concatenated SQL query, the unused variable or the block copied three times slip through. SonarQube rereads every analysis against thousands of rules and decides with a quality gate: new code passes or it does not. This guide installs the open-source edition, SonarQube Community Build, on a VPS with Docker Compose, replaces the factory password, publishes it over HTTPS behind nginx and connects it to your CI.",[],[39,43,53,80,83,99,103,106,109,112,115],{"type":40,"title":41,"body":42},"h2","What SonarQube does","SonarQube is a static analysis platform: it reads code without running it and flags what is likely to break, leak or be expensive to maintain. Each issue is classified — bug, vulnerability, security hotspot to review, code smell — and links to a documented rule, with a fix example.\n\nThe Community Build edition is published by SonarSource under the LGPL-3.0 licence. It covers about twenty languages, including Java, JavaScript and TypeScript, Python, PHP, C#, Go and Kotlin, as well as infrastructure as code (Terraform, Kubernetes, Dockerfile). It analyses each project's main branch; branch analysis, pull request analysis and the C and C++ languages belong to the commercial editions.",{"type":44,"title":45,"items":46},"ul","What SonarQube gives you",[47,48,49,50,51,52],"**A quality gate** — a clear verdict on every analysis, which your pipeline can wait for before deploying.","**Security in the loop** — injections, plaintext secrets and weak configurations flagged at commit time.","**Explained rules** — every issue carries its rationale and a fix example.","**Tracking over time** — technical debt, duplicated code and test coverage, version after version.","**Your code stays with you** — nothing leaves your VPS, neither the code nor the results.","**A complete API** — projects, tokens, quality gates and webhooks, all scriptable.",{"type":54,"title":55,"headers":56,"rows":59},"comparison","Manual review alone or SonarQube on your VPS",[5,57,58],"Manual review alone","With SonarQube on your VPS",[60,64,68,72,76],[61,62,63],"Repetitive defects","Depends on the reviewer's attention","Caught on every analysis",[65,66,67],"Known flaws","Spotted if someone knows them","Security rules applied everywhere",[69,70,71],"Decision to deploy","Gut feeling","Explicit quality gate",[73,74,75],"Debt over time","General impression","Measurements per version",[77,78,79],"Where the code lives","On your forge","On your forge and your VPS",{"type":40,"title":81,"body":82},"Prepare the server","Plan an Ubuntu 24.04 VPS with at least 4 GB of RAM and 2 vCPUs: SonarQube runs three Java processes — the web server, the compute engine that processes analyses and an embedded Elasticsearch. Install Docker and the Compose plugin.\n\nTwo system settings matter. Elasticsearch wants `vm.max_map_count` set to at least 524288: set it on the host with `sysctl -w vm.max_map_count=524288` and make it permanent in `\u002Fetc\u002Fsysctl.d\u002F99-sonarqube.conf`. And SonarQube refuses to start when less than 10% of the disk is free: keep some headroom.",{"type":84,"title":85,"steps":86},"steps","Install SonarQube with Docker Compose",[87,90,93,96],{"title":88,"body":89},"Prepare the folder and the .env file","The file holds the PostgreSQL database password.\n```bash\nmkdir -p \u002Fopt\u002Fsonarqube && cd \u002Fopt\u002Fsonarqube\ncat > .env \u003C\u003CEOF\nDB_PASSWORD=$(openssl rand -hex 16)\nEOF\nchmod 600 .env\n```",{"title":91,"body":92},"Write the docker-compose.yml file","Two services: PostgreSQL and SonarQube. The port is published on the loopback interface only: nginx alone will face the Internet.\n```yaml\nservices:\n  db:\n    image: postgres:17.12-alpine\n    restart: unless-stopped\n    environment:\n      POSTGRES_DB: sonar\n      POSTGRES_USER: sonar\n      POSTGRES_PASSWORD: \"${DB_PASSWORD}\"\n    volumes:\n      - sonarqube-db:\u002Fvar\u002Flib\u002Fpostgresql\u002Fdata\n\n  sonarqube:\n    image: sonarqube:26.11.0.134175-community\n    restart: unless-stopped\n    depends_on: [db]\n    environment:\n      SONAR_JDBC_URL: \"jdbc:postgresql:\u002F\u002Fdb:5432\u002Fsonar\"\n      SONAR_JDBC_USERNAME: sonar\n      SONAR_JDBC_PASSWORD: \"${DB_PASSWORD}\"\n      SONAR_TELEMETRY_ENABLE: \"false\"\n      SONAR_ES_BOOTSTRAP_CHECKS_DISABLE: \"true\"\n    ulimits:\n      nofile: { soft: 131072, hard: 131072 }\n      nproc: { soft: 8192, hard: 8192 }\n    ports:\n      - \"127.0.0.1:9000:9000\"\n    volumes:\n      - sonarqube-data:\u002Fopt\u002Fsonarqube\u002Fdata\n      - sonarqube-extensions:\u002Fopt\u002Fsonarqube\u002Fextensions\n      - sonarqube-logs:\u002Fopt\u002Fsonarqube\u002Flogs\n\nvolumes:\n  sonarqube-db: {}\n  sonarqube-data: {}\n  sonarqube-extensions: {}\n  sonarqube-logs: {}\n```",{"title":94,"body":95},"Start and check","The first start creates the database schema and the search indexes: allow two to five minutes. The status must reach `UP`.\n```bash\ndocker compose up -d\ndocker compose logs -f sonarqube    # wait for \"SonarQube is operational\"\ncurl -s http:\u002F\u002F127.0.0.1:9000\u002Fapi\u002Fsystem\u002Fstatus\n```",{"title":97,"body":98},"Replace the factory password","The `admin` account is created with the password `admin`. Replace it before publishing the instance. SonarQube requires at least 12 characters with an uppercase letter, a lowercase letter, a digit and a special character.\n```bash\nNEW='\u003Cyour-password>'\ncurl -fsS -u admin:admin -X POST http:\u002F\u002F127.0.0.1:9000\u002Fapi\u002Fusers\u002Fchange_password \\\n  --data-urlencode login=admin --data-urlencode previousPassword=admin \\\n  --data-urlencode \"password=$NEW\"\ncurl -s -u admin:admin http:\u002F\u002F127.0.0.1:9000\u002Fapi\u002Fauthentication\u002Fvalidate   # {\"valid\":false}\n```",{"type":100,"title":101,"body":102},"tip","Never publish an instance on admin\u002Fadmin","As long as the factory password is active, anyone who finds your address becomes administrator and reads all your code. Replace it before opening the reverse proxy, then create one named account per developer under Administration, Security, Users. Login is required by default to see anything: keep that setting on.",{"type":40,"title":104,"body":105},"Publish SonarQube over HTTPS behind nginx","Get a certificate with certbot, then declare a server block that forwards the `X-Forwarded-Proto` header:\n```nginx\nserver {\n    listen 443 ssl;\n    server_name sonarqube.example.com;\n    ssl_certificate     \u002Fetc\u002Fletsencrypt\u002Flive\u002Fsonarqube.example.com\u002Ffullchain.pem;\n    ssl_certificate_key \u002Fetc\u002Fletsencrypt\u002Flive\u002Fsonarqube.example.com\u002Fprivkey.pem;\n    client_max_body_size 50m;\n\n    location \u002F {\n        proxy_pass http:\u002F\u002F127.0.0.1:9000;\n        proxy_set_header Host $host;\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n        proxy_set_header X-Forwarded-Proto https;\n    }\n}\n```\nThen, under Administration, Configuration, General, fill in the server base URL (`https:\u002F\u002Fsonarqube.example.com`): SonarQube writes it into its links, notifications and webhooks.",{"type":40,"title":107,"body":108},"Analyse a first project","Under My Account, Security, generate a token of type Global Analysis Token. From the root of a project, run the official scanner in a container, with nothing to install on your workstation:\n```bash\ndocker run --rm \\\n  -e SONAR_HOST_URL=https:\u002F\u002Fsonarqube.example.com \\\n  -e SONAR_TOKEN=\u003Ctoken> \\\n  -v \"$PWD:\u002Fusr\u002Fsrc\" \\\n  sonarsource\u002Fsonar-scanner-cli \\\n  -Dsonar.projectKey=my-project -Dsonar.sources=.\n```\nThe project appears in SonarQube with its issues, its debt and the quality gate verdict. For a Java project built with Maven or Gradle, use the build plugin instead, which reads the compiled classes.",{"type":40,"title":110,"body":111},"Block a pipeline on the quality gate","Store `SONAR_HOST_URL` and `SONAR_TOKEN` in the repository secrets. With `sonar.qualitygate.wait=true`, the scanner waits for the verdict and fails if the quality gate is red: the deployment step that follows does not run.\n```yaml\n# .github\u002Fworkflows\u002Fsonarqube.yml\nname: sonarqube\non:\n  push:\n    branches: [main]\njobs:\n  analyse:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n        with:\n          fetch-depth: 0\n      - name: Analyse SonarQube\n        run: |\n          docker run --rm -e SONAR_HOST_URL -e SONAR_TOKEN -v \"$PWD:\u002Fusr\u002Fsrc\" \\\n            sonarsource\u002Fsonar-scanner-cli \\\n            -Dsonar.projectKey=${{ github.event.repository.name }} \\\n            -Dsonar.qualitygate.wait=true\n        env:\n          SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}\n          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}\n```\nThe principle is the same on GitLab CI, Jenkins or Woodpecker: one step that runs the scanner with these two variables.",{"type":40,"title":113,"body":114},"Backup and upgrade","Results live in PostgreSQL; added plugins live in the `sonarqube-extensions` volume. The search indexes rebuild themselves at start-up and do not need a backup.\n```bash\ncd \u002Fopt\u002Fsonarqube\ndocker compose exec -T db pg_dump -U sonar sonar | gzip > sonar-$(date +%F).sql.gz\ndocker run --rm -v sonarqube_sonarqube-extensions:\u002Fsrc -v \"$PWD:\u002Fdst\" alpine \\\n  tar czf \u002Fdst\u002Fextensions-$(date +%F).tar.gz -C \u002Fsrc .\n```\nTo upgrade, back up first, change the image tag, then run `docker compose pull && docker compose up -d`. If SonarQube asks for a database migration, open `https:\u002F\u002Fyour-domain\u002Fsetup` and start it.",{"type":40,"title":116,"body":117},"SonarQube in one click on ServOrbit","The ServOrbit Marketplace installs exactly this stack: the official SonarQube Community Build image and PostgreSQL, port published on `127.0.0.1` only, the `admin` account's factory password replaced on first start, server base URL declared and HTTPS configured on your domain or on the VPS's free subdomain. The administrator password is shown in your client area.","Your code analysis on your VPS","A ServOrbit Ubuntu 24.04 VPS with 4 GB of RAM is enough to start with SonarQube. One-click install from the Marketplace, HTTPS on your domain or on the VPS's free subdomain, factory password replaced for you.","Install SonarQube","\u002Fapplications\u002Fdevelopment\u002Fsonarqube",[123,142,160],{"id":124,"slug":125,"slugs":126,"title":130,"excerpt":131,"readTime":23,"views":132,"isPinned":19,"noindex":133,"publishedAt":134,"updatedAt":135,"category":136,"categories":137,"featuredImage":30,"bgImage":31,"posterImage":139,"relatedSolution":140},515,"self-host-jenkins-ci-cd-server-vps",{"fr":127,"en":125,"ar":128,"es":129},"self-host-jenkins-vps","استضافة-jenkins-على-vps-خادم-ci-cd","autoalojar-jenkins-servidor-ci-cd-vps","Jenkins on a VPS: your open-source CI\u002FCD server with Docker","Install Jenkins LTS on a VPS with Docker Compose: Jenkinsfile pipelines, Git webhooks, HTTPS behind nginx and build agents isolated from the controller.",1,true,"2026-10-28T00:00:00+00:00","2026-11-04T16:30:29+00:00",{"id":23,"name":24,"slug":25,"color":26,"icon":27},[138],{"id":23,"name":24,"slug":25,"color":26,"icon":27},"\u002Fblog\u002Fcovers\u002Fself-host-jenkins-vps-poster.svg",{"categorySlug":34,"appSlug":141},"jenkins",{"id":143,"slug":144,"slugs":145,"title":149,"excerpt":150,"readTime":151,"views":132,"isPinned":19,"noindex":19,"publishedAt":152,"updatedAt":153,"category":154,"categories":155,"featuredImage":30,"bgImage":31,"posterImage":157,"relatedSolution":158},74,"host-gitea-on-your-own-vps",{"fr":146,"en":144,"ar":147,"es":148},"heberger-gitea","استضافة-gitea-على-خادم-vps-الخاص-بك","alojar-gitea-en-un-vps","Host Gitea on your own VPS in 2026","Deploy Gitea 1.25 on a VPS with Docker and SSL. Full guide: Gitea Actions CI\u002FCD, Gitea vs Forgejo v16 comparison, daily administration, SSH and HTTPS troubleshooting.",13,"2026-04-07T00:00:00+00:00","2026-11-08T16:32:50+00:00",{"id":23,"name":24,"slug":25,"color":26,"icon":27},[156],{"id":23,"name":24,"slug":25,"color":26,"icon":27},"\u002Fblog\u002Fcovers\u002Fheberger-gitea-poster.svg",{"categorySlug":34,"appSlug":159},"gitea",{"id":161,"slug":162,"slugs":163,"title":167,"excerpt":168,"readTime":17,"views":169,"isPinned":19,"noindex":19,"publishedAt":170,"updatedAt":171,"category":172,"categories":173,"featuredImage":30,"bgImage":31,"posterImage":175,"relatedSolution":176},311,"self-host-onedev-git-cicd-and-kanban-in-one-container",{"fr":164,"en":162,"ar":165,"es":166},"heberger-onedev-vps","onedev-على-vps-git-وcicd-وkanban-في-حاوية-واحدة","onedev-en-vps-git-cicd-y-kanban-autoalojados","Self-Host OneDev: Git, CI\u002FCD and Kanban in One Container","Deploy OneDev on your VPS: private Git forge, visual CI\u002FCD pipelines and Kanban boards. One container, no per-developer billing.",4,"2026-08-28T00:00:00+00:00","2026-11-04T16:30:27+00:00",{"id":23,"name":24,"slug":25,"color":26,"icon":27},[174],{"id":23,"name":24,"slug":25,"color":26,"icon":27},"\u002Fblog\u002Fcovers\u002Fheberger-onedev-vps-poster.svg",{"categorySlug":34,"appSlug":177},"onedev",1795186184753]