# Install SQL Server on Docker

> Pull the SQL Server 2022 image and run the container with rootless Podman, choose the edition with MSSQL_PID, get a certificate with Certbot.
>
> Source : https://www.pachadata.com/en/docs/howtos/linux/docker/
> Author : Rudi Bruchez · updated 2026-10-14
> Markdown version of the page, for tools and LLMs. The HTML page is the reference.


For these steps I use Podman rather than Docker on my Debian machine, to get a serviceless installation that does not need to run as root.

## Pulling the SQL Server Docker image

The list of downloadable images is [here](https://hub.docker.com/r/microsoft/mssql-server).

You can pick the edition through the environment variables, with `MSSQL_PID`: for instance `-e "MSSQL_PID=Developer"` for the Developer edition. The `sa` password goes in `MSSQL_SA_PASSWORD`; the older `SA_PASSWORD` variable is deprecated. Replace `<password>` with a password that meets the SQL Server policy (at least eight characters, from three of the four sets: uppercase, lowercase, digits, symbols), otherwise the container stops at startup. The variables are listed in the [Microsoft documentation](https://learn.microsoft.com/sql/linux/configure/environment-variables).

```bash
podman pull mcr.microsoft.com/mssql/server:2022-latest

podman run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=<password>" -e "MSSQL_PID=Developer" -p 1433:1433 --name sql_server_2022 -d mcr.microsoft.com/mssql/server:2022-latest
```

Check that the container is running:

```bash
podman ps
```

## Getting an SSL certificate with Certbot

To encrypt connections with a trusted certificate, Certbot gets a Let's Encrypt certificate for the server's DNS name. In `--standalone` mode it opens port 80 on the machine itself, and that port must be reachable from the Internet. Replace `sql.example.com` with the name of your server.

```bash
sudo certbot certonly --standalone --preferred-challenges http -d sql.example.com
```

You then declare the certificate to SQL Server with `mssql-conf` (`network.tlscert` and `network.tlskey`): the procedure is in [Encrypting connections to SQL Server on Linux](https://learn.microsoft.com/sql/linux/sql-server-linux-encrypted-connections).


---

## About the author

Rudi Bruchez, independent SQL Server consultant since 2006: performance audits, tuning, migrations, high availability and training. For an audit or hands-on help on your server: https://www.pachadata.com/en/contact/ (remote audit: https://www.pachadata.com/en/services/remote-sql-server-audit/).
