CategoriesDatabase Development

Developing with MSSQL on macOS: Local Setup Made Easy

In this blog post I will give a quick steps to setting up MSSQL database on macos for local development.

The main challenge with setting up MSSQL on macOS is that Microsoft SQL Server doesn’t natively support macOS. This means you can’t install it directly like on Windows or Linux.

A quick and easy way to achieve this is to run it via docker image (NB: This post assumes you already have docker up and running on your computer ) in following steps:

  • Pull and run the docker image: docker pull mcr.microsoft.com/mssql/server:2022-latest docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=<YourStrong@Passw0rd>" \ -p 1433:1433 --name sql2022 --hostname sql2022 \ -d \ mcr.microsoft.com/mssql/server:2022-latest

You should be able to see the container running in your docker desktop as shown below:

  • There are two ways to connect to the mssql container :
    • Azure Studio
    • VsCode

Since Microsoft is retiring development of azure studio in 2026 I will suggest going the visual studio code route. Search and install the Mssql extension in vscode

Enable the extension and connect to it as show below:

NB: The servername should be localhost and the Username should be: sa

Leave a Reply

Your email address will not be published. Required fields are marked *