Microsoft in the year 2016 announced their plans to bring MS SQL Server to Linux. Microsoft SQL is an open-source relational database system available for production workloads in RHEL and other Linux distributions. Ms SQL server 2019 builds on previous releases of grow SQL Server as a platform. This gives one choices of data types, development languages, on-premises or cloud environments, and operating systems.

Miscrosoft SQL server 2019 has the following features:

  • It has an intelligent database built on previous innovations on previous versions.
  • It has an Intelligent Query Processing.
  • It has an intelligent performance that ensures is runs faster. These improvement helps provide predictable performance across all workloads.
  • Improvement in monitoring that enables unlock performance insights over a database workload
  • It provides a world class developer experience with improvements in graph and spatial data types and UTF-8 support
  • Has unicode support feature.
  • Highly available
  • Has resumable operations
  • Can be deployed in containers in a safer manner and with more functionality
  • Offers MS SQL server Machine Learning Services

This article illustrates how to install and configure Microsoft SQL Server 2019 on Rocky Linux 8.

Before installation, ensure the following requirements are met:

  • Minimum memory of 3 GB
  • Minimum of 10 GB of available hard-disk space
  • CPU processor with a minimum speed of 1.4 GHz. But the recommended is >= 2 GHz

Having met the requirements, we can proceed to install and comfigure Microsoft SQL Server 2019 on Rocky Linux 8 with the below steps.

Step 1: Add Microsoft SQL Server 2019 repository

Ms SQL server is available in Red Hat repositories which are added manually as below:

sudo curl -o /etc/yum.repos.d/mssql-server-2019.repo 
sudo  curl -o /etc/yum.repos.d/msprod.repo

Step 2: Install Microsoft SQL server on Rocky Linux 8

With the required repositories added, proceed and install Ms SQL server on Rocky Linux 8.

sudo dnf -y install mssql-server


Dependencies resolved.
 Package         Arch   Version              Repository              Size
 mssql-server    x86_64 15.0.4138.2-1        packages-microsoft-com-mssql-server-2019
                                                                    232 M
Installing dependencies:
 cpp             x86_64 8.4.1-1.el8          appstream               10 M
 gc              x86_64 7.6.4-3.el8          appstream              108 k
 gcc             x86_64 8.4.1-1.el8          appstream               23 M
 gdb             x86_64 8.2-15.el8           appstream              297 k
 gdb-headless    x86_64 8.2-15.el8           appstream              3.7 M
 glibc-devel     x86_64 2.28-151.el8         baseos                 1.0 M
 glibc-headers   x86_64 2.28-151.el8         baseos                 477 k
 guile           x86_64 5:2.0.14-7.el8       appstream              3.5 M
 isl             x86_64 0.16.1-6.el8         appstream              834 k
 kernel-headers  x86_64 4.18.0-305.7.1.el8_4 baseos                 7.1 M
 libatomic_ops   x86_64 7.6.2-3.el8          appstream               37 k
 libbabeltrace   x86_64 1.5.4-3.el8          baseos                 199 k
 libipt          x86_64 1.6.1-8.el8          appstream               49 k
 libxcrypt-devel x86_64 4.1.1-4.el8          baseos                  24 k
Installing weak dependencies:
 gcc-gdb-plugin  x86_64 8.4.1-1.el8          appstream              116 k

Transaction Summary
Install  16 Packages

Step 3: Install SQL Server command-line tools

Then we proceed and install MS SQL tools on Rocky Linux 8 as below.

sudo yum -y install mssql-tools unixODBC-devel 

Agree to the License prompt:

The license terms for this product can be downloaded from and found in
/usr/share/doc/msodbcsql17/LICENSE.txt . By entering 'YES',
you indicate that you accept the license terms.

Do you accept the license terms? (Enter YES or NO)
 Installing       : msodbcsql17-                          1/3 
  Running scriptlet: msodbcsql17-                          1/3 
  Running scriptlet: mssql-tools-                          2/3 
The license terms for this product can be downloaded from and found in
/usr/share/doc/mssql-tools/LICENSE.txt . By entering 'YES',
you indicate that you accept the license terms.

Do you accept the license terms? (Enter YES or NO)

Confirm your installtion with:

$ rpm -qi mssql-server
Name        : mssql-server
Version     : 15.0.4138.2
Release     : 1
Architecture: x86_64
Install Date: Wed 07 Jul 2021 12:42:22 PM EAT
Group       : Unspecified
Size        : 1162993815
License     : Commercial
Signature   : RSA/SHA256, Sat 29 May 2021 12:51:25 PM EAT, Key ID eb3e94adbe1229cf
Source RPM  : mssql-server-15.0.4138.2-1.src.rpm
Build Date  : Sat 29 May 2021 10:54:07 AM EAT
Build Host  : hls-rhel8-1-prod-build-rhel8-03
Relocations : (not relocatable)
Summary     : Microsoft SQL Server Relational Database Engine
Description :
The mssql-server package contains the Microsoft SQL Server Relational Database Engine.

