Deploy MS SQL Server on Debian Linux

Prerequisites

  • Debian 9 or later
  • Root or sudo privileges

Step 1: Install curl

sudo apt-get update
sudo apt-get install curl

Step 2: Import the Microsoft GPG key

curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -

Step 3: Add the SQL Server repository

sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/debian/$(lsb_release -rs)/prod $(lsb_release -cs) main" > /etc/apt/sources.list.d/mssql-release.list'

Step 4: Install the SQL Server package

sudo apt-get update
sudo apt-get install -y mssql-server

Step 5: Run the SQL Server setup

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

Follow the prompts to complete the setup. You’ll need to set the edition (Developer, Express, etc.) and create a SQL Server system administrator password.

Step 6: Open the firewall for SQL Server

sudo ufw allow 1433/tcp
sudo ufw reload

Step 7: Verify the installation

systemctl status mssql-server

You should see an output indicating that the service is running.

Step 8: Connect to SQL Server

You can now connect to your SQL Server instance using tools like sqlcmd or SQL Server Management Studio (SSMS).

Other Recent Posts