How to install SQL Server on Ubuntu


System Requirements

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

Step 1 Update

$ sudo apt update && sudo apt upgrade

Step 2 Install GPG Public key

$ sudo wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -

Step 3 Add the repository

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

Step 4 Install MS SQL Server

$ sudo apt install mssql-server -y

Step 5 Setup

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

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/43715d6b-ee46-451d-8fde-db894e98ddc1/Untitled.png

Check service running

$ systemctl status mssql-server
...
● mssql-server.service - Microsoft SQL Server Database Engine
     Loaded: loaded (/lib/systemd/system/mssql-server.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2021-03-17 09:16:44 UTC; 5s ago
       Docs: https://docs.microsoft.com/en-us/sql/linux
   Main PID: 72768 (sqlservr)
      Tasks: 134
     Memory: 613.6M
     CGroup: /system.slice/mssql-server.service
             ├─72768 /opt/mssql/bin/sqlservr
             └─72818 /opt/mssql/bin/sqlservr
....