Skip to main content

Biggest Software Deals! Use Code SD15 For Extra 15% Off

Sidebar
How can I Install Microsoft SQL Server on Ubuntu and Windows?

How can I Install Microsoft SQL Server on Ubuntu and Windows?

8th Jun 2022

Microsoft SQL Server is capable of developing business-critical applications. It is designed to help IT specialists, and developers, manage databases. Being famous for the Windows platform, it is not limited to just that.  Microsoft SQL Server Download software offers the deployment to Linux and Docker containers. With that, the brand aims to compete with MySQL and Oracle databases.

As we know, Windows is the default operating system for SQL Server. And so, you need to download Ubuntu to use the SQL Server on the Linux container. Here we cover the installation guide for Ubuntu, a Linux-based operating system. To install Microsoft SQL Server on Windows, you need to buy the license key. Because the free installation is only available for Developer and Express editions.

Quick Tutorial to Install Microsoft SQL Server on Ubuntu

Installation requires you to follow specific prerequisites. This tutorial provides the steps to configure SQL Server on Ubuntu. You need an Ubuntu 16.04, 18.04, or 20.04 machine with a minimum of 2 GB of memory.  Download Microsoft SQL Server 2019 to get the valid product key at a competitive price. It will help you get started with using the SQL Server on the Linux platform. Following the three parts, you can successfully install and use the SQL server 2019 on Ubuntu.

Part I: Configure SQL Server on Ubuntu

Run the mentioned commands in a terminal to install the mssql-server.

Step1: Import the public repository GPG keys with

Step2: Register the Microsoft SQL Server Ubuntu sudo add-apt-repository followed by $(wget -qO- https://packages.microsoft.com/config/ubuntu/16.0... for SQL Server 2019:

For Ubuntu 16.04:

For Ubuntu 18.04:

For Ubuntu 20.04:

Step3: Next, use the commands:

Step4: After the package installation finishes, run mssql-conf setup and follow the prompts to set the SA password and choose your edition.

To set up the password, make sure to use a minimum of 8 length characters. It must include uppercase and lowercase letters, base ten digits, or non-alphanumeric symbols.

Step5: Once the configuration is done, verify that the service is running:

Step6: If you plan to connect remotely, you might also need to open the SQL Server TCP port (default 1433) on your firewall.

Following the above steps your Ubuntu machine is ready to use!

Part II: Install command-line tools to create a database

To create a database, you need to run Transact-SQL statements on the SQL Server. It requires you to connect with a tool such as command-line tools: sqlcmd and bcp. Follow the below commands to install the mssql-tools on Ubuntu.

Step1: But first, install curl with the command “sudo apt-get update

sudo apt install curl” if you already have, skip this step.

Step2: You need to import the public repository GPG keys. For that type:

Step3: Next, Register the Microsoft Ubuntu repository with

For Ubuntu 16.04:

For Ubuntu 18.04:

For Ubuntu 20.04:

Step4: Lastly, you need to update the sources list and run the installation command. Use the unixODBC developer pack:-

Part III: Connect locally

To connect locally to your SQL Server instance in Linux container, use sqlcmd .

Use parameters for SQL Server name (-X), the user name (-Y), and the password (-Z) to run sqlcmd. With this, you will start connecting locally to the server name for reference localhost. Use the user name as SA, and the password is the one you will set for the SA account during the setup stage.

It will be like: sqlcmd XS localhost -Y SA -Z '<YourPassword>'

With this, you can successfully connect locally. If it runs properly, it fetches an sqlcmd command prompt: 1>. In case of failure, you need to check your connection or refer to troubleshooting.

What’s next?

Further, refer to our professional team for any query on  SQL Server 2019 Licensing Guide. For instance, the tutorial to Install Microsoft SQL Server on Windows is available when purchasing the product. After you buy SQL Server, you will receive an email with the necessary information. But if you face any trouble at any step, we are just a call away. We are a certified Microsoft partner and can help you with everything related to the brand’s products. Our expertise goes beyond supplying the software at competitive rates. We are known for post-sales support that will prove helpful to you.

Recently Viewed

Top