How to Install Microsoft SQL Server 2019 on Ubuntu 19.10

Hello everyone, welcome to Ubuntu Tutorial. In this article, we will learn how to install Microsoft SQL Server on Ubuntu 19.10. As you know, it is now possible to run MS SQL Server 2019 on top of a Linux desktop or server with the help of a Docker container. So basically, we will install Docker on the Ubuntu 19.10 and then configure MS SQL Server on it.

Steps to Install Microsoft SQL Server on Ubuntu 19.10

Step 1. Install Docker

In this step, we are going to install Docker on Ubuntu 19.10. Please follow these steps to install Docker.

  1. Update Ubuntu
  2. Configure Docker repository
  3. Install Docker

Update Ubuntu

It is important to make sure our system is up to date. Execute the following update command in Terminal

sudo apt update && sudo apt upgrade

Configure Docker repository

Now we are going to configure the Docker repository. First, install these packages needed

sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common

Next, install the key

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Add the repository

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu disco stable"

As you notice, we use “disco” in the repository. If we use “eoan” you will get an error message

Err:5 https://download.docker.com/linux/ubuntu eoan Release
404 Not Found [IP: 13.224.253.114 443]

Install Docker

Ok, so now let’s install docker with this command

sudo apt update
sudo apt install docker-ce

In few moments, Docker should be ready. Check if the service running properly with this command

sudo systemctl status docker

Output

Step 2. Run Microsoft SQL Server on Docker

On the previous step, we have successfully installed Docker on Ubuntu 19.10. Now we are going to run a new SQL Server docker container.

Run MS SQL Server 2019 Docker container in Ubuntu 19.10

First, let’s download the 2019-latest image from the official download page

docker pull mcr.microsoft.com/mssql/server:2019-latest

Wait until the download process completes.

Now, let’s start a new container. Please prepare a good password for the “sa” user.

sudo docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=Your.Strong.Password!' -p 1433:1433 -d mcr.microsoft.com/mssql/server:2019-latest

Please change Your.Strong.Password! with your own password but don’t forget that your password must meet the password complexity policy. Otherwise it won’t work. A strong system administrator (SA) password: At least 8 characters including uppercase, lowercase letters, base-10 digits and/or non-alphanumeric symbols.

Now check if the container is up and running

sudo docker ps

Output

Testing the MS SQL Server Container

You can use Microsoft Management Studio to connect to this container. If you are willing to connect through a command line, please visit my previous tutorial below.

That’s it. I hope you enjoy it. See you next time.

1 Comment

Leave a Reply