Microsoft SQL Server is compatible with Ubuntu 24.04. Below is the guide to install it under this Linux distribution:
1. Import the Microsoft GPG key
bash
sudo apt install curl # if you don't have curl already installed
curl-fsSL https://packages.microsoft.com/keys/microsoft.asc |sudogpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg
2. Add the SQL Server 2025 repository for Ubuntu 24.04
bash
curl-fsSL https://packages.microsoft.com/config/ubuntu/24.04/mssql-server-2025.list |sudo tee/etc/apt/sources.list.d/mssql-server-2025.list
3. Install SQL Server
bash
sudo apt-get update
sudo apt-get install -y mssql-server4. Run setup
bash
sudo /opt/mssql/bin/mssql-conf setupNOTE: after step 4, select the required edition, accept the licence terms, and set the system administrator (SA) password.
5. Install command-line tools
You can install the ODBC driver and tools like this:
bash
curl-sSL -O https://packages.microsoft.com/config/ubuntu/$(grep VERSION_ID /etc/os-release | cut -d '"' -f 2)/packages-microsoft-prod.debsudodpkg -i packages-microsoft-prod.debrmpackages-microsoft-prod.debsudo apt-getupdatesudo apt-get install-y msodbcsql18 mssql-tools18 unixodbc-devecho 'export PATH="$PATH:/opt/mssql-tools18/bin"'>> ~/.bashrcsource~/.bashrc
6. Verify it's running
bash
systemctl status mssql-server --no-pager
If the service is running, you can start connecting using the IP with SQL Server Management Studio or any other
database editor (ex. DBeaver)