This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can trysigning in orchanging directories.
Access to this page requires authorization. You can trychanging directories.
Applies to:SQL Server - Linux
This article provides guidance for installing, updating, and uninstalling SQL Server 2017 (14.x), SQL Server 2019 (15.x), SQL Server 2022 (16.x), and SQL Server 2025 (17.x) on Linux.
For other deployment scenarios, see:
This guide covers several deployment scenarios. If you only need step-by-step installation instructions, jump to one of the quickstarts:
For answers to frequently asked questions, see theSQL Server on Linux FAQ.
| Term | Definition |
|---|---|
| Servicing | Microsoft releases GDR, hotfixes, and security fixes within lifecycle of product for supported distributions. |
| Support | Microsoft supports users with problems pertaining to supported distributions. |
SQL Server is supported on Linux distributions until the earlier of two events: the end of the distribution's support lifecycle, or the end of the SQL Server support lifecycle.
During the Mainstream support phase of SQL Server, we provide Cumulative Updates (CUs) for all Linux distributions that are also within their Mainstream support period. For Linux distributions that move from Mainstream to Extended support and are still recognized as supported platforms, Microsoft can release CUs and bug fixes at its discretion.
Once SQL Server moves beyond Mainstream support and into the Extended support phase, we continue to publish security updates and General Distribution Release (GDR) fixes. However, these updates aren't extended to Linux distributions that conclude their support period.
SQL Server is supported on Red Hat Enterprise Linux (RHEL), SUSE Linux Enterprise Server (SLES), and Ubuntu. It's also supported as a container image, which can run on Kubernetes, OpenShift, and Docker Engine on Linux.
| Platform | File system | Installation guide |
|---|---|---|
| Red Hat Enterprise Linux 7.7 - 7.9 Server1, or 8.x Server | XFS orext4 | Installation guide |
| SUSE Linux Enterprise Server v12 SP3 - SP52 | XFS orext4 | Installation guide |
| Ubuntu 18.04 LTS3 | XFS orext4 | Installation guide |
| Docker Engine 1.8+ on Linux4 | N/A | Installation guide |
1 At the end of June 2024, RHEL 7.x transitioned from mainstream maintenance to extended lifecycle support (ELS). For more information, seeRed Hat Enterprise Linux Life Cycle.
2 At the end of Oct 2024, SLES v12 transitioned from standard general support to long term service pack support (LTSS). For more information, seeProduct Support Lifecycle Lifecycle Dates by Product.
3 At the end of April 2023, Ubuntu 18.04 LTS transitioned from standard maintenance to expanded security maintenance (ESM). For more information, seeUbuntu 18.04 end of standard support.
4 SQL Server container images are supported only on Linux hosts running onIntel and AMD x86-64 CPUs. Emulation or translation environments (for example, Rosetta 2, Prism, or QEMU) aren't tested or supported. If you want to create a feature request, or report an emulator-related issue, visit theofficial GitHub repository.
Tip
For more information, review thesystem requirements for SQL Server on Linux. For the latest support policy for SQL Server, see theTechnical support policy for Microsoft SQL Server.
You should run production workloads on supported platforms likeRed Hat Enterprise Linux,SUSE Linux Enterprise Server, andUbuntu Pro, as they receive regular OS security updates, and have support coverage options that you need for enterprise database deployments.
| Platform | File system | Installation guide | Get |
|---|---|---|---|
| Red Hat Enterprise Linux 7.7 - 7.9 Server1, or 8.x Server | XFS orext4 | Installation guide | Get RHEL 8 |
| SUSE Linux Enterprise Server v12 (SP3 - SP5)2, or v15 | XFS orext4 | Installation guide | Get SLES v15 |
| Ubuntu 18.043 or 20.04 | XFS orext4 | Installation guide | Get Ubuntu 20.04 |
| Docker Engine 1.8+ on Linux4 | N/A | Installation guide | Get Docker |
1 At the end of June 2024, RHEL 7.x transitioned from mainstream maintenance to extended lifecycle support (ELS). For more information, seeRed Hat Enterprise Linux Life Cycle.
2 At the end of Oct 2024, SLES v12 transitioned from standard general support to long term service pack support (LTSS). For more information, seeProduct Support Lifecycle Lifecycle Dates by Product.
3 At the end of April 2023, Ubuntu 18.04 LTS transitioned from standard maintenance to expanded security maintenance (ESM). For more information, seeUbuntu 18.04 end of standard support.
4 SQL Server container images are supported only on Linux hosts running onIntel and AMD x86-64 CPUs. Emulation or translation environments (for example, Rosetta 2, Prism, or QEMU) aren't tested or supported. If you want to create a feature request, or report an emulator-related issue, visit theofficial GitHub repository.
Tip
For more information, review thesystem requirements for SQL Server on Linux. For the latest support policy for SQL Server, see theTechnical support policy for Microsoft SQL Server.
You should run production workloads on supported platforms likeRed Hat Enterprise Linux,SUSE Linux Enterprise Server, andUbuntu Pro, as they receive regular OS security updates, and have support coverage options that you need for enterprise database deployments.
| Platform | File system | Installation guide | Get |
|---|---|---|---|
| Red Hat Enterprise Linux 8.x Server, or 9.x Server | XFS orext4 | Installation guide | Get RHEL 9 |
| SUSE Linux Enterprise Server v15 (SP1 - SP4) | XFS orext4 | Installation guide | Get SLES v15 |
| Ubuntu 20.04, or 22.04 | XFS orext4 | Installation guide | Get Ubuntu 22.04 |
| Docker Engine 1.8+ on Linux1 | N/A | Installation guide | Get Docker |
1 SQL Server container images are supported only on Linux hosts running onIntel and AMD x86-64 CPUs. Emulation or translation environments (for example, Rosetta 2, Prism, or QEMU) aren't tested or supported. If you want to create a feature request, or report an emulator-related issue, visit theofficial GitHub repository.
Tip
For more information, review thesystem requirements for SQL Server on Linux. For the latest support policy for SQL Server, see theTechnical support policy for Microsoft SQL Server.
You should run production workloads on supported platforms likeRed Hat Enterprise Linux andUbuntu Pro, as they receive regular OS security updates, and have support coverage options that you need for enterprise database deployments.
| Platform | File system | Installation guide | Get |
|---|---|---|---|
| Red Hat Enterprise Linux 9.x Server | XFS orext4 | Installation guide | Get RHEL 9 |
| Ubuntu 22.04 | XFS orext4 | Installation guide | Get Ubuntu 22.04 |
| Docker Engine 1.8+ on Linux1 | N/A | Installation guide | Get Docker |
1 SQL Server container images are supported only on Linux hosts running onIntel and AMD x86-64 CPUs. Emulation or translation environments (for example, Rosetta 2, Prism, or QEMU) aren't tested or supported. If you want to create a feature request, or report an emulator-related issue, visit theofficial GitHub repository.
Tip
For more information, review thesystem requirements for SQL Server on Linux. For the latest support policy for SQL Server, see theTechnical support policy for Microsoft SQL Server.
Microsoft also supports deploying and managing SQL Server containers by using OpenShift and Kubernetes.
Note
SQL Server is tested and supported on Linux for the previously listed distributions. If you choose to install SQL Server on an unsupported operating system, review theSupport policy section of theTechnical support policy for Microsoft SQL Server to understand the support implications.
SQL Server has the following system requirements for Linux:
| Requirement | |
|---|---|
| Memory | 2 GB1 |
| File System | XFS orext4 (other file systems, such asBTRFS, aren't supported) |
| Disk space | 6 GB |
| Processor speed | 2 GHz |
| Processor cores | 2 cores |
| Processor type | x64-compatible only |
1 2 GB is the minimum required memory to start SQL Server on Linux, which accommodates system threads and internal processes. You must take this amount into consideration when settingmax server memory andMemoryLimitMB.
If you useNetwork File System (NFS) remote shares in production, note the following support requirements:
fallocate and sparse file creation, common to modern file systems./var/opt/mssql directories on the NFS mount. Other files, such as the SQL Server system binaries, aren't supported.When you install or upgrade SQL Server, you get the latest version of SQL Server from your configured Microsoft repository. The quickstarts use the Cumulative UpdateCU repository for SQL Server. For more information on repositories and how to configure them, seeConfigure repositories for installing and upgrading SQL Server on Linux.
You can install SQL Server on Linux from the command line. For step-by-step instructions, see one of the following quickstarts:
| Platform | Installation quickstarts |
|---|---|
| Red Hat Enterprise Linux (RHEL) | 2017 |2019 |2022 |2025 |
| SUSE Linux Enterprise Server (SLES) | 2017 |2019 |2022 |2025 |
| Ubuntu | 2017 |2019 |2022 |2025 |
| Docker | 2017 |2019 |2022 |2025 |
You can also run SQL Server on Linux in an Azure virtual machine. For more information, seeProvision a SQL VM in Azure.
After installing, consider making extra configuration changes for optimal performance. For more information, seePerformance best practices and configuration guidelines for SQL Server on Linux.
To update themssql-server package to the latest release, use one of the following commands based on your platform:
| Platform | Package update commands |
|---|---|
| RHEL | sudo yum update mssql-server |
| SLES | sudo zypper update mssql-server |
| Ubuntu | sudo apt-get updatesudo apt-get install mssql-server |
These commands download the newest package and replace the binaries located under/opt/mssql/. The user generated databases and system databases aren't affected by this operation.
To upgrade SQL Server, firstchange your configured repository to the desired version of SQL Server. Then use the sameupdate command to upgrade your version of SQL Server. This step is only possible if the upgrade path is supported between the two repositories.
To roll back or downgrade SQL Server to a previous release, use the following steps:
Identify the version number for the SQL Server package you want to downgrade to. For a list of package numbers, see the release notes:
Downgrade to a previous version of SQL Server. In the following commands, replace<version_number> with the SQL Server version number you identified in step 1.
| Platform | Package update commands |
|---|---|
| RHEL | sudo yum downgrade mssql-server-<version_number>.x86_64 |
| SLES | sudo zypper install --oldpackage mssql-server=<version_number> |
| Ubuntu | sudo apt-get install mssql-server=<version_number>sudo systemctl start mssql-server |
Note
The only supported downgrade is if you downgrade to a release within the same major version, such as SQL Server 2022 (16.x).
To verify your current version and edition of SQL Server on Linux, use the following procedure:
If not already installed, seeInstall the sqlcmd and bcp SQL Server command-line tools on Linux.
Usesqlcmd to run a Transact-SQL command that displays your SQL Server version and edition.
sqlcmd -S localhost -U sa -Q 'select @@VERSION'To remove themssql-server package on Linux, use one of the following commands based on your platform:
| Platform | Package removal commands |
|---|---|
| RHEL | sudo yum remove mssql-server |
| SLES | sudo zypper remove mssql-server |
| Ubuntu | sudo apt-get remove mssql-server |
Removing the package doesn't delete the generated database files. If you want to delete the database files, use the following command:
sudo rm -rf /var/opt/mssql/You can perform an unattended installation in the following way:
mssql-conf setup, setenvironment variables and use the-n (no prompt) option.The following example configures SQL Server Developer edition with theMSSQL_PID environment variable. It also accepts the EULA (ACCEPT_EULA) and sets thesa password (MSSQL_SA_PASSWORD). The-n parameter performs an unprompted installation where the configuration values are pulled from the environment variables.
sudo MSSQL_PID=Developer ACCEPT_EULA=Y MSSQL_SA_PASSWORD='<password>' /opt/mssql/bin/mssql-conf -n setupCaution
Your password should follow the SQL Server defaultpassword policy. By default, the password must be at least eight characters long and contain characters from three of the following four sets: uppercase letters, lowercase letters, base-10 digits, and symbols. Passwords can be up to 128 characters long. Use passwords that are as long and complex as possible.
You can also create a script that performs other actions. For example, you could install other SQL Server packages.
For a more detailed sample script, see the following examples:
If your Linux machine doesn't have access to the online repositories used in thequick starts, you can download the package files directly. These packages are located in the Microsoft repository, athttps://packages.microsoft.com.
Tip
If you successfully installed with the steps in the quick starts, you don't need to download or manually install the SQL Server package(s). This section is only for the offline scenario.
Download the database engine package for your platform. Find package download links in the package details section of theRelease notes for SQL Server 2022 on Linux.
Move the downloaded package to your Linux machine. If you used a different machine to download the packages, one way to move the packages to your Linux machine is with thescp command.
Install the database engine package. Use one of the following commands based on your platform. Replace the package file name in this example with the exact name you downloaded.
| Platform | Package install command |
|---|---|
| RHEL | sudo yum localinstall mssql-server_versionnumber.x86_64.rpm |
| SLES | sudo zypper install mssql-server_versionnumber.x86_64.rpm |
| Ubuntu | sudo dpkg -i mssql-server_versionnumber_amd64.deb |
Note
You can also install the RPM packages (RHEL and SLES) with therpm -ivh command, but the commands in the previous table automatically install dependencies if available from approved repositories.
Resolve missing dependencies: You might have missing dependencies at this point. If not, you can skip this step. On Ubuntu, if you have access to approved repositories containing those dependencies, the easiest solution is to use theapt-get -f install command. This command also completes the installation of SQL Server. To manually inspect dependencies, use the following commands:
| Platform | List dependencies command |
|---|---|
| RHEL | rpm -qpR mssql-server_versionnumber.x86_64.rpm |
| SLES | rpm -qpR mssql-server_versionnumber.x86_64.rpm |
| Ubuntu | dpkg -I mssql-server_versionnumber_amd64.deb |
After you resolve the missing dependencies, you can try installing themssql-server package again.
Complete the SQL Server setup. Usemssql-conf to complete the SQL Server setup:
sudo /opt/mssql/bin/mssql-conf setupSQL Server is licensed the same for Linux and Windows. For more information about SQL Server licensing and pricing, seeHow to license SQL Server, andSQL Server Licensing Resources and Documents.
After installation, you can also install or enable optional SQL Server features.
Did you know that you can edit SQL content yourself? If you do so, not only do you help improve our documentation, but you also get credited as a contributor to the page.
For more information, seeEdit Microsoft Learn documentation.
Was this page helpful?
Need help with this topic?
Want to try using Ask Learn to clarify or guide you through this topic?
Was this page helpful?
Want to try using Ask Learn to clarify or guide you through this topic?