WindowsPublished on May 26, 20269 min read

Install SQL Server on a Windows VPS

This guide explains how to install SQL Server on a Windows VPS: choosing the edition, including the free SQL Server Express, installing with the wizard or from the command line, SSMS, network access, security and backups. It covers SQL Server 2025, the current version, on Windows Server 2025. SQL Server is not part of the delivered system.

Choose the SQL Server edition

EditionDatabase sizeBuffer pool memoryProcessorLicense
Express50 GB per database1,410 MB1 socket or 4 coresFree
Standard Developer, Enterprise DeveloperSame as Standard or EnterpriseSame as Standard or EnterpriseSame as Standard or EnterpriseFree, development and testing only
Standard524 PB256 GB4 sockets or 32 coresPaid
Enterprise524 PBOperating system maximumOperating system maximumPaid

To develop an application, pick a Developer edition. In production, Express is enough as long as each database stays under 50 GB. Beyond that, or for high availability, you need Standard or Enterprise, with a license bought from Microsoft or a reseller.

Express has no SQL Server Agent and does not compress backups. The backup section gives the right method. If your application requires SQL Server 2022 Express, Microsoft still offers it for download: the procedure is the same, with a 10 GB limit per database.


Prepare the VPS

ComponentMinimumRecommended
Memory512 MB (Express), 1 GB (other editions)1 GB (Express), 4 GB or more (other editions)
Processorx64, 1.4 GHz2.0 GHz or faster
Disk6 GB freeDepending on your databases
SystemWindows Server 2019 or laterWindows Server 2025

SQL Server 2025 needs .NET Framework 4.7.2, which Windows Server 2025 already provides. Check the Windows version, memory and free space.

# Windows version
Get-ComputerInfo | Select-Object WindowsProductName, OsHardwareAbstractionLayer
# Installed memory (in bytes)
Get-CimInstance Win32_PhysicalMemory | Measure-Object -Property capacity -Sum
# Disk space on C:
Get-PSDrive C | Select-Object Used, Free

Then create separate folders for data, logs and backups. On a single-disk VPS, this keeps files tidy and makes backups easier.

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

SQLData holds the .mdf and .ndf files, SQLLogs the .ldf logs, SQLBackups the .bak backups.


Download SQL Server

The Express and Developer editions are on the SQL Server download page. The installer offers three modes.

ModeWhat it doesWhen to choose it
BasicMinimal installation with default settingsA quick test
CustomControl over features, folders, accounts and authenticationAny lasting installation
Download MediaDownloads the full media for an offline installationInstallation without Internet access or from the command line

Install SQL Server with the wizard

Installer labels are quoted in English, the language of the delivered system. Choose Custom, then follow these steps.

  1. In the Installation Center, open Installation › New SQL Server standalone installation or add features to an existing installation.

  2. Choose the free edition you want, or enter your key for Standard or Enterprise.

  3. In Feature Selection, tick Database Engine Services. Leave out Analysis Services, Integration Services and PolyBase unless you need them.

  4. In Instance Configuration, keep the default instance MSSQLSERVER for a single SQL Server on the VPS. A named instance, for example SQLPROD, is then reached with .\SQLPROD.

  5. In Server Configuration, keep the virtual account NT Service\MSSQLSERVER. Tick Grant Perform Volume Maintenance Task privilege: creating and restoring databases gets faster.

  6. In Database Engine Configuration, Server Configuration tab, choose Mixed Mode and give the sa account a long, complex password. Add your Windows account as an administrator.

  7. On the Data Directories tab, enter C:\SQLData for data, C:\SQLLogs for logs and C:\SQLBackups for backups.

  8. On the TempDB tab, plan one file per core, 8 at most. On a 4-vCPU VPS, that makes 4 files.

  9. Review the summary and click Install.

Mixed mode lets you log in with a SQL account such as sa on top of Windows accounts. It is handy on a VPS outside a domain.


Install SQL Server from the command line

A silent installation helps automate or reproduce a configuration on several VPS. Run it in an administrator PowerShell, from the folder that contains setup.exe (media downloaded with Download Media). Replace the sa password.

