To start learning database management with SQL, you need two things: a database and an application to work with it. There are many popular databases, but Microsoft SQL Server is one of the easiest to start with. Mac can’t install SQL Server natively the way Windows can, so the common approach is to run SQL Server inside a Docker container and then connect to it from VS Code. In this guide, I’ll walk you through each step, from installing Docker to running your first query.
The first version of this guide (2021) used Azure SQL Edge and Azure Data Studio. Microsoft has retired both: Azure SQL Edge on September 30, 2025, and Azure Data Studio on February 28, 2026. I’ve updated the steps to use the official SQL Server image and VS Code with the MSSQL extension (October 2026). If you only want to learn basic SQL and would rather not install Docker, DB Browser for SQLite is a much lighter option.
| Runs in | SQL Server in a Docker container |
| Compatible | Intel (officially), Apple Silicon (via Rosetta 2 emulation) |
| Applications required | Docker Desktop, Visual Studio Code + MSSQL extension |
Install SQL Server on Mac using Docker
Docker is the most widely used tool for running SQL Server on a Mac. Just follow the steps below in order. First, check whether your Mac has an Intel chip or an Apple Silicon chip (M1, M2, M3…).

Note for Apple Silicon Macs
Microsoft only builds the SQL Server container image for x86-64 (Intel/AMD) CPUs. On an Apple Silicon Mac, Docker has to run it through Rosetta 2 emulation. According to Microsoft’s documentation, emulation environments such as Rosetta 2 aren’t tested or officially supported. So this setup is fine for learning SQL and experimenting, but don’t use it for real workloads.
First, install Rosetta 2. Docker’s installation guide says Rosetta 2 is no longer strictly required for Docker Desktop itself, but you still need it to run the SQL Server image. Open the Terminal app on your Mac (press Command Space and search for Terminal), paste the command below, press Enter, then type A to accept the license terms.
softwareupdate --install-rosetta

Download and install Docker
Step 1: Click the button below to download Docker Desktop for Mac, and pick the version that matches your chip.
Step 2: Open the Docker installer and drag the Docker icon into the Applications folder.

Step 3: Give Docker enough memory. Open Docker, go to Settings > Resources > Advanced, and set Memory limit to about 4GB. SQL Server needs at least 2GB of RAM to start, so 4GB is comfortable for a learning setup.

