↓Skip to main content

Install Microsoft SQL Server on Mac M2 Air using Docker and Azure Data Studio

This guide walks you through setting up Microsoft SQL Server on Apple Silicon (Mac M2 Air) using Docker containers, connecting via Azure Data Studio, and restoring the AdventureWorks sample database.


Prerequisites

Install the following tools on your Mac:


Check Docker Settings (Apple Silicon)

Before launching the container, verify that Docker Desktop is properly configured for x86 emulation on Apple Silicon:

  1. Open Docker Desktop → Settings → General tab.
  2. Ensure “Use the Apple Virtualization framework” is checked.
  3. Enable “Use Rosetta for x86_64/amd64 emulation on Apple Silicon” to run amd64 container images smoothly.
Docker Desktop Settings for Apple Silicon
Docker Desktop settings for Apple Silicon and Rosetta emulation

Setting Up the SQL Server Container

Run the official Microsoft SQL Server Linux image using linux/amd64 emulation:

docker run --platform linux/amd64 \
  -e "ACCEPT_EULA=Y" \
  -e 'MSSQL_SA_PASSWORD=StrongPa55w0rd!' \
  -p 1433:1433 \
  --name sqlserver \
  -d mcr.microsoft.com/mssql/server:2022-latest

Connecting with Azure Data Studio

Launch Azure Data Studio and create a new connection:

  • Connection type: Microsoft SQL Server
  • Server: localhost,1433
  • Authentication type: SQL Login
  • User name: sa
  • Password: StrongPa55w0rd!
Connection setup in Azure Data Studio
Connection configuration in Azure Data Studio

Setting Up Sample Database

Download the AdventureWorks sample database backup.

Open Docker Desktop, select your sqlserver container, navigate to the Files tab, and upload AdventureWorks2016.bak into the /var/opt/mssql/ directory:

Uploading database backup file to Docker container
Uploading AdventureWorks2016.bak into /var/opt/mssql/ inside the container

Database Restoration

1. Enable Preview Features

In Azure Data Studio, open Settings and search for “unreleased preview features” to enable database restore tools:

Enable preview features in Azure Data Studio
Enabling preview features in Azure Data Studio settings

2. Restore Database from Backup

In the Connections sidebar, right-click the Databases folder and select Restore Database (Preview):

Access restore database feature
Selecting Restore Database (Preview)

Under Restore from, switch to Backup file:

Select backup file option
Selecting Backup file as the source

Browse to /var/opt/mssql/AdventureWorks2016.bak and complete the restoration:

Complete database restoration
Restoring AdventureWorks database from the container filesystem

Running Queries

You can now open a new query editor and execute T-SQL queries directly against the restored AdventureWorks database:

Running queries in Azure Data Studio
Querying AdventureWorks database tables in Azure Data Studio
Query results view
Viewing execution results and table records

Summary

You now have a fully functional Microsoft SQL Server 2022 instance running locally on your Apple Silicon Mac:

  • Server: MSSQL 2022 running containerized via Docker on Apple Silicon Rosetta emulation
  • Management: Azure Data Studio native client
  • Data: Full AdventureWorks sample database ready for analytics, SQL practice, and testing