LearnAI ToolsCareerPractice BuildsPlayContact
Lesson 419 min read

Installing SQL Server

Step-by-step instructions for installing SQL Server Express for free on Windows, verifying the install, and a look at Docker/Linux alternatives.

Introduction

Every lesson from here on assumes you have a working SQL Server instance to run queries against. This lesson walks through installing SQL Server itself — the database engine — on Windows, for free. Note that this installs only the engine; the graphical tool used to connect to it, SQL Server Management Studio, is a separate install covered in the next lesson.

Choosing an Edition

For this course, install either SQL Server Express or SQL Server Developer Edition — both are entirely free.

EditionDatabase Size LimitBest For
Express10 GB per databaseLearning, small personal projects
DeveloperUnlimited (same as Enterprise)Learning with the full feature set, non-production use
Recommendation

If you're not sure which to pick, choose Developer Edition — it's still free, has no practical size limits for learning, and includes every feature you'll see mentioned in advanced lessons or documentation.

Downloading SQL Server

  • Go to the official Microsoft SQL Server downloads page (search 'download SQL Server' from Microsoft's site).
  • Choose 'Express' or 'Developer' — both show a free 'Download now' button, no account or payment required.
  • Run the downloaded installer executable (for example, SQL2022-SSEI-Dev.exe).

Installation Steps

The installer offers three setup types: Basic, Custom, and Download Media. For a first install, Basic is the simplest path.

  • Launch the installer and select 'Basic' installation type.
  • Accept the license terms.
  • Choose an install location, or accept the default.
  • Click 'Install' and wait for the setup to download and configure the engine — this can take several minutes.
  • When setup finishes, note the Instance name shown on the summary screen (commonly SQLEXPRESS by default) — you'll need it to connect later.
  • Click 'Close'. The installer will also offer to install SQL Server Management Studio directly from this screen — you can do that now or follow the dedicated next lesson.
Windows Authentication

By default, SQL Server is set up to use Windows Authentication, meaning it trusts your logged-in Windows account rather than requiring a separate username and password. This is the simplest setup for local learning.

Verifying the Install

Once SQL Server and SSMS are both installed (SSMS is covered fully in the next lesson), open SSMS, connect to your instance, and run a simple diagnostic query to confirm everything is working.

SELECT @@VERSION AS ServerVersion,
@@SERVERNAME AS ServerName,
SERVERPROPERTY('Edition') AS Edition;
Result

Click Run to see what this code prints.

If this query runs without error and returns your edition name, SQL Server is installed and working correctly.

Docker and Linux Options

If you're not on Windows, or you prefer a disposable, container-based setup, SQL Server also ships official Docker images and native Linux packages. A quick example of pulling and running SQL Server in Docker:

docker pull mcr.microsoft.com/mssql/server:2022-latest
docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=YourStrong!Passw0rd" \
-p 1433:1433 --name sql1 --hostname sql1 \
-d mcr.microsoft.com/mssql/server:2022-latest

This starts a full SQL Server instance in a container, listening on port 1433, the same port used by native installs. You can then connect to it from SSMS or Azure Data Studio running on your host machine using localhost,1433 as the server name and SQL Server Authentication with the sa account.

Common Mistakes

Avoid These Mistakes
  • Forgetting the instance name when connecting later — it's often SQLEXPRESS by default, not just the machine name alone.
  • Installing SSMS and expecting it to also install the database engine — they are two separate downloads.
  • Choosing a weak SA password when using SQL Server Authentication (Docker/Linux setups) — SQL Server will reject passwords that don't meet complexity requirements.
  • Not enabling 'ACCEPT_EULA=Y' in the Docker run command, which causes the container to exit immediately.

Best Practices

  • Note your instance name (e.g., SQLEXPRESS) right after installation — you'll need it for every connection.
  • Prefer Developer Edition over Express if disk space isn't a concern, for the fuller feature set.
  • If you're on macOS or Linux, Docker is the most reliable path — install Docker Desktop first, then pull the SQL Server image.
  • Keep the installer's summary log; it lists the exact instance name and features installed, useful for troubleshooting later.

Frequently Asked Questions

Not natively — SQL Server does not ship a native macOS build. On macOS, the standard approach is running SQL Server inside a Docker container.

No, not for Express or Developer Edition. Both are free downloads that install without requiring a license key.

The default instance listens on TCP port 1433. Named instances (like SQLEXPRESS) typically use dynamic ports resolved via the SQL Server Browser service, unless configured otherwise.

Yes. SQL Server supports multiple named instances side by side on the same computer, each with its own configuration and databases.

Key Takeaways

  • SQL Server Express and Developer Edition are both free and suitable for this entire course.
  • Installing the database engine is a separate step from installing SSMS, the management tool.
  • SELECT @@VERSION; is a quick way to confirm your installation is working.
  • Docker and native Linux packages make SQL Server available outside of Windows too.

Summary

You now have a working SQL Server instance, whether installed natively on Windows or running in Docker. In the next lesson, you'll install SQL Server Management Studio (SSMS), the primary tool you'll use to connect to and interact with that instance.

Next Lesson →

Installing SQL Server Management Studio (SSMS)