How to Install SQL Server on Fedora 39 Using Docker

In the previous article, we learned how to install Docker on Fedora 39. Now, we are going to install Microsoft SQL Server on Fedora 39 using Docker. SQL Server is a powerful RDBMS database that can be used to store spatial data for our GIS. As a GIS, I strongly recommend you to learn SQL Server. The easiest way to achieve this is by installing SQL Server as a Docker container. We will go through all the steps in a moment.

Steps to Install SQL Server on Fedora 39

Step 1. Install Docker

The first thing we need to do is to install Docker. Please refer to our previous tutorial to install Docker on Fedora 39. Make sure Docker is up and running by checking through the Terminal with this command

sudo systemctl status docker

You should see something like this below

Step 2. Download SQL Server docker image

Now we need to download the Microsoft SQL Server 2022 Docker image. Use this command to download

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

Output

Now double-check to make sure the SQL Server docker image is downloaded.

sudo docker images

You should see the following output in your Terminal

[dhani@fedora ~]$ sudo docker images
[sudo] password for dhani: 
REPOSITORY                       TAG           IMAGE ID       CREATED       SIZE
mcr.microsoft.com/mssql/server   2022-latest   3c17532d9acc   6 weeks ago   1.58GB

Step 3. Create SQL Server 2022 Docker Container

Now we are going to create a new container for SQL Server.

sudo docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=Str0ng.P@ssw0rd" \
   -p 1433:1433 --name sql1 --hostname sql1 \
   -d \
   mcr.microsoft.com/mssql/server:2022-latest

You need to change the Str0ng.P@ssw0rd with your own password. Make sure your password meets the password complexity recommended by Microsoft.

Now check if the container is created and is running with this command

sudo docker ps

Output

Done. At the moment, we have successfully run SQL Server on Fedora 39.

Step 4. Connect to SQL Server Docker Container

If you need to connect to the container from the command line, you can follow the steps in this article. In this example, I am going to use Navicat Premium to connect to my SQL Server container.

Open Navicat Premium then Click Connection and choose SQL Server. Enter the server details as follow