In this tutorial we will learn how to install Microsoft SQL Server on Debian 12. And then we will use it as our spatial database server. Microsoft SQL Server Spatial Database is a powerful geospatial data management system integrated within Microsoft SQL Server. This specialized database technology enables the storage, analysis, and retrieval of spatial data, making it a valuable asset for applications that require geographic information and mapping. SQL Server Spatial Database supports various spatial data types and allows for complex spatial queries, making it a go-to choice for applications ranging from geographic information systems (GIS) to location-based services and more.
Steps to Install Microsoft SQL Server on Debian 12
I don’t think there is a native installer that allows us to install SQL Server directly to Debian 12. But don’t worry, we still able to install the latest Microsoft SQL Server 2022 on Debian 12 using Docker. So this article will guide you through the installation process.
Step 1. Install Docker on Debian 12
You can follow my previous article to install Docker on Debian 12. You can skip this step if you already have Docker installed on your Debian system.
Step 2. Pull/Download SQL Server Linux container image
The following step will download the SQL Server 2022 container image from the Microsoft Container Registry.
sudo docker pull mcr.microsoft.com/mssql/server:2022-latest
This process will take a while depending on your internet speed. Once completed, you will see something like this on your Terminal
Step 2. Run SQL Server Container
Now we are ready to start our SQL Server. We will run it from the image that we’ve downloaded from the step 1 above.
sudo docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=<YourStrong@Passw0rd>" \
-p 1433:1433 --name sql1 --hostname sql1 \
-d \
mcr.microsoft.com/mssql/server:2022-latest --restart=always
Don’t forget to change the following:
- Change <YourStrong@Passw0rd> with your own password. Make sure it meets the password complexity that can be read here.
- Change sql1 with your own name
In a few moments, the Microsoft SQL Server should up and running. You can use it to store your spatial data from the GIS applications such as ArcGIS Pro, QGIS, and some others.
Export Shapefiles to SQL Server Spatial Database - GIS Tutorial
December 18, 2023[…] you can find many ways to install Microsoft SQL Server on different platforms such as Ubuntu, Debian, and so on. But today, I will show you how to export shapefiles to the spatial database in SQL […]