Would you like to learn how to install SonarQube using Docker on Ubuntu Linux? In this tutorial, we are going to show you all the steps required to perform the SonarQube installation using Docker on a computer running Ubuntu Linux in 5 minutes or less.

• Ubuntu 20.04
• Ubuntu 18.04
• Ubuntu 19.04
• SonarQube 8.4.2

Tutorial SonarQube - Docker Installation

Edit the system configuration file.

Copy to Clipboard

Insert the following lines at the end of this file.

Copy to Clipboard

Enable the system configuration.

Copy to Clipboard

Create a configuration file named 99-sonarqube.conf.

Copy to Clipboard

Here is the file content.

Copy to Clipboard

Reboot the computer.

Copy to Clipboard

Install the Docker service.

Copy to Clipboard

Download the SonarQube Docker image from the online repository.

Copy to Clipboard

List the Docker images installed on your system.

Copy to Clipboard

Here is the command output:

Copy to Clipboard

Create Docker volumes to store the SonarQube persistent data.

Copy to Clipboard

Verify the persistent data directories.

Copy to Clipboard

Optionally, create symbolic links to an easier access location.

Copy to Clipboard

Start a SonarQube container with persistent data storage.

Copy to Clipboard

Here is the command output:

Copy to Clipboard

In our example, the SonarQube image was used to start a new container.

The new container has persistent data storage.

The container ID is 348b4ab00defe8e3621a61e5899d4eb04dd533046fce4cf2c5b0163f0717bd50.

Tutorial Docker - SonarQube installation

Open your browser and enter the IP address of your web server plus :9000

In our example, the following URL was entered in the Browser:

• http://192.168.15.10:9000

The SonarQube dashboard will be presented.

Click on the Login button and use the Sonarqube default username and password.

• Default Username: admin
• Default Password: admin

sonarqube dashboard

Congratulations! You have finished the SonarQube Docker installation.

Tutorial SonarQube - Docker container management

Verify the containers status using the following command:

Copy to Clipboard

Verify the status of a container.

Copy to Clipboard

To stop a container, use the following command:

Copy to Clipboard

To start a container, use the following command:

Copy to Clipboard

To restart a container, use the following command:

Copy to Clipboard

In case of error, use the following command to verify the container logs.

Copy to Clipboard

In our examples, we demonstrated how to manage SonarQube containers.