Microsoft SQL Server 2017 on Debian 9

created
( modified )
@nabbisen

Introduction

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” (with VirtualBox).

Tutorial

This post is based on the official guidance.

Requirements

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

Preparation

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 http://ftp.debian.org/debian 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

Installation

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

$ curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
$ curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2017.list | 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

Conclusion

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.

Series

MS SQL Server 2017 on Debian 9
  1. Microsoft SQL Server 2017 on Debian 9
  2. Microsoft SQL Server Client 2017 on Debian 9
  3. sqlcmd failed due to "locale::facet::_S_create_c_locale name not valid"

Comments or feedbacks are welcomed and appreciated.