Deploy Windows Server
Windows Server desktop with optional network pause for Railway Serverless.
Windows Server
Just deployed
/storage
Deploy and Host Windows on Railway
Run Windows in your browser on Railway. Open your Windows desktop over HTTPS using the credentials from Railway. This template installs Windows Server 2022 with Desktop Experience and PowerShell. A persistent volume keeps your apps and files across redeploys.
Before deploying Windows, use Railway Pro or Enterprise with at least 8 GB RAM, 4 vCPU and a persistent volume of 50 GB or more.
About Hosting Windows on Railway
One Railway service runs Windows in QEMU with CPU emulation, which makes boot and installation slower than on a hardware-accelerated VPS. Its HTTPS domain opens the noVNC desktop, and /storage retains Windows, installed software, files and settings.
Open Windows in your browser
- Deploy to a Pro or Enterprise workspace. A fresh install needs at least 32 GiB free on the
/storagevolume. - Open the generated HTTPS domain. Use
USERNAME(defaultadmin) and the generatedPASSWORDfrom Railway Variables. - Watch the installer in the browser. First setup can take 30 minutes or longer without KVM. Leave the deployment running until the automatic restart finishes, even if Railway already shows it as Active.
- Use the same account and password for the Windows session if prompted.
If RAM or storage is insufficient, the browser shows what to adjust. The service rechecks every 15 seconds and stops cleanly after 10 minutes if resources are still insufficient. Adjust the resources and restart the deployment.
If QEMU exits unexpectedly, the service tries again after 5 seconds and then after 15 seconds. After three consecutive failures it stays online with a diagnostic page and an exit code. Use Deploy Logs for the error, then use Restart to try again. A normal shutdown from inside Windows shows a separate page with instructions to start it again. Railway's /healthcheck checks the web service, which can be available while Windows is installing, waiting for resources or stopped.
The default password is unique to each deployment. All public desktop assets and WebSocket connections require authentication. The template exposes only HTTP port 8006 through Railway HTTPS. Public RDP and VNC ports are not configured.
Common Use Cases
- Run compatible Windows applications from a Mac, Linux machine or Chromebook through the browser.
- Use PowerShell and Windows Server administration tools in a persistent environment.
- Test software or scripts on Windows Server 2022 while keeping your files across redeploys.
Dependencies for Windows Hosting
Deployment Dependencies
The Start Command uses a pinned Dockur Windows image and downloads Windows Server 2022 installation media from Microsoft. See Railway volume limits for storage requirements.
Why Deploy Windows on Railway?
The same HTTPS domain opens the Windows desktop and shows startup diagnostics.
Configuration
| Variable | Default | Purpose |
|---|---|---|
USERNAME | admin | Initial Windows account and web login. |
PASSWORD | Generated | Initial Windows password and web password; minimum 16 characters. |
VERSION | 2022 | Windows Server 2022 Evaluation installation media. |
RAM_SIZE | 3G | Desired guest RAM. Automatically capped to leave at least half the container memory for the host. |
CPU_CORES | 4 | Emulated CPU cores. |
ADAPTER | e1000e | Network adapter validated for complete HTTP transfers on Railway. |
DISK_SIZE | auto | Sizes a fresh Windows disk to the volume, up to 48 GiB. An installed disk keeps its existing size. Set an explicit size to grow it after expanding the volume. |
SERVERLESS_PAUSE_NETWORK | false | Set true to pause the Windows network after the last browser desktop disconnects. |
SERVERLESS_IDLE_SECONDS | 300 | Idle delay before network pause, in seconds (30–86400). |
Account variables apply during initial installation. Manage later Windows account changes inside Windows; the web login follows Railway's PASSWORD variable.
Keep one replica and the 120-second draining period. Save work before stopping or redeploying: the disk preserves saved data, not running applications or unsaved documents.
Memory management on an 8 GB service
RAM_SIZE is the Windows guest allocation, not the Railway container limit. The default guest gets 3 GiB while QEMU, installation tools and filesystem cache use the remaining headroom. If a higher RAM_SIZE exceeds the budget, the wrapper reduces it automatically. On Railway's 8,000,000,000-byte limit the guest ceiling is 3 GiB. Free and Trial memory limits are rejected before starting the VM.
Windows is configured with a 4 GiB initial page file, growing up to 12 GiB, on its persistent C: disk. When applications exceed physical guest RAM, Windows can move idle pages to disk and slow down. An automatic restart at the end of first setup applies this configuration. The initial 4 GiB reservation consumes disk space; leave room on C: for growth and user files.
VirtIO ballooning is enabled, with a 2 GiB guest minimum, so the host can reclaim guest memory under pressure. The wrapper records guest RAM, the container memory limit and kernel OOM counters in Railway logs. Its budget check replaces Dockur's free-memory heuristic, which also counts temporary installation file cache.
Paging and reclamation aim to keep normal pressure below Railway's hard limit. Memory remains finite: applications can fail if RAM plus the page file is exhausted, the disk fills or another container process exceeds the remaining budget. Linux swap and a writable soft memory throttle are unavailable in the tested Railway environment.
The first installation needs a separate persistent volume, so the 8 GB memory profile still requires a Pro or Enterprise workspace. To request a 48 GiB virtual disk explicitly, use a 64 GB or larger Railway volume with room for the installer. To apply the paging settings to an older Windows installation, run the updated setup script inside Windows and restart the guest.
Validation on 2026-11-08 used a hard 8 GB container limit: fresh installation completed, then a process allocated 6 GiB and used 5.46 GiB of page file before releasing it. Host peak: 7.01 GB; kernel OOM kills: 0. This bounded test does not cover arbitrary workloads.
Serverless and automatic network pause
Railway Serverless and network pause are off by default. Windows background traffic can prevent sleep after the desktop closes. The optional pause disconnects the Windows virtual NIC when no browser desktop is connected, allowing Railway to detect inactivity.
Enable after installation
- Finish Windows installation and its final automatic restart with Railway Serverless disabled. Early sleep can interrupt setup.
- Set
SERVERLESS_PAUSE_NETWORK=true. KeepSERVERLESS_IDLE_SECONDS=300for a five-minute delay, or choose 30–86400 seconds. - Enable Serverless in the Railway service settings and redeploy. The environment variable alone does not enable Railway Serverless.
- Save work and close every connected noVNC tab. An open desktop connection counts as activity even without typing.
What happens
- A connected browser desktop keeps Windows networking enabled.
- After the last desktop disconnects and the idle delay expires, the wrapper disconnects the entire Windows NIC. A minimum three-minute boot grace period applies, and first installation must complete before a network pause is allowed.
- The authenticated web desktop remains reachable. A new desktop connection restores the NIC at the next check, normally within five seconds, plus Windows network reconnection time.
- If Railway is already sleeping, opening the HTTPS URL starts the container and boots Windows with the NIC enabled. Saved disk data persists; running applications and unsaved documents do not.
- Railway normally sleeps 5–10 minutes after the last outbound packet. With the default five-minute pause delay, expect roughly 10–15 minutes after closing the desktop, sometimes longer. This removes Windows background traffic; it does not force Railway's timer. See Railway Serverless.
Activity means browser desktop connections, not Windows workload activity. This mode interrupts downloads, updates, background jobs, outbound connections and server applications using the Windows NIC. RDP and other Windows clients do not keep it awake. Keep SERVERLESS_PAUSE_NETWORK=false for continuous network workloads. To disable the pause, set it back to false and redeploy; disable Railway Serverless too when continuous operation is required.
Storage remains billed during sleep. Keep the 120-second draining period so Windows has time to shut down.
Validation
The 2026-11-08 network-pause test used a 60-second idle delay: sleep after 6 min 08 s, protected HTTPS back in 1.19 s and desktop in 1 min 41 s. Internet and saved data persisted. Reconnection before sleep also restored networking without rebooting. Timings vary; the default delay is five minutes.
Windows licensing
The default is Windows Server 2022 Evaluation, limited to 180 days and Microsoft's evaluation conditions. No activation license or key is supplied. For ongoing or production use, obtain appropriate Windows Server and third-party hosting rights; activation alone does not establish them. Sleep does not extend the evaluation. Review Microsoft evaluation information and outsourcing licensing guidance.
Community-maintained packaging. Windows follows Microsoft's terms; the wrapper uses this repository's MIT license.
Template Content
Windows Server
dockurr/windows