Home » Getting started with SQL Server 2025 on Ubuntu 24.04

Getting started with SQL Server 2025 on Ubuntu 24.04

by Vlad Drumea
0 comments 5 minutes read

Previously I’ve set up an Ubuntu 24.04 VM, so I figured I’d cover the process of setting up SQL Server 2025 on Ubuntu 24.04.

The post is mainly aimed toward readers who want to start using SQL Server on Linux or who want to test the newest features.

Installing SQL Server 2025 on Ubuntu 24.04 LTS

These steps are performed over SSH, but they work identically in a local terminal.

Since curl is required for the upcoming commands, I’ll first have to install it.

Fetch Microsoft’s public signing key, convert it from ASCII‑armored format to GPG binary format, and store it in a location that’s later referenced by APT source list entries to verify packages signed by Microsoft.

Then I register the repository for Microsoft SQL Server 2025 on Ubuntu 24.04.

Now, that all that’s done, I can go ahead and install SQL Server 2025.

At this point, SQL Server 2025 on Ubuntu just needs to be configured before I can start using it.

The interactive setup process is fairly straight-forward.

terminal windows showing the initial configuration process of SQL Server 2025 on Ubuntu

It prompts for the following:

  1. The Edition of SQL Server 2025 I want to use. In this case I specify 2 for Enterprise Developer.
  2. To accept the license terms. In which case I type Yes
  3. The system administrator (sa) password.

Once the setup finishes, I can check the status of the newly installed SQL Server instance.

terminal window showing that the mssql-server service is enabled and running

Note that the mssql-conf tool isn’t useful only during the initial setup.
It can be used to set or change various SQL Server configuration options, including to reset the sa password and even change the edition of your instance.

Installing the command-line tools

Once SQL Server is up and running, I can also install the SQL Server command line tools.

First, download the Microsoft repository package for Ubuntu 24.04.

Install the repository package.

Now, I can install the latest command-line tools for SQL Server on Linux.

During the installation, I get the following prompts to accept EULA.

In both cases, I select Yes and press Enter.

Once the installation finishes, all that’s left to do is add the path to the newly installed binaries in the PATH variable of both .bash_profile and .bashrc and reload the two files.

This is needed to avoid the command not found error, which occurs when paths of the mssql-tools binaries aren’t added to PATH.

At this point, I can use sqlcmd to connect to the instance.

Note:

  1. I use the -C option to avoid the SSL certificate error 1416F086.
  2. -S . (dot) is equivalent to -S localhost.

Once I provide the password for the sa login, I can validate that this is indeed SQL Server 2025.


Post-install configuration

While I’m connected via sqlcmd, I take the opportunity to also set some configuration values that are more in line with the VM’s resources.

In this case I set the following:

  • Max memory to 4GB (half of what the VM has allocated). This should be enough for the time being, and I can always bump it up after allocating more RAM to the VM.
  • CTP to 50, which is more realistic as opposed to the default of 5, which was decided on hardware from 30 years ago.
  • Enable backup compression. This is just in case I ever want to take a backup of database.

Restoring AdventureWorks2025

For the OS level steps I’ll first switch user to mssql.

I do this because that’s the user that owns (and as a result has full permissions over) the instance’s root directory, and also to avoid file access issues when restoring the backup.

The instance’s root directory doesn’t contain a backup sub-directory.

So I create it.

And I can now use that directory to store the .bak file after downloading it.

At this point I can switch back to my user account.

Now, I need to get the logical file names from the .bak file in order to create the restore command.

Looks like the data file’s logical name is AdventureWorks and the log file’s is AdventureWorks_log.
Resulting in the following restore command:

And I can do a quick check to validate that the AdventureWorks2025 database is now available and online on the instance.


Connecting through SSMS

I can also use SSMS to connect from my host machine to the SQL Server 2025 instance running on my Ubuntu 24.04 LTS VM.


Conclusion

You now have a fully functional SQL Server 2025 instance on Ubuntu 24.04, equipped with the command‑line tools and a restored sample database. From here you can begin developing, testing, or benchmarking workloads on the latest SQL Server release.

You may also like

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.