Install SQL Server Via Docker
Last modified: 12 February 2025First download and install Docker
Enter the following in the command line to download the container, but make sure to change the password to a secure one you wish to use:
docker pull mcr.microsoft.com/mssql/server:2022-latest
docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=Password123" \
-p 1433:1433 --name sql2022 --hostname sql2022 \
-d \
mcr.microsoft.com/mssql/server:2022-latest
To check the container is running and to stop and start it etc. use the Docker desktop application.
In DataGrip, open a new connection and enter the following parameters:
Server / host: localhost
Authentication: User & Password
Port: 1433
User / User name: sa
Password: your chosen password
If you are using DataGrip, go to the advanced settings and set encrypt to false.
A common way of testing that you are successfully connected to a database is by creating a new query and entering the following:
SELECT GETDATE()