LLI Wiki — My Digital Knowledge Base

Installing SQL Server 2019 on Ubuntu 20.04

Steps to install SQL Server 2019 on Ubuntu 20.04 from the Microsoft repository, then check the service and connect.

These are the steps to install SQL Server 2019 on Ubuntu 20.04 from the Microsoft package repository, then connect to the instance from SQL Server Management Studio (SSMS). The current instructions are on Microsoft Learn.

  1. Import the Microsoft signing key.

    wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
    
  2. Add the SQL Server 2019 repository for Ubuntu 20.04.

    sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/20.04/mssql-server-2019.list)"
    
  3. Refresh the package index and install the server.

    sudo apt-get update
    sudo apt-get install -y mssql-server
    
  4. Run the setup, which asks for the edition and the SA password.

    sudo /opt/mssql/bin/mssql-conf setup
    
  5. Check that the service runs.

    systemctl status mssql-server --no-pager
    
  6. Get the IP address of the host.

    hostname -I
    
  7. Connect from SSMS with that IP address.

Notes

Mastodon LLIMastodon SocialFosstodon