WindowsMay 26, 2026 14 views

Install SQL Server on a Windows VPS

Install SQL Server on a Windows VPS

Quick Summary:

  1. Choose the edition: Express (free, <10 GB), Developer (free, dev only) or Standard (paid production).

  2. Check the prerequisites: Windows Server 2019/2022, 4 GB of RAM minimum recommended, 6 GB disk.

  3. Download SQL Server 2022 from microsoft.com/sql-server/sql-server-downloads.

  4. Run setup.exe, choose "New standalone installation", enable mixed mode and point to the data directories.

  5. Install SSMS, enable TCP/IP on port 1433, open the firewall, test with sqlcmd.


Which SQL Server edition to choose?

Edition

Max DB size

Usable RAM

Max cores

Price

Recommended usage

Express

10 GB / database

1.4 GB (buffer pool)

4 cores

Free

Small apps, dev, test

Developer

Unlimited

Unlimited

Unlimited

Free

Development & test only

Standard

Unlimited

128 GB

24 cores

~900 €/year

Light to medium production

Enterprise

Unlimited

Unlimited

Unlimited

On quote

Critical production, HA, BI

Our quick recommendation:

  • Are you developing an app? → Developer Edition (all features, zero cost).

  • Production with less than 10 GB of data? → Express is sufficient.

  • Site or app in real production? → Standard minimum.


Prerequisites before installation

Windows Server × SQL Server 2022 Compatibility

OS

Enterprise

Developer

Standard

Express

Windows Server 2025

Windows Server 2022

Windows Server 2019

Windows Server 2016

Minimum Resources

Component

Minimum

Recommended (production)

RAM

512 MB (Express) / 1 GB (others)

4 GB minimum

CPU

x64, 1.4 GHz

2.0 GHz+, 2 vCPU+

Disk

6 GB free

20 GB+ depending on your data

.NET Framework

4.7.2 (automatically installed)

:

Check your VPS in PowerShell

Before starting the installation, check your environment with 3 commands:

# Windows Version
Get-ComputerInfo | Select-Object WindowsProductName, OsHardwareAbstractionLayer

# Available RAM (in bytes)
Get-CimInstance Win32_PhysicalMemory | Measure-Object -Property capacity -Sum

# Disk space C:
Get-PSDrive C | Select-Object Used, Free

Prepare disks and directories

Separating data, logs, and backups is a fundamental best practice. In case of disk crash, you limit the damage. On a single-disk VPS, use at least separate folders.

New-Item -ItemType Directory -Path "C:\SQLData"    -Force
New-Item -ItemType Directory -Path "C:\SQLLogs"    -Force
New-Item -ItemType Directory -Path "C:\SQLBackups" -Force

Why separate?

  • SQLData: .mdf / .ndf files: frequent reads/writes

  • SQLLogs: .ldf files: intensive sequential writes

  • SQLBackups: .bak backups: occasional access, can be on a slower volume

On a VPS with multiple volumes, place SQLData and SQLLogs on different disks for better I/O performance.


Download SQL Server 2022

Official Microsoft links:

Basic vs Custom vs Download media

The installer offers 3 modes at startup:

Mode

What it does

When to use it

Basic

Minimal installation, default options

Quick test only

Custom

Full control over features and paths

Production: always choose this

Download media

Downloads the ISO/CAB for offline installation

VPS without direct internet access

Choose "Custom" in production. It is the only mode that allows you to configure directories, TempDB, service accounts, and authentication mode.


Installation via the graphical wizard (GUI)

Step 1: Start the installation

Open setup.exeInstallation tab → "New SQL Server standalone installation or add features".

Step 2: Select the edition

Choose your edition (Developer for dev, enter your key for Standard/Enterprise).

Step 3: Select features

To check for a standard VPS:

  • ✅ Database Engine Services

  • ✅ SQL Server Replication

  • ✅ Full-Text Search

