Install Collabora on Windows Server using WSL2
Use Ubuntu 24.04 and Docker Engine in Windows Subsystem for Linux 2 (WSL2) to run Collabora on Windows Server 2022 or 2025. Windows forwards HTTPS to Ubuntu, where either Collabora or Nginx terminates TLS.
Before you begin
- Review the Collabora host and network requirements. Enable hardware virtualization, or nested virtualization if Windows Server runs in a VM. Start with at least 2 vCPUs, 4 GB of RAM, and 20 GB of free disk space, plus space for WSL and Docker.
- Assign Windows Server a stable private IPv4 address. Confirm that no other service listens on port 443 on the address you plan to use.
- Choose the Windows account that will install Ubuntu and run the startup task. WSL distributions are registered per Windows account. The startup task must run under the account that owns the distribution, even when that account is signed out.
Install WSL2 and Ubuntu
-
In elevated PowerShell, under the Windows account that will own the distribution, install Ubuntu and restart Windows if prompted.
powershellwsl --install -d Ubuntu-24.04 -
Sign back in as the same Windows account. Run
wsl --list --verboseand confirm Ubuntu uses version2. If needed, convert it withwsl --set-version Ubuntu-24.04 2. Runwsl -d Ubuntu-24.04and finish setting up the Ubuntu user account. -
In Ubuntu, enable systemd by adding or updating the
[boot]section of/etc/wsl.conf.ini[boot] systemd=true -
Exit Ubuntu. In PowerShell, run
wsl --shutdown, which stops all running WSL distributions. Open Ubuntu again and runps -p 1 -o comm=. Continue only if the result issystemd. -
In Windows Task Scheduler, create a temporary task under the Windows account that owns Ubuntu. Choose Run whether user is logged on or not, then set the action to run
C:\Windows\System32\wsl.exewith-d Ubuntu-24.04 -u root --exec /usr/bin/id -u. Run the task and verify that Last Run Result is0x0. Delete the temporary task. If the check fails, resolve the account or WSL registration issue before continuing.
Install Docker and deploy Collabora in Ubuntu
-
In Ubuntu, follow Install Docker Engine on Ubuntu or Debian, using the Ubuntu instructions.
-
If you plan to use Nginx, install it in Ubuntu with
sudo apt-get install -y nginx. -
Follow Deploy the Collabora container inside Ubuntu.
-
From inside Ubuntu, verify the local TLS endpoint before configuring forwarding. Replace
collabora.example.comwith your hostname. Confirm that the command returns HTTP 200 without certificate errors.bashcurl -fsS -o /dev/null -w '%{http_code}\n' \ --resolve collabora.example.com:443:127.0.0.1 \ https://collabora.example.com/hosting/discovery
Forward HTTPS to WSL2
WSL2 can receive a different IP address when it restarts. Configure a Windows startup task to find the current address, update the port forwarding rule, and keep the distribution running without an interactive sign-in.
-
In elevated PowerShell, enable the IP Helper service.
powershellSet-Service iphlpsvc -StartupType Automatic Start-Service iphlpsvc -
In Windows Defender Firewall, allow inbound TCP port 443 on the Windows Server IPv4 address you selected. Limit the rule to the network profiles and remote addresses your deployment requires.
-
Create
C:\ProgramData\CollaboraWSLand restrict write access to administrators and the account that runs the task. Save the following script asC:\ProgramData\CollaboraWSL\start-collabora.ps1. Replace the Windows IP address and set$UseNginxto$trueonly if you chose Nginx.powershell$ErrorActionPreference = 'Stop' $Distro = 'Ubuntu-24.04' $WindowsIP = '10.0.0.10' $UseNginx = $false $WslExe = "$env:WINDIR\System32\wsl.exe" $Log = 'C:\ProgramData\CollaboraWSL\startup.log' while ($true) { try { $Services = @('docker') if ($UseNginx) { $Services += 'nginx' } & $WslExe -d $Distro -u root --exec /usr/bin/systemctl start @Services if ($LASTEXITCODE -ne 0) { throw 'Could not start the required WSL services.' } $Address = & $WslExe -d $Distro -u root --exec /usr/sbin/ip -4 -o addr show dev eth0 scope global if ($LASTEXITCODE -ne 0) { throw 'Could not query the WSL2 network interface.' } $Match = [regex]::Match(($Address -join "`n"), 'inet\s+(\d{1,3}(?:\.\d{1,3}){3})/') if (-not $Match.Success) { throw 'Could not determine the WSL2 IPv4 address.' } $WslIP = $Match.Groups[1].Value & netsh.exe interface portproxy delete v4tov4 listenaddress=$WindowsIP listenport=443 | Out-Null & netsh.exe interface portproxy add v4tov4 listenaddress=$WindowsIP listenport=443 connectaddress=$WslIP connectport=443 protocol=tcp | Out-Null if ($LASTEXITCODE -ne 0) { throw 'Could not configure HTTPS forwarding.' } "$(Get-Date -Format s) Forwarding HTTPS to $WslIP." | Out-File $Log -Append & $WslExe -d $Distro -u root --exec /usr/bin/sleep infinity "$(Get-Date -Format s) WSL keep-alive stopped; retrying." | Out-File $Log -Append } catch { "$(Get-Date -Format s) Error: $($_.Exception.Message)" | Out-File $Log -Append } Start-Sleep -Seconds 10 } -
In Task Scheduler, create a task named
Collabora-WSL-Startup. Configure it to run At startup under the Windows account that owns Ubuntu. Select Run whether user is logged on or not and Run with highest privileges. Set the program topowershell.exeand the arguments to-NoProfile -NonInteractive -File "C:\ProgramData\CollaboraWSL\start-collabora.ps1". Clear Stop the task if it runs longer than so the keep-alive can continue running. -
Run the task. Confirm that it stays in the Running state and that
netsh interface portproxy show allmaps Windows port 443 to WSL2 port 443. If it fails, checkC:\ProgramData\CollaboraWSL\startup.log.
Verify unattended operation
From another machine, confirm the Collabora discovery and capabilities endpoints return HTTP 200 over HTTPS. Sign out of the Windows account that owns Ubuntu and repeat the checks. Then restart Windows Server and repeat the checks without signing in as that account. The task refreshes the forwarded address when it starts or restarts; it does not continuously monitor address changes while WSL2 stays running.
After the checks pass, configure storage zones controller to use Collabora.