Step 4 (Apple Silicon only): Turn on Rosetta emulation in Docker. Go to Settings > General, set the Virtual Machine Manager to Apple Virtualization framework, check Use Rosetta for x86_64/amd64 emulation on Apple Silicon, then click Apply & restart. This makes the SQL Server image run noticeably faster than the default emulation (setting names may change between Docker versions, October 2026).
Note: If you use Podman instead of Docker, the commands below are similar; just replace docker with podman. I haven’t tested this thoroughly on Podman, though, and the container feature built into the MSSQL extension (covered later) doesn’t support Podman yet.
Create SQL Server with Microsoft's official image
Step 1: Pull the SQL Server image. Open Terminal, paste the command below, and press Enter. Docker Desktop on Mac doesn’t need sudo, so you won’t be asked for your Mac password like in the old version of this guide.
docker pull --platform linux/amd64 mcr.microsoft.com/mssql/server:2025-latest
I’m using the 2025-latest tag (SQL Server 2025). If your course material targets an older version, you can switch to 2022-latest.
Step 2: Create and start the SQL Server container. Paste the command below into Terminal, replace YOUR_PASSWORD with a password of your choice, and press Enter.
docker run --platform linux/amd64 \
-e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=YOUR_PASSWORD" \
-p 1433:1433 --name sql1 --hostname sql1 \
-d mcr.microsoft.com/mssql/server:2025-latest
The
--platform linux/amd64line tells Docker on Apple Silicon to use emulation. On an Intel Mac, leaving it in does no harm.Note: The SQL Server password must be at least 8 characters long and include characters from at least three of these four groups: uppercase letters, lowercase letters, numbers, and symbols. If the password doesn’t meet these rules, the container stops right after starting. You can check the error with
docker logs sql1.
If you want to change the password after creating the container, use this command in Terminal. The -C option tells sqlcmd to trust the container’s self-signed certificate.
docker exec -it sql1 /opt/mssql-tools18/bin/sqlcmd \
-S localhost -U sa -P "OLD_PASSWORD" -C \
-Q "ALTER LOGIN sa WITH PASSWORD='NEW_PASSWORD'"
Step 3: Make sure SQL Server is running. Open Docker, go to Containers, and check that the container named sql1 shows as Running. If it’s stopped, click the play icon to start it. If you prefer Terminal, docker ps lists the running containers too.
You can stop, restart, or delete the SQL Server container right from the Docker interface. On Apple Silicon, the first start can take a little while because it runs through emulation.
That’s it, you now have a basic SQL Server running on your Mac. You can minimize Docker; next, we’ll install VS Code to work with this SQL Server.
Connect to SQL Server with VS Code and the MSSQL extension
This guide used to recommend Azure Data Studio, but it was retired on February 28, 2026, and Microsoft now points users to Visual Studio Code with the MSSQL extension. The extension runs on both Intel and Apple Silicon Macs and covers everything a beginner needs: connecting to a database, browsing tables, writing and running queries, and exporting results to CSV or Excel.
Step 1: Download and install VS Code. Get the Mac version with the button below, unzip it, and drag the app into your Applications folder.
Step 2: Install the MSSQL extension. Open VS Code, click the Extensions icon in the left sidebar (or press Command Shift X), type mssql in the search box, select SQL Server (mssql) by Microsoft, and click Install. Once the SQL Server icon appears in the sidebar, the extension is ready.
Step 3: Create a connection to SQL Server. Click the SQL Server icon, choose Add Connection, keep the Input type as Parameters, and fill in the following:
- Server name: localhost
- Authentication type: SQL Login
- User name: sa
- Password: the password you set when creating the container
Then click Connect. If VS Code shows an error like “certificate chain was issued by an authority that is not trusted”, it’s because the container uses a self-signed certificate. Turn on Trust server certificate (in the form or under Advanced) and connect again. Only enable this option for a SQL Server running on your own machine.
Step 4: Run your first query. Right-click the new connection, choose New Query, type the statement below, and click Run (or press Command Shift E). If the result shows your SQL Server version, you’re all set to start learning SQL.
SELECT @@VERSION;
Tip: The MSSQL extension has a built-in Create local SQL Container feature that pulls the image and creates a SQL Server container without any Docker commands (Docker Desktop still needs to be running). I still walk through the commands above because they help you understand how the container works, which makes troubleshooting much easier later.
Conclusion
One limitation worth knowing: on Apple Silicon Macs, SQL Server runs through emulation, so it’s slower and uses more memory than on an Intel Mac. For learning SQL syntax, writing queries, and creating tables, that’s rarely a problem. But if your Mac is low on resources, or you don’t specifically need SQL Server, SQLite or PostgreSQL (which runs natively on Apple chips) will be lighter.
There are also plenty of database tools beyond Microsoft’s. In Vietnam, many developers like Navicat, and I find its interface friendly, with support for many other popular databases. If you run into an error during setup, leave a comment below with your chip, macOS version, and the error message, and I’ll try to help. Good luck setting up SQL Server on your Mac!





bro say me how to install mongodb in my macbokk air m1 ,
I followed the instructions and everything was up and running, but today I got an error – azure data studio now says it requires parallels to run. what can I do?
Hello, please try to restart your Mac or force quit all anything related to Docker in the Activity Monitor. Docker has some problems with the recent version.
Thank you very much. I was stuck in installing SQL on my Mac but this page helped me a lot.
Hello Fateme, congratulation!
Hi! When we try to connect to the SQL Server, many times we get an Error as Provider: Named Pipes Provider, Error: 40 – could not open a connection to SQL server.
Hello, try to restart the SQL sever, search your error on Stackoverflow.