Do not check on a base VPS:

  • ❌ Reporting Services (heavy, unnecessary unless specific need)

  • ❌ Analysis Services (OLAP: only for BI)

  • ❌ Integration Services (ETL: only if needed)

Step 4: Instance configuration

Type

Name

Connection

When to use it

Default instance

MSSQLSERVER

localhost or .\

Only one SQL Server on the VPS

Named instance

Ex: SQLPROD

.\SQLPROD

Multiple instances on the same VPS

For a VPS with a single instance, the default instance is simpler.

Step 5: Service accounts

  • Standard VPS: use NT Service\MSSQLSERVER (virtual account managed by Windows)

  • Domain environment: use a dedicated Active Directory service account

Step 6: Authentication mode

Always choose mixed mode on a VPS.

Windows-only mode can block you if the domain is inaccessible. Mixed mode enables both Windows authentication and SQL authentication (account sa).

Set a strong password for sa: minimum 12 characters, uppercase, numbers, special characters.

Step 7: Data directories

Point to the folders created earlier:

  • Root data directory: C:\SQLData

  • User log directory: C:\SQLLogs

  • Backup directory: C:\SQLBackups

Step 8: TempDB configuration

Number of TempDB files = number of CPU cores, maximum 8.

On a 4 vCPU VPS → 4 TempDB files. This is the official Microsoft rule to avoid contention.

Step 9: Summary and launch

Check the summary, click Install. The installation takes 5 to 15 minutes depending on the VPS.


Silent installation via PowerShell (advanced)

Ideal for automating deployment or replicating a configuration across multiple VPS.

# Silent installation SQL Server 2022 Developer Edition
# From the directory containing setup.exe (mounted ISO or extracted folder)

.\setup.exe /Q `
  /ACTION=Install `
  /FEATURES=SQLEngine,Replication,FullText `
  /INSTANCENAME=MSSQLSERVER `
  /SQLSVCACCOUNT="NT Service\MSSQLSERVER" `
  /SQLSYSADMINACCOUNTS="BUILTIN\Administrators" `
  /AGTSVCACCOUNT="NT Service\SQLSERVERAGENT" `
  /AGTSVCSTARTUPTYPE=Automatic `
  /SQLUSERDBDIR="C:\SQLData" `
  /SQLUSERDBLOGDIR="C:\SQLLogs" `
  /SQLBACKUPDIR="C:\SQLBackups" `
  /TCPENABLED=1 `
  /SECURITYMODE=SQL `
  /SAPWD="YourStrongPassword123!" `
  /IACCEPTSQLSERVERLICENSETERMS

Explanation of key parameters:

  • /Q: silent mode (no graphical interface)

  • /ACTION=Install: type of operation

  • /FEATURES=SQLEngine,Replication,FullText: features to install

  • /INSTANCENAME=MSSQLSERVER: default instance

  • /SQLSVCACCOUNT: Windows account under which the SQL service runs

  • /SQLSYSADMINACCOUNTS: who becomes sysadmin (here, local admins)

  • /AGTSVCSTARTUPTYPE=Automatic: SQL Server Agent starts automatically

  • /TCPENABLED=1: enables TCP/IP upon installation

  • /SECURITYMODE=SQL: enables mixed mode

  • /SAPWD: password for the sa account: replace this value

  • /IACCEPTSQLSERVERLICENSETERMS: acceptance of the license (mandatory)

Check the result in C:\Program Files\Microsoft SQL Server\160\Setup Bootstrap\Log\Summary.txt after installation.


Install SQL Server Management Studio (SSMS)

SSMS is the graphical interface for administering SQL Server. It is downloaded separately.

Download: learn.microsoft.com/fr-fr/ssms/ → "Download SSMS" button

The installation is simple: run the installer, accept the default settings, restart if prompted.

First connection

When launching SSMS, connect with:

  • Server name: localhost or .\MSSQLSERVER

  • Authentication: SQL Server (account sa) or Windows

PowerShell / command line alternative

# Check SQL Server version without SSMS
sqlcmd -S localhost -Q "SELECT @@VERSION"

Enable TCP/IP network access

By default, SQL Server only listens locally. To access from outside or from another machine, enable TCP/IP.

Via SQL Server Configuration Manager

  1. Open SQL Server Configuration Manager (search in the Start menu)

  2. SQL Server Network ConfigurationProtocols for MSSQLSERVER

  3. Right-click on TCP/IPEnable

  4. Double-click on TCP/IP → IP Addresses tab → scroll down to IPAll

  5. Set TCP Port to 1433 (or a custom port for more security)

  6. Restart the SQL Server service

Open Windows Firewall (PowerShell)

# Open port 1433 for everyone (to avoid in production)
New-NetFirewallRule -DisplayName "SQL Server (TCP 1433)" `
  -Direction Inbound -Protocol TCP -LocalPort 1433 -Action Allow

# Restrict to a specific IP (recommended)
New-NetFirewallRule -DisplayName "SQL Server - Specific IP" `
  -Direction Inbound -Protocol TCP -LocalPort 1433 `
  -RemoteAddress "YOUR_IP" -Action Allow

Replace YOUR_IP with the IP address of your workstation or application server. Never leave port 1433 open to the entire internet.


Check the installation

# 1. Test network connectivity
Test-NetConnection -ComputerName localhost -Port 1433

# 2. Check that the SQL Server service is running
Get-Service -Name MSSQLSERVER

# 3. Quick SQL test
sqlcmd -S localhost -Q "SELECT @@VERSION, GETDATE() AS ServerDate"

If all 3 commands respond correctly, your installation is functional.


Post-installation security (checklist)

Do not leave SQL Server with its default configuration in production. Here are the essential actions:

  • Disable or rename the account sa: it is the number 1 target for brute force attacks

  • Create dedicated SQL accounts per application: principle of least privilege (one account per database, limited rights)

  • Restrict TCP/IP to known IPs: firewall rule with specific RemoteAddress

  • Add Windows Defender exclusions for C:\SQLData, C:\SQLLogs, C:\SQLBackups: avoids real-time scans on SQL files

  • Disable unnecessary features: xp_cmdshell, CLR Integration, OLE Automation: via sp_configure

  • Configure SQL Server Agent for automatic backups (see next section)

  • Enable login audits: in SSMS → Server Properties → Security → "Successful and failed logins"

Disable xp_cmdshell in T-SQL:

EXEC sp_configure 'show advanced options', 1; RECONFIGURE;
EXEC sp_configure 'xp_cmdshell', 0; RECONFIGURE;

Configure automatic backups with SQL Server Agent

SQL Server Agent is the task scheduler built into SQL Server. It manages backups, index maintenance, alerts.

Enable SQL Server Agent

In SSMS → SQL Server Agent (in Object Explorer) → right-click → Start.

Or in PowerShell:

Set-Service -Name SQLSERVERAGENT -StartupType Automatic
Start-Service -Name SQLSERVERAGENT

Create a daily full backup job

-- Full backup with compression
BACKUP DATABASE [YourDBName]
TO DISK = N'C:\SQLBackups\YourDBName_' + CONVERT(VARCHAR, GETDATE(), 112) + '.bak'
WITH COMPRESSION, STATS = 10;

Schedule this script via SQL Server Agent → New job → New step (type: T-SQL) → New schedule (e.g., every day at 2:00 AM).

For more on backup strategies, check our guide → Backing up your Windows VPS: 3 methods


Troubleshooting: 6 common errors

1. "The SQL Server service could not start"

Most common cause: port 1433 already in use, or insufficient permissions on data directories.

# Check if port 1433 is already in use
netstat -ano | findstr :1433

Also check the Windows Event Viewer → Windows Logs → Application → source MSSQLSERVER. The exact error message can be found there.

2. "Cannot connect to localhost"

Check in order:

  • The service is running: Get-Service MSSQLSERVER

  • TCP/IP is enabled in SQL Server Configuration Manager

  • You are using the correct name: named instance → .\INSTANCE_NAME, not localhost

3. "Login failed for user 'sa'"

Two possible causes:

  • Mixed mode not enabled → re-enable it via the registry or re-run the setup

  • Account sa disabled → re-enable it in T-SQL:

ALTER LOGIN sa ENABLE;
ALTER LOGIN sa WITH PASSWORD = 'NewPassword123!';

4. "Pending restart" blocks installation

Windows has pending rename operations that block the setup.

# Check the registry key
Get-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager" `
  -Name PendingFileRenameOperations -ErrorAction SilentlyContinue