$ rpm -qi mssql-tools
Name        : mssql-tools
Version     :
Release     : 1
Architecture: x86_64
Install Date: Wed 07 Jul 2021 12:44:52 PM EAT
Group       : Applications/Driver
Size        : 724327
License     :
Signature   : RSA/SHA256, Wed 20 Jan 2021 12:17:46 AM EAT, Key ID eb3e94adbe1229cf
Source RPM  : mssql-tools-
Build Date  : Fri 15 Jan 2021 10:56:51 PM EAT
Build Host  :
Relocations : (not relocatable)
Packager    : Microsoft SQL Tools Team <[email protected]>
Summary     : Tools for Microsoft(R) SQL Server (R)
Description :
This Package contains tools for Microsoft(R) SQL Server(R)

Step 4: Start MS SQL Database Engine.

With a successful installation, we now run our Database Engine. Follow the below steps:

Set a password on prompt

sudo /opt/mssql/bin/mssql-conf setup

Then you are required to select an edition. I selected option 2_Developer (free, no production use rights)

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.

Details about editions can be found at

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.

Enter your edition(1-8): 2

Accept The License terms

The privacy statement can be viewed at:

Do you accept the license terms? [Yes/No]:yes

Then set your server system administrator password:

Enter the SQL Server system administrator password: 
Confirm the SQL Server system administrator password: 
Configuring SQL Server...

ForceFlush is enabled for this instance. 
ForceFlush feature is enabled for log durability.
Created symlink /etc/systemd/system/ → /usr/lib/systemd/system/mssql-server.service.
Setup has completed successfully. SQL Server is now starting.

Enable MS-SQL server and set to run on boot:

$ systemctl status mssql-server.service 
 mssql-server.service - Microsoft SQL Server Database Engine
   Loaded: loaded (/usr/lib/systemd/system/mssql-server.service; enabled; vendo>
   Active: active (running) since Wed 2021-07-07 13:31:26 EAT; 2min 55s ago
 Main PID: 2746 (sqlservr)
    Tasks: 117
   Memory: 659.2M
   CGroup: /system.slice/mssql-server.service
           ├─2746 /opt/mssql/bin/sqlservr
           └─2772 /opt/mssql/bin/sqlservr

$ systemctl is-enabled mssql-server.service

Then export your path /opt/mssql/bin/ as below

echo 'export PATH=$PATH:/opt/mssql/bin:/opt/mssql-tools/bin' | sudo tee /etc/profile.d/

Then source the file to use MS SQL binaries

source /etc/profile.d/

Allow SQL server ports for remote hosts

$ sudo  firewall-cmd --add-port=1433/tcp --permanent
$ sudo firewall-cmd --reload

Step 5: Test MS SQL server 2019 on Rocky Linux 8

With all the configurations set. We will now test our SQL server. Connect to the server as below:

$ sqlcmd -S localhost -U SA

Authenticate with the password you set earlier and proceed as below.

1> select name from sysusers;
2> go

(16 rows affected)

Create a Database In MS SQL 2019.

This is an example of how to a database in MS SQL 2019.

2> SELECT Name from sys.Databases
3> GO

(5 rows affected)
1> USE mytestDB
2> CREATE TABLE Inventory (id INT, name NVARCHAR(50), quantity INT)
3>  VALUES (1, 'banana', 150); INSERT INTO Inventory VALUES (2, 'orange', 154);
4> GO
Changed database context to 'mytestDB'.

(1 rows affected)

Show databases in MS SQL as below:

1> select name,database_id from sys.databases;
2> GO
 name          database_id
------------- -----------
master                  1
tempdb                  2
model                   3
msdb                    4
testDB                  5
(5 rows affected)                                                                                                                        

To drop a database in MS SQL use the command:

2> GO

Use Exit to terminate MS SQL database server



In this article, I have demonstrated how to install, configure, create and drop databases in Microsoft SQL server 2019 on Rocky Linux 8. I hope this helped you.

View related articles on our page.

Install Microsoft SQL Server (MSSQL) 2019 on Amazon Linux 2

Install PostgreSQL 12 on Oracle Linux 8

How To Install NetBeans 12 IDE on Rocky Linux 8


Please enter your comment!
Please enter your name here