Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MS SQL Server Docker data location

I am using the mcr.microsoft.com/mssql/server:2019-latest container and want to mount its data directory so that data does not get lost if the server goes down.

Where inside is the data directory located? The documentation does not mention this at all.

like image 384
Werner Avatar asked Aug 27 '26 15:08

Werner


1 Answers

The files, for SQL Server on Linux, are by default located in /var/opt/mssql. Unsurprising the Data files are in the data directory, and the log files in the log directory.

This is also in the documentation Change the default data or log directory location:

The filelocation.defaultdatadir and filelocation.defaultlogdir settings change the location where the new database and log files are created. By default, this location is /var/opt/mssql/data.

like image 99
Larnu Avatar answered Aug 30 '26 10:08

Larnu