Microsoft SQL Server Server (MS SQL) is a relational database management system (RDBMS) developed by Microsoft. It was created initially to run on Windows Servers but later ported to Linux. The MS SQL Server 2022 is build on the previous releases to grow SQL Server as a platform that gives you choices of development languages, data types, on-premises or cloud environments, and operating systems.
In this short article we will perform an installation of Microsoft SQL Server (MS SQL) 2022 on Amazon Linux 2023. This release of MS SQL Server introduces Big Data Clusters for SQL Server and provides additional capability and improvements for the database engine, Analysis Services, Machine Learning Services, Master Data Services among many others.
Step 1: Update Amazon Linux Server
Before we begin the installation process, let us update the operating system:
sudo yum -y update
Since there could be kernel updates, it is recommended to reboot the system after a successful upgrade:
sudo reboot
Step 2: Add Microsoft YUM Repositories
Run the commands below to add required repository to the system.
sudo curl https://packages.microsoft.com/config/rhel/8/mssql-server-2022.repo -o /etc/yum.repos.d/mssql-server.repo
Confirm the repository is now available:
sudo yum repolist

The update your repositories:
$ sudo yum update
Microsoft SQL Server 2022 199 B/s | 481 B 00:02
Microsoft SQL Server 2022 3.0 kB/s | 983 B 00:00
Importing GPG key 0xBE1229CF:
Userid : "Microsoft (Release signing) <[email protected]>"
Fingerprint: BC52 8686 B50D 79E3 39D3 721C EB3E 94AD BE12 29CF
From : https://packages.microsoft.com/keys/microsoft.asc
Is this ok [y/N]: y
Microsoft SQL Server 2022 29 kB/s | 34 kB 00:01
Dependencies resolved.
Nothing to do.
Complete!
Step 3: Install MS SQL Server 2022 on Amazon Linux 2023
The SQL Server installation on Amazon Linux and any other Linux distribution has the following system requirements:
Requirement | Required |
---|---|
Memory | 2 GB |
File System | XFS or EXT4 (other file systems, such as BTRFS, are unsupported) |
Disk space | 6 GB |
Processor speed | 2 GHz |
Processor cores | 2 cores |
Processor type | x64-compatible only |
Ensure your system meets the following requirements for the installation to be successful.
Then run the following commands to install SQL Server:
sudo yum install mssql-server
Accept installation prompt to proceed.

Agree to import the GPG key:
Microsoft SQL Server 2022 2.6 kB/s | 983 B 00:00
Importing GPG key 0xBE1229CF:
Userid : "Microsoft (Release signing) <[email protected]>"
Fingerprint: BC52 8686 B50D 79E3 39D3 721C EB3E 94AD BE12 29CF
From : https://packages.microsoft.com/keys/microsoft.asc
Is this ok [y/N]: y
Step 4: Install the libldap
Library and openSSL
Run the following to install the libldap
library:
sudo yum install openldap openldap-clients openldap-devel
Then install openssl
by bulding it from source as follows:
sudo yum install -y wget perl unzip gcc zlib-devel
mkdir /tmp/openssl
cd /tmp/openssl
wget https://www.openssl.org/source/openssl-1.1.1s.tar.gz
tar xzvf openssl-1.1.1s.tar.gz
cd openssl-1.1.1s
./config --prefix=/usr/local/openssl11 --openssldir=/usr/local/openssl11 shared zlib
make
sudo make install
sudo bash -c "echo /usr/local/openssl11/lib/ >> /etc/ld.so.conf"
sudo ldconfig
Step 5: Configure MS SQL Server 2022 on Amazon Linux 2023
After the installation you’ll need to run mssql-conf setup
and follow the prompts to to complete the setup of Microsoft SQL Server:
sudo /opt/mssql/bin/mssql-conf setup
Choose MS SQL Server edition:
Choose an edition of SQL Server:
1) Evaluation (free, no production use rights, 180-day limit)
2) Developer (free, no production use rights)
3) Express (free)
4) Web (PAID)
5) Standard (PAID)
6) Enterprise (PAID) - CPU core utilization restricted to 20 physical/40 hyperthreaded
7) Enterprise Core (PAID) - CPU core utilization up to Operating System Maximum
8) I bought a license through a retail sales channel and have a product key to enter.
9) Standard (Billed through Azure) - Use pay-as-you-go billing through Azure.
10) Enterprise Core (Billed through Azure) - Use pay-as-you-go billing through Azure.
Details about editions can be found at
https://go.microsoft.com/fwlink/?LinkId=2109348&clcid=0x409
Use of PAID editions of this software requires separate licensing through a
Microsoft Volume Licensing program.
By choosing a PAID edition, you are verifying that you have the appropriate
number of licenses in place to install and run this software.
By choosing an edition billed Pay-As-You-Go through Azure, you are verifying
that the server and SQL Server will be connected to Azure by installing the
management agent and Azure extension for SQL Server.
Enter your edition(1-10): 2
Then accept the license agreement:
The license terms for this product can be found in
The license terms for this product can be found in
/usr/share/doc/mssql-server or downloaded from: https://aka.ms/useterms
The privacy statement can be viewed at:
https://go.microsoft.com/fwlink/?LinkId=853010&clcid=0x409
Do you accept the license terms? [Yes/No]: yes
Next set SQL Server system administrator password:
Enter the SQL Server system administrator password:
Confirm the SQL Server system administrator password:
Setup should be completed in a short while.
Configuring SQL Server...
ForceFlush is enabled for this instance.
ForceFlush feature is enabled for log durability.
Setup has completed successfully. SQL Server is now starting.
Verify that the service is running after the configurations are done.

Step 6: Install the MS SQL Server Client tools on Amazon Linux 2023
You need SQL Server command-line tools to connect to the database server and perform operations such as database creation.
Start by downloading the Microsoft Red Hat repository configuration file:
sudo curl https://packages.microsoft.com/config/rhel/8/prod.repo -o /etc/yum.repos.d/msprod.repo
Run the following commands to install mssql-tools
with the unixODBC
developer package.
sudo yum install mssql-tools unixODBC-devel

For convenience, add /opt/mssql-tools/bin/
to your PATH environment variable. This enables you to run the tools without specifying the full path
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrc
You should now be able to connect locally to the Database Server:
sqlcmd -S localhost -U SA -P '<YourPassword>'
You can omit the password on the command line to be prompted to enter it.
$ sqlcmd -S localhost -U SA
Password:
1>
Type QUIT to exit SQL Server terminal session.
1> QUIT
After a successful installation of MS SQL Server 2022 on Amazon Linux 2023, review the best practices for configuring Linux and SQL Server to improve performance for production scenarios. Read through the Performance best practices and configuration guidelines for SQL Server on Linux guide.
More guides on Amazon Linux: