Deploy Windows Server
Windows Server desktop with optional network pause for Railway Serverless.
Windows Server
Just deployed
/storage
Deploy and Host Windows Server on Railway
Run Windows Server on Railway with a browser-accessible desktop, PowerShell and a persistent Windows system disk. This template packages Dockur Windows with authenticated HTTPS access, automatic installation and graceful shutdown. The default edition is Windows Server 2022 with Desktop Experience, downloaded directly from Microsoft during first startup. Optional environment variables can pause the Windows network after the browser desktop disconnects to help Railway Serverless sleep; see the Serverless section before enabling them.
About Hosting Windows Server
Windows runs in a QEMU virtual machine inside one Railway service. Open the generated HTTPS domain to access the desktop through noVNC. The persistent /storage volume contains the Windows system disk, installed applications, files and settings. No external database is required.
Railway does not provide usable KVM acceleration in the tested environment, so this template uses CPU emulation. Booting Windows and launching applications are slower than on a hardware-accelerated Windows VPS. Allow at least 8 GB of service memory and 4 vCPU; Windows receives 4 GB RAM and four virtual CPU cores by default.
First connection
- Deploy the template with a volume of at least 64 GB mounted at
/storage. Confirm the allocated volume size before installation; Railway defaults and limits depend on your plan. - Open the generated HTTPS domain. Use
USERNAME(defaultadmin) and the generatedPASSWORDfrom Railway Variables. - Wait for the automatic Windows installation to finish. The initial installation can take around 30 minutes or longer; the web interface is available while installation runs.
- Use the same account and password for the Windows session if prompted.
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
- A Windows Server desktop accessible from a browser.
- Windows administration with PowerShell and graphical management tools.
- Running compatible Windows applications and server tools.
- Maintaining a persistent Windows environment across container restarts and redeployments.
Dependencies for Windows Server Hosting
- One service using the pinned Dockur Windows image and the startup script included in the template.
- One persistent volume at
/storage, at least 64 GB for the default 48 GB virtual disk and installation media. - A paid Railway plan allowing at least 8 GB memory, 4 vCPU and a 64 GB persistent volume for this service.
- Access to Microsoft's download servers during installation.
- Appropriate Microsoft usage rights for the selected edition and hosting environment.
Deployment Dependencies
- Dockur Windows image and upstream source
- Microsoft Windows Server 2022 installation media
- Railway persistent volumes
- Railway Serverless, when enabled after installation
The template Start Command contains the complete initialization wrapper. It writes the launcher and Windows setup files, then starts Dockur.
Why Deploy Windows Server on Railway?
- Browser desktop through one authenticated HTTPS domain.
- Persistent Windows system disk, including installed software and user files.
- Generated credentials instead of a shared default password.
- Automatic installation from Microsoft's official media.
- A pinned Dockur image for repeatable deployments.
- Graceful ACPI shutdown with a 120-second Railway draining period.
- Optional automatic guest network pause to help Railway Serverless sleep.
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 | 4G | Memory assigned to Windows. Keep headroom in the service limit. |
CPU_CORES | 4 | Emulated CPU cores. |
ADAPTER | e1000e | Network adapter validated for complete HTTP transfers on Railway. |
DISK_SIZE | 48G | Windows virtual disk capacity. Keep the Railway volume larger. |
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 configure the initial Windows installation. Changing them after installation does not update the existing Windows account; manage that account inside Windows. The web password follows Railway's PASSWORD variable.
Keep one replica attached to the volume. Save work before stopping, redeploying or enabling Serverless. A persistent disk preserves saved data, not running applications or unsaved documents. Keep the 120-second draining period so Windows can shut down cleanly.
Serverless and automatic network pause
Both Railway Serverless and automatic network pause are off by default. Windows services can send background traffic and prevent Railway from sleeping, even when the desktop tab is closed. The optional network pause disconnects the Windows virtual network adapter when no browser desktop is connected, allowing Railway to detect inactivity.
Enable after installation
- Finish the first Windows installation with Railway Serverless disabled. Enabling Serverless during installation can interrupt setup.
- In Railway Variables set
SERVERLESS_PAUSE_NETWORK=true. KeepSERVERLESS_IDLE_SECONDS=300for a five-minute delay, or choose another value between 30 and 86400 seconds. - Enable Serverless in the Railway service settings and redeploy to apply both changes. The environment variable alone does not enable Railway Serverless.
- Save your work and close every noVNC desktop tab. An open connected desktop tab counts as activity even if you are not typing.
What happens
- While a browser desktop is connected, Windows keeps its network access.
- After the last desktop disconnects and the idle delay expires, the wrapper disconnects the entire Windows virtual NIC. A three-minute minimum boot grace period protects startup, and the wrapper waits for the initial installation to complete before allowing a network pause.
- The authenticated web desktop remains reachable. Reopening a desktop connection restores the NIC at the next check (normally within five seconds), plus Windows network reconnection time.
- If Railway has already put the service to sleep, opening its HTTPS URL starts the container and boots Windows with the NIC enabled. Saved files remain on
/storage; running applications and unsaved work are not preserved. - Railway normally sleeps 5–10 minutes after the last outbound packet, according to its Serverless documentation. With a 300-second network pause delay, expect roughly 10–15 minutes after closing the desktop, sometimes longer. Network pause helps remove Windows background traffic; it does not force Railway's sleep timer.
The idle check measures browser desktop connections, not Windows workload activity. When enabled, it also interrupts downloads, updates, background jobs, outbound connections and any server application using the Windows NIC. RDP sessions and other Windows clients do not keep this mode awake. Keep SERVERLESS_PAUSE_NETWORK=false when those workloads require continuous networking. Set it back to false and redeploy to disable the automatic pause; disable Railway Serverless too if the server must remain running.
Storage remains billed while compute sleeps. Keep the 120-second draining period for a clean Windows shutdown.
Validation
On 2026-11-08, with 4 vCPU / 8 GB service memory and 4 GB guest RAM, the automatic mode was tested with a 60-second idle delay. Networking stayed enabled throughout a connected desktop session and paused about one minute after disconnection. A reconnection restored Internet without rebooting Windows; HTTPS returned a complete response. After another disconnection, Railway reached SLEEPING in 6 min 08 s, about five minutes after the NIC pause. An HTTPS request received the authentication response in 1.19 s and the Windows desktop was observed after 1 min 41 s, with the saved file preserved and HTTPS working again.
These are measured test results, not guaranteed timers. The default five-minute pause delay adds four minutes compared with the one-minute test setting. With normal Windows networking and the pause option disabled, the earlier test stayed awake for more than 15 minutes.
Windows licensing
The default Microsoft download is Windows Server 2022 Evaluation, with a 180-day evaluation period and Microsoft's evaluation restrictions. No Windows activation license or product key is sold or supplied by this template.
For ongoing or production use, obtain the appropriate Windows Server licensing and third-party hosting rights for your deployment. Activation alone does not establish those rights. Sleep does not extend the evaluation period. Review Microsoft's evaluation information and outsourcing licensing guidance.
Community-maintained packaging, not affiliated with Microsoft, Dockur or Railway. Windows remains subject to Microsoft's terms; the wrapper code follows this repository's MIT license.
Template Content
Windows Server
dockurr/windows