---
title: SQL Server 2017 on Ubuntu
description: As we know that SQL server is primarily used in a majority of Windows based systems worldwide. Due to its robust nature, it was a preferred database to be used in major applications and their frameworks capitulating the opponents. Majorly it did not provide support towards Linux based operating systems.
---

[![e-Zest logo\_An accion lab company\_Colour](https://blog.e-zest.com/hubfs/images/Logos%20with%20Tagline/Corporate/SVG/e-Zest%20logo_An%20accion%20lab%20company_Colour.svg "e-Zest logo_An accion lab company_Colour")](https://www.e-zest.com/)

- [WORK](https://www.e-zest.com/our-work)
- [SERVICES](https://www.e-zest.com/our-services) 
    - [Product Engineering](https://www.e-zest.com/digital-product-engineering-services)
    - [Enterprise Data Services](https://www.e-zest.com/enterprise-data-services)
    - [Digital Commerce](https://www.e-zest.com/digital-commerce-services)
    - [Digital Operations](https://www.e-zest.com/digital-operations)
    - [Digital Consulting](https://www.e-zest.com/digital-transformation-consulting-services)
    - [Digital Experience Design](https://www.e-zest.com/digital-experience-design)
- [INSIGHTS](https://blog.e-zest.com/)
- [CAREERS](https://www.e-zest.com/careers)
- [ENTERPRISE DATA SERVICES](https://www.e-zest.com/enterprise-data-services)
- [GENERATIVE AI](https://www.e-zest.com/generative-ai)
- [Healthcare](https://healthcare.e-zest.com)
- [Contact Us](https://www.e-zest.com/contact-us)

- ![Elevating Product Engineering with AI and ML](https://blog.e-zest.com/hubfs/Elevating%20Product%20Engineering%20with%20AI%20and%20ML.jpg)

  [BLOGS](https://blog.e-zest.com)
  
  #### Elevating Product Engineering with AI and ML

  As technology evolves and customer choices broaden, there is an increasing ...

  [Read more](https://blog.e-zest.com/elevating-product-engineering-with-ai-and-ml)
- ![e-Zest – An Accion Labs Company gets Recognition as a Contender in the ISG Provider Lens™ Study on Digital Engineering Services 2024](https://blog.e-zest.com/hubfs/e-Zest%20%E2%80%93%20An%20Accion%20Labs%20Company%20-%20Gets%20Recognition%20as%20a%20Contender%20in%20the%20ISG%20Provider%20LensTM%20Study%20on%20Digital%20Engineering%20Services%202024.jpg)

  [NEWS](https://blog.e-zest.com/news)
  
  #### e-Zest – An Accion Labs Company gets Recognition as a Contender in the ISG Provider Lens™ Study on Digital Engineering Services 2024

  We are delighted to announce that e-Zest – An Accion Labs Company has been ...

  [Read more](https://blog.e-zest.com/news/e-zest-an-accion-labs-company-gets-recognition-as-a-contender-in-the-isg-provider-lens-study-on-digital-engineering-services-2024)
- ![e-Zest Solutions supports Digital Pune Mission](https://blog.e-zest.com/hubfs/blog-files/Digital%20Literacy%20Bus%20e-Zest.png)

  [CSR](https://blog.e-zest.com/csr)
  
  #### e-Zest Solutions supports Digital Pune Mission

  **Pune, India:** e-Zest Solutions, a leading digital technology innovation ...

  [Read more](https://blog.e-zest.com/csr/e-zest-solutions-supports-digital-pune-mission)

- [Work](https://www.e-zest.com/our-work)
- [Services](https://www.e-zest.com/our-services)
- [Insights](https://blog.e-zest.com)
- [Careers](https://www.e-zest.com/careers)
- [Enterprise Data](https://www.e-zest.com/enterprise-data-services)
- [Generative AI](https://www.e-zest.com/generative-ai)
- [Innovations](https://www.e-zest.com/innovations)
- [Healthcare](https://healthcare.e-zest.com)
- [About](https://www.e-zest.com/about-us)
- [Contact](https://www.e-zest.com/contact-us)

- [Blog](https://blog.e-zest.com/)
- [News](https://blog.e-zest.com/news)
- [CSR](https://blog.e-zest.com/csr)

- [![Linkedin Icon](https://blog.e-zest.com/hubfs/icons/linkedin_icon_white.svg)](https://www.linkedin.com/company/e-zest-solutions/)
- [![Twitter Icon](https://blog.e-zest.com/hubfs/twitter-logo-silhouette%20(5).svg)](https://twitter.com/ezest)
- [![Facebook Icon](https://blog.e-zest.com/hubfs/facebook-app-logo%20(4).svg)](https://www.facebook.com/61259256638)
- [![Instagram Icon](https://blog.e-zest.com/hubfs/instagram-logo%20(4).svg)](https://www.instagram.com/ezestsolutions/)
- [![Youtube Icon](https://blog.e-zest.com/hubfs/icons/youtube_icon_white.svg)](https://www.youtube.com/user/ezestcorporate)

[![Go to top icon](https://blog.e-zest.com/hubfs/AA%20Assets/top%20button.svg)](https://blog.e-zest.com/sql-server-2017-on-ubuntu#top)

Hit enter to search or ESC to close

Insights

e-Zest members share technology ideas to foster digital transformation.

- [Blog](https://blog.e-zest.com)
- [News](https://blog.e-zest.com/news)
- [Podcasts](https://www.e-zest.com/podcasts)
- [Healthcare](https://blog.e-zest.com/healthcare)
- [CSR](https://blog.e-zest.com/csr)
- [Whitepaper](https://blog.e-zest.com/whitepaper)
- [Playbook](https://blog.e-zest.com/playbook)
- [Media Kit](https://www.e-zest.com/media-kit)

# SQL Server 2017 on Ubuntu

[Amey Chhatre](https://blog.e-zest.com/author/amey-chhatre)  Jan 29, 2018

[Ubuntu](https://blog.e-zest.com/topic/ubuntu) [SQL server 2017](https://blog.e-zest.com/topic/sql-server-2017)

- <https://www.linkedin.com/shareArticle?mini=true&url=https://blog.e-zest.com/sql-server-2017-on-ubuntu&title=&summary=&source=>
- <https://twitter.com/intent/tweet?source=https://blog.e-zest.com/sql-server-2017-on-ubuntu&text=SQL%20Server%202017%20on Ubuntu>
- <https://www.facebook.com/sharer/sharer.php?u=https://blog.e-zest.com/sql-server-2017-on-ubuntu>
- <https://www.instagram.com/ezestsolutions/?u=https://blog.e-zest.com/sql-server-2017-on-ubuntu>

As we know that SQL server is primarily used in a majority of Windows based systems worldwide. Due to its robust nature, it was a preferred database to be used in major applications and their frameworks capitulating the opponents. Majorly it did not provide support towards Linux based operating systems.

Thereafter taking into consideration this point, Microsoft announced a launch of SQL Server 2017. With this launch, Microsoft effectively resolved the complications arising from the previous module of the application. It could now be run on Linux operating system.

Additionally, SQL Server 2017 images on Linux and Windows are now available in Azure Marketplace!

**Why run SQL Server on an Azure Virtual Machine?**

SQL Server 2017 is the first release which is available on Linux. In addition to Windows where there are choices of running SQL Server on virtual machines based on Linux, Red Hat Enterprise Linux, SUSE Enterprise Linux Sever and Ubuntu.

There are some advantages of running SQL Server in Azure:

Cloud flexibility  
Tuned for performance  
Hybrid connectivity  
Highly-secured and trusted application

How to configure SQL Server on Ubuntu Server?  
For configuration of the SQL Server on Ubuntu first we need to setup a virtual machine. This is easy. Use the Azure Portal and create a virtual machine using SQL Server 2017 Developer on Ubuntu Server image. For this blog I have used Ubuntu Linux but you can use Red Hat or Suse Linux as well.

**![sql-server-2017-developer.png](https://blog.e-zest.com/hs-fs/hubfs/sql-server-2017-developer.png?width=716&height=430&name=sql-server-2017-developer.png)**

After successfully creating the VM, we need to change network Firewall settings to allow external access to MSSQL Service and for this we should add the inbound and outbound security rule.

**![add-inbound-security-rule.png](https://blog.e-zest.com/hs-fs/hubfs/add-inbound-security-rule.png?width=716&height=403&name=add-inbound-security-rule.png)**

**![add-outbound-security-rule.png](https://blog.e-zest.com/hs-fs/hubfs/add-outbound-security-rule.png?width=716&height=317&name=add-outbound-security-rule.png)**

 After these settings it’s time to connect Ubuntu VM. For this you can choose any SSH client, but in this blog I am using Putty to connect VM. After entering into the VM it will ask for your username and password. If you forgot your username or password then you have to change it manually using Azure portal. So don’t forgot your username and password.

**![putty-configuration.png](https://blog.e-zest.com/hs-fs/hubfs/putty-configuration.png?width=457&height=445&name=putty-configuration.png)**  
**![ladmin.png](https://blog.e-zest.com/hs-fs/hubfs/ladmin.png?width=662&height=416&name=ladmin.png)**  
After entering into the VM your journey starts with Linux commands. Run the below commands to check the status of SQL Server.

- sudo su
- sudo systemctl status mssql-server

**![ladmin-1.png](https://blog.e-zest.com/hs-fs/hubfs/ladmin-1.png?width=662&height=416&name=ladmin-1.png)**

**![ladmin-2.png](https://blog.e-zest.com/hs-fs/hubfs/ladmin-2.png?width=716&height=517&name=ladmin-2.png)**

**![ladmin-3.png](https://blog.e-zest.com/hs-fs/hubfs/ladmin-3.png?width=716&height=481&name=ladmin-3.png)**

 Once password is setup, SQL Server 2017 will automatically run and you can check the status of SQL Server using the earlier used command. Surely the status is active.

- sudo systemctl status mssql-server

**![ladmin-4.png](https://blog.e-zest.com/hs-fs/hubfs/ladmin-4.png?width=716&height=431&name=ladmin-4.png)**

Now we are ready with the running SQL Server.

Run SQLCMD utility to connect SQL Server and Server version

- sqlcmd -S localhost -U sa -P \*\*\*\*\*\*\*\*\*\*\*\*

In this command put username sa and your password after -P to run the command.  
Note - If you are facing this error line then follow these steps,

sqlcmd: command not found

Steps-

1\) sudo su ”  
 // make sure that have mssql-tools installed

2\) sudo apt-get install mssql-tools

3\) ls /opt/mssql-tools/bin/sqlcmd\*  
 // After you get the name of the tool you can create a symlink.

4\) ln -sfn /opt/mssql-tools/bin/sqlcmd /usr/bin/sqlcmd  
Run “ SELECT @@VERSION ” to see SQL Server version and after clicking “enter” run “GO” command and to terminate the operation press ctrl + c

**![ladmin-5.png](https://blog.e-zest.com/hs-fs/hubfs/ladmin-5.png?width=663&height=325&name=ladmin-5.png)**  
Now connect using SQL Server Management Studio 2017 and for connection use VM’s Public IP Address for servername and to log in use “SA” as the username and previously provisioned password.

Note: SSMS 2014 version is not supported to design database diagrams or tables.

**![connect-to-server.png](https://blog.e-zest.com/hs-fs/hubfs/connect-to-server.png?width=475&height=316&name=connect-to-server.png)**  
After this successful connection you are free to create databases, database objects, and tables.

Also you can take backup and restore using the Linux commands as there is no need to take this manually.

For taking backup of the database use the following command

sqlcmd -S localhost -U SA -Q "BACKUP DATABASE \[your db name\] TO DISK = N'/var/opt/mssql/data/\*\*\*\*\*.bak'"

\*\*\*\*\* - Replace your bak file name

**![backup.png](https://blog.e-zest.com/hs-fs/hubfs/backup.png?width=660&height=193&name=backup.png)**

After taking backup successfully you can check the backup file “ /var/opt/mssql/data “ folder

**![demo1.png](https://blog.e-zest.com/hs-fs/hubfs/demo1.png?width=660&height=160&name=demo1.png)**

- For Restore of the database use the following command

 sqlcmd -S localhost -U SA -Q "RESTORE DATABASE \[your db name\] FROM DISK = N'/var/opt/mssql/data/\*\*\*\*\*.bak'"

Note- \*\*\*\*\* - Replace your bak file name

**![restore.png](https://blog.e-zest.com/hs-fs/hubfs/restore.png?width=659&height=402&name=restore.png)**  
**Summary**

As a conclusion, we cannot say that SQL Server is only supported on Windows platform but Microsoft has made life of the Linux developers simpler who wish to use SQL as the database by keeping the options to use SQL Server to work on the open source platform.

- <https://twitter.com/intent/tweet?source=https://blog.e-zest.com/sql-server-2017-on-ubuntu&text=SQL%20Server%202017%20on Ubuntu>
- <https://www.facebook.com/sharer/sharer.php?u=https://blog.e-zest.com/sql-server-2017-on-ubuntu>
- <https://www.linkedin.com/shareArticle?mini=true&url=https://blog.e-zest.com/sql-server-2017-on-ubuntu&title=&summary=&source=>

### Similar Blog

[![How to setup Docker Container for Magento 2](https://blog.e-zest.com/hubfs/How%20to%20setup%20Docker%20Container%20for%20Magento%202.jpg) How to setup Docker Container for Magento 2 Docker is an application that allows us to manage multiple applications in the simplest way in the docker container. Docker ... By Rajesh Rathod Oct 15, 2021](https://blog.e-zest.com/how-to-setup-docker-container-for-magento2)

[![Installing Kubernetes cluster on Ubuntu 16.04](https://blog.e-zest.com/hubfs/blog-files/azure-devops.png) Installing Kubernetes cluster on Ubuntu 16.04 **Introduction:**Use of containers for deploying applications and micro-services has been a common practice widely. Orchestration of ... By Nikhil Garge Jun 26, 2019](https://blog.e-zest.com/installing-kubernetes-cluster-on-ubuntu)

[![Install Docker on AWS EC2 (Ubuntu 16.04)](https://blog.e-zest.com/hubfs/install-docker-on-aws-ec2.png) Install Docker on AWS EC2 (Ubuntu 16.04) Docker is a program that can implement a virtualization on your machine and you can pull any image of Operating System and launch ... By Amit Tidke Nov 14, 2018](https://blog.e-zest.com/install-docker-on-aws-ec2)

[![Installing and setting HDFS cluster through Ambari](https://blog.e-zest.com/hubfs/blog-files/Installing%20and%20setting%20HDFS%20cluster%20through%20Ambari-181205.png) Installing and setting HDFS cluster through Ambari Apache Ambari is an open source management tool/platform for managing, provisioning, securing and monitoring the Hadoop Cluster. ... By Anagha Thorat Oct 31, 2018](https://blog.e-zest.com/installing-and-setting-hdfs-cluster-through-ambari)

## Helping Organizations Thrive in the Digital Age

[Contact Us](https://www.e-zest.com/contact-us)

- [About](https://www.e-zest.com/about-us)
- [Services](https://www.e-zest.com/our-services)
- [Work](https://www.e-zest.com/our-work)
- [Insights](https://blog.e-zest.com/)
- [Healthcare](https://healthcare.e-zest.com/)
- [Accion Labs](https://www.accionlabs.com/)

- <https://www.linkedin.com/company/e-zest-solutions/>
- <https://twitter.com/ezest>
- <https://www.facebook.com/eZest/>
- <https://www.instagram.com/ezestsolutions/>
- <https://www.youtube.com/user/ezestcorporate>

- Dallas
- Detroit
- Hannover
- Vienna
- London
- Pune

 © 2025 e-Zest Solutions

- [Privacy Policy](https://www.e-zest.com/privacypolicy)
- [Cookie Policy](https://www.e-zest.com/cookie-policy)

 Contact us

 Contact us

e-Zest is a leading digital innovation partner for enterprises and technology companies that utilizes emerging technologies for creating engaging customers experiences. Being a customer-focused and technology-driven company, it always helps clients in crafting holistic business value for their software development efforts. It offers software development and consulting services for cloud computing, enterprise mobility, big data and analytics, user experience and digital commerce.