How to Install SQL Server with Docker



SQL Server is one of the most widely used databases. Microsoft supports this database development and SQL Server has grown to support much more than just SQL. It also can scale up to many terabytes of data easily, making it a safe choice for any project. In this article, we will learn how to install SQL server with Docker.

Installing Docker

For this, we will be using docker. This is recommended for more than just using SQL Server. To find how to install docker go here:

Docker Compose

Now create a file called docker-compose.yml and add the following.

version: "3.9"
    image: ""
      - 1433:1433
        SA_PASSWORD: "Your_password123"
        ACCEPT_EULA: "Y"

Open a terminal and go to the folder the file is located. Then run the following.

docker-compose up

If you are looking for another good reference, you can check here:

Setting up a DB Client

For a database client, I will be using DBeaver. It is open source,, has a nice UI and supports many drivers. You can use another client of your choice.

If using DBeaver, step one is to create a new connection


Select SQL Server


Type in the following credentials username SA and Your_password123 as your password. Click "Test Connection" and DBeaver will prompt you to download the drivers if you don't have them.


Finally, let's open up a sql script to run commands.