How to use MSSQL Server on ARM based Mac.

How to use MSSQL Server on ARM based Mac M1,M2


Microsoft SQL Server can be run on Linux, Windows but they may not work with Apple Mac/Mac mini. We can’t change a just DBMS for new OS, different platform .

The fact that Mac/Mac mini with M2 chip is ideal for Multi platform development. It is better alternative for Windows Machine, since you are looking for a desktop.

We have two options to consider for getting things work, a Virtual machine dedicated to MSSQL or just containerise the SQL server which is a better choice.

VM don’t like Mac, I tried Virtual Box and Parallel. VB didn’t start up correctly. In case Parallel it didn’t get installed.

So we move to the Docker option. Most of the docker images (ARM based MSSQL) designed for Intel Mac ? For Mac with M1 and M2 (Apple Silicon).

Wee needs to user Rosetta for the transition from Intel to New M1/M2. It work behind the seen.

For complete Guide on Containerising MSSQL Server visit this Post.

Create Docker Container for MSSQL on Mac


As the first step we need to install Docker Mac and make sure you have Rosetta get installed, in case of using Mac with M1 or M2. These Models come with Apple Silicon. Some of the older apps come with Intel chip support, Rosetta will help you the migrate to Apple Silicon.

Docker Compose

Using the Docker-Compose we can containerise MSSQL. Here is the working Docker-Compose file.

Create a Folder called MSSQL and add Docker-Compose.yml file with following contents

version: '3.9'

services:
  mssql-azur-edge:
    image: mcr.microsoft.com/azure-sql-edge 
    platform: linux/arm64
    ports:
      - 1433:1433
    volumes:
      - ~/apps/mssql/data:/var/lib/mssqlql/data
    environment:
      - ACCEPT_EULA=Y
      - SA_PASSWORD=mssql1Ipw

Since I’am using the Mac Min M2, which is an arm device, should specify in the platform key. Port key expose the internal port to external. Volume indicate the storage location which is optional.

In the environment key we can pass the Password for SQL Server etc.

Now . Run the Docker-compose up -d. for running the Container. If there is any problem , run this command for the log docker-compose logs

You are ready to use the sever. You can also use the Mac IP and exposed port in SQL Management studio or in a connection string as (source)

 Mac IP, 1433