SQL Server Express Install Microsoft SQL Server Express on a Windows VPS, instance configuration, and firewall. ~14 min read Intermediate #windows #sql-server #mssql #database 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 Go to the Microsoft SQL Server Express site (free edition). Download Express Edition and SSMS (SQL Server Management Studio) for graphical administration. 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) Run the installer → Basic installation. Accept the license, choose the default instance folder. Note the instance name (often SQLEXPRESS). 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 Open SQL Server Configuration Manager. SQL Server Network Configuration → Protocols for SQLEXPRESS → enable TCP/IP. TCP/IP Properties → IP Addresses tab → IPAll → TCP Port: 1433 (or custom port). 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. Continue reading Previous article Secure Remote Desktop Read Next article SSL certificate on IIS Read