MSSQL in Mac OS?

Tuan Burah
3 min readFeb 25, 2025

--

How to install Microsoft SQL Server (MSSQL) in a Mac OS

MSSQL-IN-MAC

Overview

For a long time, Microsoft SQL Server (MSSQL) was primarily a Windows-based database management system. But with the rise of cross-platform development and cloud solutions, Microsoft now provides official support for running MSSQL on macOS — although not natively. Instead, macOS users need to leverage Docker to set up and run SQL Server efficiently.

Whether you’re a developer, database administrator, or just someone looking to experiment with MSSQL on a Mac, this guide will walk you through installing and setting up SQL Server on macOS. By the end, you’ll have a fully functional MSSQL environment running on your Mac, ready for database development, management, or testing.

Let’s dive into the installation process step by step!

Step 1: Install Docker Desktop

Since MSSQL is not natively supported on macOS, the best way to run it is through Docker, which allows you to create a lightweight virtualized environment.

How to Install Docker on Mac

  1. Download Docker Desktop

2. Install Docker

  • Open the downloaded .dmg file and drag Docker into the Applications folder.
  • Launch Docker Desktop and follow the setup instructions.

3. Verify Docker Installation

  • Open Terminal and run:
docker --version
  • If you see a version number, Docker is installed correctly.

Step 2: Pull the MSSQL Docker Image

Once Docker is running, you need to download the official Microsoft SQL Server Docker image.

  1. Open Terminal and run the following command:
docker pull mcr.microsoft.com/azure-sql-edge

This will download the latest version of MSSQL Server.

Step 3: Run MSSQL in a Docker Container

Now that you have the MSSQL image, you can start a container and run the database server.

docker run -e "ACCEPT_EULA=1" -e "MSSQL_SA_PASSWORD=MyStrongPass123" -e "MSSQL_PID=Developer" -e "MSSQL_USER=SA" -p 1433:1433 -d --name=sql mcr.microsoft.com/azure-sql-edge
  • ACCEPT_EULA=Y → Accepts Microsoft’s End User License Agreement.
  • SA_PASSWORD=MyStrongPass123 → Sets a strong password for the SA (System Administrator) account.
  • -p 1433:1433 → Exposes port 1433, which MSSQL uses.
  • — name mssql → Assigns the name sql to the container.
  • -d → Runs the container in detached mode (in the background).

Step 4: Connect to SQL Server on Mac

Once your MSSQL container is running, you can connect to it using a SQL client.

Using Azure Data Studio

Microsoft provides Azure Data Studio, a cross-platform database management tool.

Click Connect, and you should see your SQL Server databases!

Conclusion

Setting up Microsoft SQL Server on macOS is straightforward using Docker. By following this guide, you now have a fully functional MSSQL environment on your Mac, ready for development, testing, or database management.

Quick Recap:

✅ Installed Docker Desktop
✅ Pulled and ran MSSQL in a Docker container
✅ Connected to SQL Server using Azure Data Studio or SQLCMD
✅ Learned how to manage the container and persist data

Now you’re all set! 🚀 If you have any questions or run into issues, feel free to drop a comment. Happy coding!

References

--

--

Tuan Burah
Tuan Burah

Written by Tuan Burah

M.Sc. in IT (reading) | Pg.D. in IT | Student Member of British Computer Society — Royal Charter | Member of LivePhysics Science Community

No responses yet