Azure Tutorials

Install SQL on Linux VM

One of most interesting things last year was release of MS SQL Server for Linux. Like I said in some of my posts before, I wouldn’t have dreamt of it 5-6 years ago. But things changed very much in last few years and this is another big step Microsoft took toward OpenSource community. In this post I will take you through setting up SQL on Linux VM on Azure. First few steps will be specific to setting up environment in Azure portal but later steps can be used on local server or local VM running Linux. I simply use Azure for setting up new VM as I don’t want to waste resources on my laptop.

So first go to Azure portal and set up your Linux VM. Go to portal, click new, select ‘Compute’ and select ‘Ubuntu Server’.

Select ‘Resource Manager’ and click ‘Create’.

Set up basic parameters and click ‘OK’.

Select size for your VM. I will choose A2_V2 standard.

For optional features, leave everything and default and click ‘OK’.

Wait for validation to pass and click ‘OK’ to start provisioning of your VM.

Before we begin installation of SQL Server, we need to set up NSG to allow traffic over port 1433. Remeber that I’m doing this only for demo as I want to connect to SQL Server from my laptop. Opening port 1433 to public is very bad idea and you shouldn’t do this unless it’s for demo as well.

After package installation is finished, it’s time to run configuration script:

sudo /opt/mssql/bin/sqlservr-setup

In configuration you’ll be asked to accept license terms.

Then you need to enter and confirm password for SA account. Password must be at least 8 characters long and contain 3 out of 4 rules of uppercase, lowercase, digit and special character.

Finally, you we’ll be asked if you want to start SQL Server service and if you want to enable SQL Server to start on boot.

And you’re done. Now go to SSMS and connect to your SQL instance.

You can connect with most of SSMS but you’ll need latest version if you really want to do work here.

And you have MS SQL Server running on Linux VM. Best of all is that it took me 17 minutes to set up everything here. Linux VM on Azure, SQL Server… everything from 0 and after 17 minutes I have fully functional MS SQL Server running on Ubuntu. In one of next posts I’ll write more about where to go from here and what you can do with your SQL instance on Linux.

Related

I’m System Engineer at Authority Partners. I love to test and explore new technologies. Have over 20 active MS certificates such as MCSA for Windows Server and SQL Server, MCSE Private Cloud, Data Platform, Business Intelliegence and Server Infrastracture. Lately most interested in BI and Azure solutions. MCT since 2012. From 2016 MVP for Microsoft Azure.

Post navigation

117 Comments

I just wanted to jot down a message in order to thank you for all of the precious information you are giving on this website. My particularly long internet lookup has at the end been recognized with reliable know-how to share with my great friends. I ‘d state that that most of us website visitors actually are rather endowed to be in a useful network with many brilliant individuals with helpful strategies. I feel truly blessed to have seen your entire webpage and look forward to so many more brilliant times reading here. Thanks a lot once again for everything.

Thank you for making the sincere try to explain this. I think very robust about it and wish to be told more. If it’s OK, as you reach extra extensive wisdom, could you mind adding more posts similar to this one with additional info? It would be extremely helpful and helpful for me and my colleagues.

Somebody essentially assist to make seriously articles I would state. That is the first time I frequented your website page and to this point? I amazed with the research you made to make this actual put up amazing. Great process!