.\setup.exe /Q `
  /ACTION=Install `
  /FEATURES=SQLEngine,Replication,FullText `
  /INSTANCENAME=MSSQLSERVER `
  /SQLSVCACCOUNT="NT Service\MSSQLSERVER" `
  /SQLSYSADMINACCOUNTS="BUILTIN\Administrators" `
  /AGTSVCACCOUNT="NT Service\SQLSERVERAGENT" `
  /AGTSVCSTARTUPTYPE=Automatic `
  /SQLSVCINSTANTFILEINIT="True" `
  /SQLUSERDBDIR="C:\SQLData" `
  /SQLUSERDBLOGDIR="C:\SQLLogs" `
  /SQLBACKUPDIR="C:\SQLBackups" `
  /TCPENABLED=1 `
  /SECURITYMODE=SQL `
  /SAPWD="Ch@ngeMe-Now!" `
  /IACCEPTSQLSERVERLICENSETERMS `
  /SUPPRESSPRIVACYSTATEMENTNOTICE
ParameterRole
/QSilent mode, no interface
/FEATURESDatabase engine, replication and full-text search
/SQLSYSADMINACCOUNTSSQL Server administrator accounts, here the local administrators
/SQLSVCINSTANTFILEINITSpeeds up database file creation
/TCPENABLED=1Turns on TCP/IP during installation
/SECURITYMODE=SQL, /SAPWDMixed mode and the sa account password
/IACCEPTSQLSERVERLICENSETERMS, /SUPPRESSPRIVACYSTATEMENTNOTICEAcceptance of the license and privacy notice, required in silent mode

The result is in C:\Program Files\Microsoft SQL Server\170\Setup Bootstrap\Log\Summary.txt. The 170 folder matches SQL Server 2025, 160 SQL Server 2022.


Install SSMS and connect

SQL Server Management Studio (SSMS), the admin interface, is installed separately. Download the latest version from the Microsoft SSMS page and install it with the default options.

When it opens, enter localhost as the server name (or .\SQLPROD for a named instance), then choose Windows authentication or SQL Server authentication with the sa account. Without SSMS, sqlcmd queries the server from the command line.

sqlcmd -S localhost -Q "SELECT @@VERSION"

Open network access

By default, SQL Server only accepts local connections. For another machine to connect, turn on TCP/IP.

  1. Open SQL Server Configuration Manager from the Start menu.

  2. Go to SQL Server Network Configuration › Protocols for MSSQLSERVER.

  3. Right-click TCP/IP, then Enable.

  4. Double-click TCP/IP, IP Addresses tab. At the very bottom, in IPAll, set TCP Port to 1433 or another port.

  5. Restart the SQL Server service.

Then open the port in the Windows firewall, preferably for one address only: that of your computer or your application server.

