How to Install MS SQL Server 2019 on Ubuntu 20.04 Using Docker

Want to build your own SQL Server with Ubuntu 20.04? Well, you got covered and you came to the right place. In this article, you will learn how to install Microsoft SQL Server 2019 on Ubuntu 20.04 using Docker. I hope you already understood what Docker is and if you don’t, you can visit this website to learn more about Docker. Long story short, Docker offers an easier way to run applications such as SQL Server on Linux or other Operating systems.

There are several things we need to prepare before installing SQL Server on Ubuntu 20.04. First of all, you must have a running Ubuntu desktop or server edition. You may download Ubuntu 20.04 using the link below.

https://ubuntu.com/download/desktop

Steps to Install Microsoft SQL Server 2019 on Ubuntu 20.04 Using Docker

Step 1. Install Docker on Ubuntu 20.04

First, we need Docker to be installed on Ubuntu. Please read the following article to install Docker on Ubuntu 20.04. Make sure Docker is up and running on your system before continuing to the next steps.

Step 2. Download Microsoft SQL Server 2019 Docker Image

Open Terminal or connect to your Ubuntu via SSH if you are connecting from another computer. For example, I am connecting to my Ubuntu server (192.168.100.60) from my Hackintosh PC.

ssh dhani@192.168.100.60

Now, copy and paste this line to download the SQL Server 2019 docker image from the internet.

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

Let’s confirm if the image is downloaded

docker images

You should see mcr.microsoft.com/mssql/server as shown below.

Done.

Step 3. Create a new SQL Server Container

Now we are ready to deploy our Docker container. Use this command to create/run a new container. Please modify the password for the SA user.

docker run --restart always -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=YourStrong.P@ssword' -p 1433:1433 -d mcr.microsoft.com/mssql/server:2019-latest

Now check if the new container is up and running with this command

docker ps

You should see something like this

At this point, we have successfully installed and running Microsoft SQL Server 2019 on Ubuntu 20.04 using Docker. Now you can use any SQL Server management software such as SQL Server Management Studio or use Navicat Premium to manage the SQL Server.

Be the first to comment

Leave a Reply