Back to site

SQL Server Express

Install Microsoft SQL Server Express on a Windows VPS, instance configuration, and firewall.

SQL Server Express

SQL Server Express is the free edition of Microsoft SQL Server, suited for web applications and development environments on a HolyCloud Windows VPS. This guide covers download, silent installation, and minimal secure configuration.

Prerequisites

  • Windows Server 2019 or 2022 VPS (64-bit), 8 GB RAM recommended for SQL Server
  • At least 10 GB free disk space on C:\
  • RDP session with Administrator rights
  • Internet access to download installation media

Download SQL Server Express

  1. Go to the Microsoft SQL Server Express site (free edition).
  2. Download Express Edition and SSMS (SQL Server Management Studio) for graphical administration.
  3. Place the file SQLEXPR_x64_FRA.exe (or equivalent) in C:\Install\.

Create the folder:

New-Item -Path 'C:\Install' -ItemType Directory -Force

Graphical installation (wizard)

  1. Run the installer → Basic installation.
  2. Accept the license, choose the default instance folder.
  3. Note the instance name (often SQLEXPRESS).
  4. Choose Mixed Mode or Windows Authentication as needed (mixed mode if apps use sa).

For production, prefer Windows accounts or dedicated SQL logins rather than weak sa passwords.

Silent installation (PowerShell)

Configuration file C:\Install\ConfigurationFile.ini (sample excerpt):

[OPTIONS]
ACTION="Install"
FEATURES=SQLENGINE
INSTANCENAME="SQLEXPRESS"
SQLSVCACCOUNT="NT AUTHORITY\NETWORK SERVICE"
SQLSYSADMINACCOUNTS="BUILTIN\Administrators"
TCPENABLED=1
NPENABLED=0
SECURITYMODE=SQL
SAPWD="MotDePasseFort!ChangezMoi"

Run:

Start-Process -FilePath 'C:\Install\SQLEXPR_x64_FRA.exe' `
  -ArgumentList '/ConfigurationFile=C:\Install\ConfigurationFile.ini /Q' `
  -Wait -NoNewWindow

Verify services:

Get-Service | Where-Object { $_.Name -like 'MSSQL*' -or $_.Name -eq 'SQLBrowser' }

Enable TCP/IP connections

  1. Open SQL Server Configuration Manager.
  2. SQL Server Network ConfigurationProtocols for SQLEXPRESS → enable TCP/IP.
  3. TCP/IP Properties → IP Addresses tab → IPAllTCP Port: 1433 (or custom port).
  4. Restart the service:
Restart-Service 'MSSQL$SQLEXPRESS'

Windows Firewall

Allow the SQL port (example 1433) only if remote access is required:

New-NetFirewallRule -DisplayName 'SQL Server 1433' `
  -Direction Inbound -Protocol TCP -LocalPort 1433 -Action Allow `
  -RemoteAddress 203.0.113.50

Replace 203.0.113.50 with your application IP (web VPS, office). Avoid exposing 1433 to 0.0.0.0/0.

Local connection and test

With sqlcmd:

sqlcmd -S localhost\SQLEXPRESS -E -Q "SELECT @@VERSION"

SQL Authentication mode:

sqlcmd -S localhost\SQLEXPRESS -U sa -P 'MotDePasseFort!ChangezMoi' -Q "SELECT name FROM sys.databases"

Create a database for an application:

CREATE DATABASE monapp_db;
GO
CREATE LOGIN monapp_user WITH PASSWORD = 'AutreMotDePasseFort!';
GO
USE monapp_db;
CREATE USER monapp_user FOR LOGIN monapp_user;
ALTER ROLE db_owner ADD MEMBER monapp_user;
GO

Run via SSMS or:

sqlcmd -S localhost\SQLEXPRESS -E -i C:\Install\create-db.sql

Connection string (ASP.NET example)

Server=203.0.113.10\SQLEXPRESS,1433;Database=monapp_db;User Id=monapp_user;Password=***;Encrypt=True;TrustServerCertificate=True;

Limit network access to the server that needs it.

Maintenance and backups

Manual backup:

sqlcmd -S localhost\SQLEXPRESS -E -Q "BACKUP DATABASE monapp_db TO DISK = N'C:\Backup\monapp_db.bak' WITH FORMAT, INIT"

Schedule a Windows scheduled task for daily backups and copy .bak files off the VPS (SFTP, HolyCloud storage if available).

Troubleshooting

| Problem | Solution |

|----------|----------|

| « Cannot connect » remotely | TCP/IP enabled; firewall; instance SERVER\SQLEXPRESS |

| Service won't start | Logs C:\Program Files\Microsoft SQL Server\...\Log\ERRORLOG |

| Insufficient memory | Reduce max server memory in SSMS or increase VPS RAM |

| Port already in use | Change port in Configuration Manager |

Limit memory (example 4 GB max):

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

Need help?

For licensing, edition, or performance issues on large volumes, contact HolyCloud support with Windows version, VPS size, and exact SQL error messages.