DEV Community

Seffu Kioi Nyambura
Seffu Kioi Nyambura

Posted on

Install SQL Server in Ubuntu

Microsoft SQL Server is one of the most prominent databases in the industry today. In this post, I will show you how to install it on Ubuntu.

Prerequisites

  • Account with sudo privileges

Procedure:

Step 1: Open terminal
Use the shortcut Ctrl + alt + t to open the terminal

Step 2: Import the public repository GPG keys

wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
Enter fullscreen mode Exit fullscreen mode

import
Step 3: Register the Microsoft SQL Server Ubuntu repository for SQL Server 2019

sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/20.04/mssql-server-2019.list)"
Enter fullscreen mode Exit fullscreen mode

download
Step 4: Install SQL Server

sudo apt update && sudo apt install -y mssql-server
Enter fullscreen mode Exit fullscreen mode

install
Step 5: Follow the prompts to choose your edition, accept license terms and set the SA password.

sudo /opt/mssql/bin/mssql-conf setup
Enter fullscreen mode Exit fullscreen mode

setup
Step 6: Verify that the service is running

systemctl status mssql-server --no-pager
Enter fullscreen mode Exit fullscreen mode

status

Next Step:

Install SQL Server command-line tools

Top comments (0)