---
title: 'SQL Server on Docker'
metaTitle: 'SQL Server  on Docker'
metaDescription: 'Download and use the Microsoft SQL Server Docker image.'
---

:::info Quick summary
This guide provides a quick overview on setting up and running Microsoft SQL Server in a Docker container, including pulling the image, starting the server, connecting, and creating a test database.
:::


<TopBlock>

To run a Microsoft SQL Server container image with Docker:

1. Install and set up [Docker](https://docs.docker.com/get-started/get-docker/)
1. Run the following command in your terminal to download the Microsoft SQL Server 2019 image:

   ```terminal
   docker pull mcr.microsoft.com/mssql/server:2019-latest
   ```

1. Create an instance of the container image, replacing the value of `SA_PASSWORD` with a password of your choice:

   ```terminal wrap
   docker run --name sql_container -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=myPassword' -p 1433:1433 -d mcr.microsoft.com/mssql/server:2019-latest
   ```

1. [Follow Microsoft's instructions to connect to SQL Server and use the `sqlcmd` tool](https://learn.microsoft.com/en-us/sql/linux/quickstart-install-connect-docker?view=sql-server-ver15&pivots=cs1-cmd&tabs=cli#connect-to-sql-server), replacing the image name and password with your own.

1. From the `sqlcmd` command prompt, create a new database:

   ```terminal
   CREATE DATABASE quickstart
   GO
   ```

1. Run the following command to check that your database was created successfully:

   ```terminal
   sp_databases
   GO
   ```

</TopBlock>

## Connection URL credentials

Based on this example, your credentials are:

- **Username**: sa
- **Password**: myPassword
- **Database**: quickstart
- **Port**: 1433
