Install SQL Server on Ubuntu (Step-By-Step)

Installing SQL Server on Linux was a great experience for me, that I would like to share with you the challenges and some of the scripts. Hope you enjoy reading this blog post and it is informative for you.

Before we start, we do need to install the Ubuntu Server 16.04 version on either physical machine or virtual. I used Hyper-V to host the Linux OS but I found that VirtualBox works much better and smooth with Linux OS. So I suggest you to use VirtualBox to install SQL Server on Ubuntu.

[plain]I assume that you already installed Ubuntu Server 16.04 already.[/plain]

[plain]The Ubuntu Server needs to have internet connection all the time during installation.[/plain]


Step 1: Enter sudo command to change the current user to SuperUser and install the Microsoft GPG Keys into the Ubuntu by the following script:


curl | apt-key add



Step 2: Register SQL Server repository into the Ubuntu by the following script.

[plain]curl > /etc/apt/sources.list.d/mssql-server.list[/plain]


Step 3: Now its time to install SQL Server by using the following script. In some cases the following script does not run and throws an error regarding another process is using the path or variable, which you need to restart the Ubuntu.


sudo apt-get update /*It updates the Microsoft SQL Server repository list, that imported into Ubuntu in the previous step.*/
sudo apt-get install mssql-server



As you see in the above output, it mentions that repository cannot be authenticated. You may ignore this error message.


Now, the SQL Server installation is done!


Step 4: Run the following script to configure the SQL Server instance in Ubuntu.

[plain]sudo /opt/mssql/bin/sqlservr-setup[/plain]



Step 1: Register the Microsoft SQL Server repository in Ubuntu by the following script.

[plain]curl > /etc/apt/sources.list.d/msprod.list[/plain]


Step 2: Run the following script to install the Microsoft SQL Server Tools in Ubuntu.


sudo apt-get update /*It updates the Microsoft SQL Server repository list, that imported into Ubuntu in the previous step.*/
sudo apt-get install mssql-tools



Step 3: Once the packages are downloaded and installed, you are required to accept the license terms and conditions through the following prompt message boxes.



MSSQL-SERVER Service Verification

Now its time to verify, whether the SQL Server instance is running properly on Ubuntu or not, You may use the following script to verify the service.

[plain]systemctl status mssql-server[/plain]


Connecting to SQL Server

We are only able to connect to SQL Server instance in Ubuntu through SQLCMD tool, and you can able to connect to the database engine through SQL Server Management Studio on Windows platform.



Share This Story

Share on facebook
Share on twitter
Share on linkedin
Share on whatsapp

Share Your Comments

About The Author

Search Articles


Follow Fard Solutions

Share Your Comments

Fard Solutions Sdn. Bhd. Company was established in 2012 in Kuala Lumpur. We are engaged in development, implementation, integration and maintenance of the most advanced database solutions and IT research & development (innovation).

(+60) 03 8994 6788

Fard Technology Corp.
700-1199 West Hastings Street,
Vancouver, British Colombia,
V6E 3T5 Canada.

Fard Solutions Sdn. Bhd.
1-1C & 1-2C Incubator 1,
Technology Park Malaysia,
Bukit Jalil, 57000
Kuala Lumpur, Malaysia.

  • Copyrights © 2020 Fard Solutions Sdn. Bhd. , All rights reserved.
  • Privacy Policy
  • Terms of Service
  • A Project By Website Artisan