How To Install MSSQL on Ubuntu 16.04

Pre Requisites

My environment setup

For this installation I used virtual box. It is best to use virtual box if you are first time user or testing this for the first time. I am assuming you already know how to setup virtual box. If not and need help, leave me an email.

There are few advantages of using virtual box. One you can take snapshots and restore back to snapshot in case you mess things up. I like to make a mess (that is how I learn). Second, you can start fresh if needed, while keeping your main machine clean, unless you have a test machine.

Thanks to Jeremy Morgan’s YouTube tutorial, it was helpful for me. Most of the steps are similar with added steps and changed URL to point to newer link. Here is the link to video for reference

Note: Use suggestions at your own risk. These are the steps I used that worked for me and put together after searching on google.

Installation Steps

Open Terminal in Ubuntu and run following command

sudo apt-get update

If you do not have CURL installed, you will need it to be installed. Usually it is not present in fresh Ubuntu install. Run below command to install CURL

sudo apt-get install curl

Now we will import public libraries GPG Keys

curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -

Register SQL repository (this is one line do not press enter while typing this command).

You can change the URL as needed. I am using mssql-server-2017. If you want to install preview only use alternate url

For MSSQL-Server-2017 use

curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2017.list | sudo tee /etc/apt/sources.list.d/mssql-server.list

For MSSQL-Server-2017-Preview use

curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-preview.list | sudo tee /etc/apt/sources.list.d/mssql-server.list

You are almost done…… now we need to run updates and install mssql server. Run below commands in order

sudo apt-get update

sudo apt-get install -y mssql-server

If you had success in step 5 , we will now configure sqlserver. This is a quick setup to get it up and running and is crucial step. Run below command.

sudo /opt/mssql/bin/mssql-conf setup

You will be asked to select type of edition you want to use. Note that there are three free versions.

Evaluation (only for 180 days), Developer and Express (free). Select the version you want to try. I am using Developer version.

This is the last step. Once you have selected appropriate version you will be asked to accept terms and then select password. You can’t select a easy password, it will prompt you to select a strong password. So make sure to have a good password enough to pass the check.

Check if your MSSQL server is up and running…it may take sometime for service to kick in so give it at least 2 minutes. Run below command to confirm server is running.

systemctl status mssql-server

That’s IT YOU ARE DONE !

Originally published at https://sanchitwadhwa.com.

--

--

--

I help solve data problems |Need help ? email me > imsunchip@gmail.com | website > sanchitwadhwa.com | ❤ Books, music, dance, food, podcasts, soccer, writing

Love podcasts or audiobooks? Learn on the go with our new app.

How to reset windows 10 password if you forgot it.

Blog 7: The End is Near

Date Command in Linux

Instruction: How to borrow mBTM on ForTube (Matic Mainnet)

How to enhance Azure Security knowledge and Pass Azure Security Engineer Exam(AZ-500)

The Good, the Bad and the Ugly with DNS wildcard entries… and Kubernetes

Simple Enum Factory for running Jobs/Tasks in Java

Under the Hood: Modifying AddLinesVC to allow for wildcards in all procedures

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sanchit Wadhwa

Sanchit Wadhwa

I help solve data problems |Need help ? email me > imsunchip@gmail.com | website > sanchitwadhwa.com | ❤ Books, music, dance, food, podcasts, soccer, writing

More from Medium

ALL ABOUT EMBEDDED AND DYNAMIC SQL

Somewhat complex reporting and data analysis in MySql 8 — Part 1

SQL Dialects PostgresSQL vs MySQL

SQL Server checklist for better performance