---
title: Installation guidance for SQL Server on Linux
description: Install, update, and uninstall SQL Server on Linux. This article covers online, offline, and unattended scenarios.
author: rwestMSFT
ms.author: randolphwest
ms.date: 05/30/2023
ms.service: sql
ms.subservice: linux
ms.topic: conceptual
ms.custom:
- intro-installation
- linux-related-content
---
# Installation guidance for SQL Server on Linux
[!INCLUDE [SQL Server - Linux](../includes/applies-to-version/sql-linux.md)]
This article provides guidance for installing, updating, and uninstalling [!INCLUDE [sssql17-md](../includes/sssql17-md.md)], [!INCLUDE [sssql19-md](../includes/sssql19-md.md)], and [!INCLUDE [sssql22-md](../includes/sssql22-md.md)] on Linux.
For other deployment scenarios, see:
- [Windows](../database-engine/install-windows/install-sql-server.md)
- [Linux containers](./sql-server-linux-docker-container-deployment.md)
- [Kubernetes - Big Data Clusters](../big-data-cluster/deploy-get-started.md) ([!INCLUDE [sssql19-md](../includes/sssql19-md.md)] only)
This guide covers several deployment scenarios. If you are only looking for step-by-step installation instructions, jump to one of the quickstarts:
> - [RHEL quickstart](quickstart-install-connect-red-hat.md)
> - [SLES quickstart](quickstart-install-connect-suse.md)
> - [Ubuntu quickstart](quickstart-install-connect-ubuntu.md)
> - [Docker quickstart](quickstart-install-connect-docker.md)
For answers to frequently asked questions, see the [SQL Server on Linux FAQ](../linux/sql-server-linux-faq.yml).
## Supported platforms
[!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)] is supported on Red Hat Enterprise Linux (RHEL), SUSE Linux Enterprise Server (SLES), and Ubuntu. It is also supported as a container image, which can run on Kubernetes, OpenShift, and Docker Engine on Linux.
::: moniker range="= sql-server-linux-2017 || = sql-server-2017"
[!INCLUDE [linux-supported-platforms-2017](includes/linux-supported-platforms-2017.md)]
::: moniker-end
::: moniker range="= sql-server-linux-ver15 || = sql-server-ver15"
[!INCLUDE [linux-supported-platforms-2019](includes/linux-supported-platforms-2019.md)]
::: moniker-end
::: moniker range=">= sql-server-linux-ver16 || >= sql-server-ver16"
[!INCLUDE [linux-supported-platforms-2022](includes/linux-supported-platforms-2022.md)]
::: moniker-end
Microsoft also supports deploying and managing [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)] containers by using OpenShift and Kubernetes.
> [!NOTE]
> [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)] is tested and supported on Linux for the previously listed distributions. If you choose to install [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)] on an unsupported operating system, please review the **Support policy** section of the [Technical support policy for Microsoft SQL Server](https://support.microsoft.com/help/4047326/support-policy-for-microsoft-sql-server) to understand the support implications.
## System requirements
[!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)] has the following system requirements for Linux:
| | Requirement |
| --- | --- |
| **Memory** | 2 GB |
| **File System** | **XFS** or **EXT4** (other file systems, such as **BTRFS**, aren't supported) |
| **Disk space** | 6 GB |
| **Processor speed** | 2 GHz |
| **Processor cores** | 2 cores |
| **Processor type** | x64-compatible only |
If you use **Network File System (NFS)** remote shares in production, note the following support requirements:
- Use NFS version **4.2 or higher**. Older versions of NFS don't support required features, such as `fallocate` and sparse file creation, common to modern file systems.
- Locate only the `/var/opt/mssql` directories on the NFS mount. Other files, such as the [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)] system binaries, aren't supported.
## Configure source repositories
When you install or upgrade [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)], you get the latest version of [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)] from your configured Microsoft repository. The quickstarts use the Cumulative Update **CU** repository for [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)]. For more information on repositories and how to configure them, see [Configure repositories for SQL Server on Linux](sql-server-linux-change-repo.md).
## Install SQL Server
You can install [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)] 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](quickstart-install-connect-red-hat.md?view=sql-server-2017&preserve-view=true) \| [2019](quickstart-install-connect-red-hat.md?view=sql-server-linux-ver15&preserve-view=true) \| [2022](quickstart-install-connect-red-hat.md?view=sql-server-linux-ver16&preserve-view=true) |
| SUSE Linux Enterprise Server (SLES) | [2017](quickstart-install-connect-suse.md?view=sql-server-2017&preserve-view=true) \| [2019](quickstart-install-connect-suse.md?view=sql-server-linux-ver15&preserve-view=true) \| [2022](quickstart-install-connect-suse.md?view=sql-server-linux-ver16&preserve-view=true) |
| Ubuntu | [2017](quickstart-install-connect-ubuntu.md?view=sql-server-2017&preserve-view=true) \| [2019](quickstart-install-connect-ubuntu.md?view=sql-server-linux-ver15&preserve-view=true) \| [2022](quickstart-install-connect-ubuntu.md?view=sql-server-linux-ver16&preserve-view=true) |
| Docker | [2017](quickstart-install-connect-docker.md?view=sql-server-2017&preserve-view=true) \| [2019](quickstart-install-connect-docker.md?view=sql-server-linux-ver15&preserve-view=true) \| [2022](quickstart-install-connect-docker.md?view=sql-server-linux-ver16&preserve-view=true) |
You can also run [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)] on Linux in an Azure virtual machine. For more information, see [Provision a SQL VM in Azure](/azure/azure-sql/virtual-machines/linux/sql-vm-create-portal-quickstart?toc=/sql/toc/toc.json).
After installing, consider making additional configuration changes for optimal performance. For more information, see [Performance best practices and configuration guidelines for SQL Server on Linux](sql-server-linux-performance-best-practices.md).
## Update or upgrade SQL Server
To update the `mssql-server` package to the latest release, use one of the following commands based on your platform:
| Platform | Package update command(s) |
| --- | --- |
| RHEL | `sudo yum update mssql-server` |
| SLES | `sudo zypper update mssql-server` |
| Ubuntu | `sudo apt-get update`
`sudo 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 [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)], first [change your configured repository](sql-server-linux-change-repo.md) to the desired version of [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)]. Then use the same `update` command to upgrade your version of [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)]. This is only possible if the upgrade path is supported between the two repositories.
## Roll back SQL Server
[!INCLUDE [roll-back-sql-server](includes/roll-back-sql-server.md)]
## Check installed SQL Server version
To verify your current version and edition of [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)] on Linux, use the following procedure:
1. If not already installed, install the [SQL Server command-line tools](sql-server-linux-setup-tools.md).
1. Use **sqlcmd** to run a Transact-SQL command that displays your [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)] version and edition.
```bash
sqlcmd -S localhost -U SA -Q 'select @@VERSION'
```
## Uninstall SQL Server
To remove the `mssql-server` package on Linux, use one of the following commands based on your platform:
| Platform | Package removal command(s) |
| --- | --- |
| 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:
```bash
sudo rm -rf /var/opt/mssql/
```
## Unattended install
You can perform an unattended installation in the following way:
- Follow the initial steps in the [quickstarts](#platforms) to register the repositories and install [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)].
- When you run `mssql-conf setup`, set [environment variables](sql-server-linux-configure-environment-variables.md) and use the `-n` (no prompt) option.
The following example configures [!INCLUDE [ssdeveloper-md](../includes/ssdeveloper-md.md)] edition with the `MSSQL_PID` environment variable. It also accepts the EULA (`ACCEPT_EULA`) and sets the SA user password (`MSSQL_SA_PASSWORD`). The `-n` parameter performs an unprompted installation where the configuration values are pulled from the environment variables.
```bash
sudo MSSQL_PID=Developer ACCEPT_EULA=Y MSSQL_SA_PASSWORD='