# Quick instruction on running MSSQL server in a Docker container

**URL:** <https://forum.litium.com/t/quick-instruction-on-running-mssql-server-in-a-docker-container/2605>\
**Category:** Tips & Tricks\
**Created:** [May 27, 2022, 2:24pm UTC](https://forum.litium.com/t/quick-instruction-on-running-mssql-server-in-a-docker-container/2605 "2022-05-27T14:24:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![steve.redstorm](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/steve.redstorm/32/14_2.png) [@steve.redstorm](https://forum.litium.com/u/steve.redstorm)\
**Post date:** [May 27, 2022, 2:24pm UTC](https://forum.litium.com/t/quick-instruction-on-running-mssql-server-in-a-docker-container/2605/1 "2022-05-27T14:24:56Z")

</div>

\*\*\* Download and install an image of MSSQL 2019 \*\*\*

> docker run -e “ACCEPT\_EULA=Y” -e “SA\_PASSWORD=YourStrongPassword” ` -p 1433:1433 --name yourDBname --hostname yourDBname`  
> -d [Microsoft Artifact Registry](http://mcr.microsoft.com/mssql/server:2019-latest)

\*\*\* Connect SQL Server Management Studio to your Docker container \*\*\*

> Server type: Database Engine  
> Server name: 127.0.0.1,1433  
> Authentication: SQL Server Authentication  
> Login: SA  
> Password: YourStrongPassword

\*\*\* For restoring db backups \*\*\*

> _// Create a backup folder_  
> docker exec -it yourDBname mkdir /var/opt/mssql/backup
> 
> _// Copy your .bak file to correct destination in the container_  
> docker cp yourBackupFile.bak yourDBname:var/opt/mssql/backup
> 
> _// Place the data files in correct folder on restore example:_  
> /var/opt/mssql/data/yourBackupFile.mdf  
> /var/opt/mssql/data/yourBackupFile\_log.ldf

\*\*\* Connectionstring from VS \*\*\*

> connectionString=“Pooling=true;User Id=SA;Password=YourStrongPassword;Database=yourDBname;Server=127.0.0.1,1433”