# Port 1433 open to everyone (avoid in production)
New-NetFirewallRule -DisplayName "SQL Server (TCP 1433)" `
  -Direction Inbound -Protocol TCP -LocalPort 1433 -Action Allow
# Port 1433 restricted to one address (recommended)
New-NetFirewallRule -DisplayName "SQL Server - Allowed IP" `
  -Direction Inbound -Protocol TCP -LocalPort 1433 `
  -RemoteAddress "203.0.113.10" -Action Allow

Check the installation: the port answers, the service runs and a query goes through.

Test-NetConnection -ComputerName localhost -Port 1433
Get-Service -Name MSSQLSERVER
sqlcmd -S localhost -Q "SELECT @@VERSION, GETDATE() AS ServerDate"

The guide How to open a port in Windows Firewall on a VPS covers address-restricted rules. To link an application server without going through the Internet, use the How to connect two VPS over a private network.


Secure SQL Server

  • Disable or rename the sa account, the first target of brute-force attacks.

  • Create one SQL account per application, with rights on its own database only.

  • Restrict the SQL port to known addresses, as shown above.

  • Exclude the SQL folders from Microsoft Defender real-time scanning.

  • Keep risky features such as xp_cmdshell turned off.

  • In SSMS, server properties, Security page, set Login auditing to Both failed and successful logins.

-- Turn off xp_cmdshell
EXEC sp_configure 'show advanced options', 1; RECONFIGURE;
EXEC sp_configure 'xp_cmdshell', 0; RECONFIGURE;
# Microsoft Defender exclusions for the SQL folders
Add-MpPreference -ExclusionPath "C:\SQLData","C:\SQLLogs","C:\SQLBackups"

Back up the databases

This T-SQL script backs up a database to a dated file. Replace AppDb with the name of your database.

DECLARE @file NVARCHAR(260) = N'C:\SQLBackups\AppDb_' + CONVERT(NVARCHAR(8), GETDATE(), 112) + N'.bak';
-- On Standard or Enterprise, add COMPRESSION to the WITH clause
BACKUP DATABASE [AppDb] TO DISK = @file WITH STATS = 10;

With SQL Server Agent (Standard, Enterprise, Developer)

Start the agent and set it to start automatically.

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

In SSMS, under SQL Server Agent, create a job with New Job. Add a T-SQL step with the script, then a daily schedule, for example at 2 a.m.

With Task Scheduler (Express)

Express has no agent. Save the script as C:\Scripts\sql-backup.sql, then schedule sqlcmd. The task account must be a SQL Server administrator; the command asks for its password.

schtasks /create /tn "SQL-Backup-AppDb" /tr "sqlcmd -S localhost -E -i C:\Scripts\sql-backup.sql" /sc DAILY /st 02:00 /ru Administrator /rp

These files stay on the VPS. To copy them elsewhere, follow Back up your Windows VPS.


Fix common errors

The SQL Server service does not start

Port 1433 is often already taken, or the service account has no rights on the data folders. Check the port, then read the exact message in Event Viewer, Application log, source MSSQLSERVER.

netstat -ano | findstr :1433

Cannot connect to localhost

Check that the service is running with Get-Service MSSQLSERVER, that TCP/IP is enabled in SQL Server Configuration Manager and that you use the right name. A named instance is reached with .\INSTANCENAME, not localhost.

Login failed for user 'sa'

Either mixed mode is not enabled, or the sa account is disabled. In SSMS, server properties, Security page, choose SQL Server and Windows Authentication mode and restart the service. To turn sa back on:

ALTER LOGIN sa ENABLE;
ALTER LOGIN sa WITH PASSWORD = 'Ch@ngeMe-Now!';

A pending restart blocks the installation

Windows has pending file rename operations. If the value below exists, restart the VPS, then run the installation again.

Get-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager" `
  -Name PendingFileRenameOperations -ErrorAction SilentlyContinue

A .NET component is missing

Windows Server 2025 provides .NET Framework 4.8.1, enough for SQL Server 2025. If an older component asks for .NET Framework 3.5, install it, with the Windows Server ISO as the source if needed. Otherwise, download .NET Framework from Microsoft.

Install-WindowsFeature Net-Framework-Core
Install-WindowsFeature Net-Framework-Core -Source "D:\sources\sxs"

Performance drops

On Standard or Enterprise, add TempDB files up to one per core (8 at most). Express uses a single TempDB file.

-- 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);

Also cap SQL Server memory to leave at least 20% to Windows. On an 8 GB VPS, that gives about 6,400 MB.

EXEC sp_configure 'show advanced options', 1; RECONFIGURE;
EXEC sp_configure 'max server memory', 6400; RECONFIGURE;

If you did not tick the privilege during installation, grant Perform volume maintenance tasks to the service account in secpol.msc.


Need help?

Open a ticket from Tickets › Open a Ticket, or from the Contact support tile at the bottom of the VPS page. In the Related Service field, pick the VPS so the team saves time. You can also ask your question on the OuiHeberg Discord.

Was this article helpful?

386 views
Share this article
Need a Windows VPS?

Windows Server 2025 with the license included, Remote Desktop access and management from the client area.

View plans →

Related Articles