Introduction
There are various ways to install Microsoft SQL Server. If you are using Mac, you may want to install SQL Server using Docker. SQL Server is available natively for some Ubuntu versions but I would also recommend to use Docker in any Linux distributions. In this article, we are going to set up a SQL Server using Docker. Docker is a powerful tool that can streamline the process. This guide will walk you through the steps to installing SQL Server on Docker, making it easier to manage your databases.
Prerequisites
Before you begin, ensure you have Docker installed on your system. You can download Docker Desktop from the official website. Additionally, familiarize yourself with containerized applications, as this will help you understand how SQL Server will run within a Docker container.

Step-by-Step Installation
1. Open your terminal or command prompt. For Windows 11 users, you can open Command Prompt.
2. Pull the SQL Server Docker image by running the following command:
docker pull mcr.microsoft.com/mssql/server
3. Once the image is downloaded, you can create and run a new SQL Server container with the command:
docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=YourStrong!Passw0rd' -p 1433:1433 --name sqlserver_container -d mcr.microsoft.com/mssql/server
Make sure to replace ‘YourStrong!Passw0rd’ with your own secure password.
4. Verify that the SQL Server container is running by executing:
docker ps
If your container appears in the list, congratulations! You have successfully installed SQL Server on Docker.
Connecting to SQL Server
To connect to SQL Server, you can use tools like SQL Server Management Studio (SSMS) or Azure Data Studio. Just use ‘localhost’ as your server name, along with the ‘sa’ login and the password you set earlier.
Conclusion
Installing SQL Server on Docker can save you time and resources, allowing for easy setup and management of your database environments. By following this guide, you should now have a functional SQL Server instance running in a Docker container, ready for your development or testing needs.