If the key exists, restart the VPS (clean method) or delete the value and restart the setup.

5. ".NET Framework missing"

# Install .NET Framework Core via Windows Features
Install-WindowsFeature Net-Framework-Core

# If a local source is needed (Windows Server without internet access)
Install-WindowsFeature Net-Framework-Core -Source "D:\sources\sxs"

Otherwise, download .NET Framework 4.8 directly from Microsoft.

6. Degraded performance after installation

Three immediate adjustments to make:

TempDB: number of files = number of cores (max 8):

-- Add TempDB files if necessary (example for 4 cores)
ALTER DATABASE tempdb ADD FILE (NAME = tempdev2, FILENAME = 'C:\SQLData\tempdb2.mdf', SIZE = 64MB);
ALTER DATABASE tempdb ADD FILE (NAME = tempdev3, FILENAME = 'C:\SQLData\tempdb3.mdf', SIZE = 64MB);
ALTER DATABASE tempdb ADD FILE (NAME = tempdev4, FILENAME = 'C:\SQLData\tempdb4.mdf', SIZE = 64MB);

Limit the RAM used by SQL Server (leave 20% for the OS):

-- Example: VPS with 8 GB RAM → max 6,400 MB for SQL Server
EXEC sp_configure 'show advanced options', 1; RECONFIGURE;
EXEC sp_configure 'max server memory', 6400; RECONFIGURE;

Enable Instant File Initialization (IFI):

Grant the Perform Volume Maintenance Tasks right to the SQL Server service account in the local security policy (secpol.msc). This drastically speeds up the creation and restoration of databases.


FAQ

Which version of SQL Server to install on a VPS?

SQL Server 2022 is the recommended version in 2025. For free development with all features, choose Developer Edition. For production with less than 10 GB of data, Express is sufficient and free. Beyond that, Standard is the minimum.

Is SQL Server Express sufficient for a WordPress site?

No: WordPress uses MySQL or MariaDB, not SQL Server. SQL Server Express is suitable for .NET applications, ASP.NET Core, or internal Windows databases. If you are hosting WordPress, install MySQL or MariaDB instead.

Can SQL Server be installed on a Linux VPS?

Yes, SQL Server 2017 and later support Ubuntu, RHEL, and SUSE. However, on a Windows VPS, the native Windows installation offers the best performance and maximum compatibility with Microsoft tools.

How to access SQL Server from outside?

Enable TCP/IP in SQL Server Configuration Manager, set port 1433, open this port in the Windows firewall, and connect via SSMS with the public IP of your VPS. Always restrict access to known IPs.

How much RAM is needed for SQL Server on a VPS?

Minimum 4 GB for proper use. In light production, 8 GB is comfortable. Always configure max server memory to leave at least 20% of RAM for the operating system: otherwise, Windows may run out of memory.

Is SQL Server included in OuiHeberg Windows VPS?

No. SQL Server is not included by default (separate Microsoft license). You can install SQL Server Express or Developer Edition for free. For SQL Server Standard or Enterprise, a Microsoft license is required.


Useful sources