DEV Community

Cover image for Microsoft SQL Server 2017 on Debian
Heddi Nabbisen
Heddi Nabbisen

Posted on • Updated on

Microsoft SQL Server 2017 on Debian

* The cover image is originally by jarmoluk and edited with great appreciation.


Microsoft SQL Server is one of relational database management systems aka RDBMS.
It is available on Linux since SQL Server 2017 with both installation and Docker image.
This post shows how to install it on Debian 9 "stretch".


This post is based on the official guidance.


2GB RAM is absolutely required in order to run setup script after installing the package.
The others are here.


sudo command is also necessary in running setup script.
Therefore, install it and set it up:

# apt-get install sudo
# visudo

Install other packages necessary as preparation.

$ sudo apt-get install curl

Add dependencies of mssql-server.
First, Install the security package:

$ sudo apt-get install apt-transport-https

Next, install older libssl.
Edit /etc/apt/sources.list to add a line to the bottom like this:

+ deb jessie main

Then install it:

$ sudo apt-get update
$ sudo apt-get install libssl1.0

Moreover, for the sake of apt-key add microsoft.asc:

$ sudo apt-get install gnupg


Here we're ready.
Let's add the repository:

$ curl | sudo apt-key add -
$ curl | sudo tee /etc/apt/sources.list.d/mssql-server.list

Then install it:

$ sudo apt-get update
$ sudo apt-get install mssql-server

Run the setup script:

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

You can follow the installer.
"Express" edition is free to use with limitations.

Finally, restart the service:

$ sudo systemctl restart mssql-server.service


The official guidance shows quickstarts of RHEL 7.3~ / Suse Linux / Ubuntu 16.04.
The tutorial of this post is a subspecies of Ubuntu's.
As I wrote in Introducion, Docker image is also available.

In my early days as an engineer, I didn't imagine SQL Server would become free to use on Linux even with some limitations...🙂

Thank you for your reading.
Happy computing.

Discussion (0)