Skip to main content

🪟 Windows

LaraKube CLI provides native Windows CLI support (larakube.exe). You can run all commands directly in Windows Terminal (PowerShell or Command Prompt) on Windows — without needing to drop into a Linux shell.

Behind the scenes, LaraKube automatically bridges project and local cluster commands into LaraKube Linux (the larakube-ubuntu WSL2 distro) where k3s (Kubernetes) and rootless Podman run with full Linux container compatibility.


🛠 Prerequisites​

  1. WSL2: If you do not have WSL2 enabled yet, run this in PowerShell as Administrator:
    wsl --install
  2. That's it! larakube setup handles the rest — including .wslconfig mirrored networking, LaraKube Linux synchronization, and local Kubernetes.
Only here for Cluster Tools?

Self-hosting chat, a wiki, or single sign-on on remote servers needs no local container runtime at all — pick Cluster Tools and remote clusters when larakube setup asks. See Cluster Tools Without a Dev Setup.

Docker Desktop Users

If you use Docker Desktop, you can keep using it. LaraKube Linux builds your images with its own rootless Podman, so the two don't depend on each other.


🚀 Setup Instructions​

Run all commands below directly in your Windows Terminal (PowerShell).

1. Install LaraKube CLI​

Open PowerShell and run:

irm https://docs.larakube.app/install.ps1 | iex

For the latest canary build (tip of develop):

$env:LARAKUBE_CHANNEL="canary"; irm https://docs.larakube.app/install.ps1 | iex

This installs larakube.exe into $HOME\.larakube\bin and automatically adds it to your user PATH.

2. Run Setup​

larakube setup

Running larakube setup from Windows Terminal:

  • Configures %USERPROFILE%\.wslconfig with mirrored networking (networkingMode=mirrored) so all local ports and .test domains route seamlessly to Windows localhost without NAT hurdles.
  • Synchronizes the inner LaraKube Linux CLI engine (larakube-linux-x64).
  • Sets up the container runtime (rootless Podman by default, Docker Engine if you choose it) and k3s inside LaraKube Linux, with Traefik configured on hostNetwork: true.
  • Prompts for a clean WSL restart if .wslconfig networking was updated.

3. Trust SSL Certificates​

larakube trust

This uses native certutil.exe to register the LaraKube Local Root CA into the Windows Certificate Store. Edge, Chrome, and Brave on Windows will immediately trust your local .test HTTPS domains.

4. Create and Start Your First App​

larakube new my-app
cd my-app
larakube up

All operational verbs (up, down, artisan, composer, npm, heal) execute seamlessly through the WSL bridge while keeping you in Windows Terminal.

During larakube up, LaraKube syncs your project domains (my-app.test, traefik.test, etc.) into Windows hosts (C:\Windows\System32\drivers\etc\hosts) mapping to 127.0.0.1 with a single UAC prompt.


🌐 Local Networking & DNS Architecture​

On Windows, LaraKube uses a rock-solid, zero-conflict networking model:

  1. RFC 2606 .test TLD: All local applications default to .test (e.g. https://my-app.test).
  2. Direct Ingress via hostNetwork: true: Traefik binds directly to ports 80 and 443 in the WSL root network namespace.
  3. WSL2 Mirrored Networking: With networkingMode=mirrored, ports 80 and 443 are immediately accessible from Windows browsers at 127.0.0.1.
  4. Clean hosts Synchronization: Domain names are resolved via C:\Windows\System32\drivers\etc\hosts. LaraKube synchronizes these entries during larakube up or larakube hosts.
Why Not DNSMasq or NRPT on Windows?

Windows runs host services (svchost.exe / SharedAccess / Internet Connection Sharing) that listen on host port 0.0.0.0:53. In WSL2 mirrored networking, this creates a port conflict that prevents Linux DNS forwarders like dnsmasq from binding port 53, resulting in connection reset errors (Win32Exception 10054). Syncing entries in Windows hosts ensures 100% reliable resolution without conflicting with Windows network services.


🔀 Where Commands Run on Windows​

LaraKube splits commands between Windows and LaraKube Linux based on what they touch:

Always in LaraKube Linux (Project & Local Cluster Commands)​

Every project command runs inside LaraKube Linux for every environment (both local and cloud), because your project code, container builder, and CLI tools live there:

  • Project lifecycle & deploy (all environments): up, down, heal, start, stop, reload, about, doctor, services:show, dotenv, dotenv:audit, dotenv:push, dotenv:pull, env:remove, cloud:deploy, cloud:configure, pipeline:test, and any command run from inside a project folder (.larakube.json).
  • Local cluster & dev workflow: cluster:setup, cluster:start, cluster:stop, cluster:destroy, trust, trust:check, trust:remove, trust:reset, art, exec, php, node, composer, npm, yarn, pnpm, bun, shell, test, logs, tunnel.
  • Scaffolding, builds & local companions: new, docs:new, framework *:new, clone, init, purge, build, static:build, smoke, companion:*, feature:*, share:*.

Always on Windows (Server & Cluster Tool Commands)​

Server provisioning, Cluster Tools, and host management always run directly on Windows — even when invoked from inside a project folder:

  • Cloud servers & Cluster Tools: cloud:create, cloud:destroy, cloud:nuke, cloud:scale, cloud:repair, cloud:harden, cloud:init, cloud:init:doks, cloud:init:eks, cloud:init:gke, cloud:migrate, cloud:provision*, traefik:setup, devbox:connect, k9s, tls:*.
  • Host & WSL management: setup, setup:status, setup:reinstall, update, uninstall, wsl:*.

Without LaraKube Linux, Windows can still create and manage servers and Cluster Tools — you only need LaraKube Linux when you build, run, or deploy projects.


🔑 Shared Logins & Config​

Credentials and configuration created on Windows are shared into LaraKube Linux automatically, so you do not need to sign in twice:

  • ~/.kube — Kubernetes cluster kubeconfigs
  • ~/.aws — AWS CLI credentials and profiles
  • Google Cloud (gcloud) config — GCP authentication and project defaults
  • ~/.larakube/config.json — registered servers, clusters, and LaraKube settings
  • SSH keys — SSH keys created on Windows work directly from inside LaraKube Linux

⚙️ WSL Management Commands​

LaraKube includes dedicated commands for managing the underlying WSL engine directly from Windows Terminal:

larakube wsl:status # Check running WSL distros and mirrored networking config
larakube wsl:restart # Safely restart WSL (checks for active distros before shutdown)
larakube wsl:shutdown # Terminate WSL background processes

📐 Why Native Windows + WSL2?​

LaraKube pairs a native Windows binary with WSL2 to give you the best of both worlds:

  • Native Terminal Ergonomics: You remain in Windows Terminal or PowerShell, using familiar Windows paths, environment variables, and shell tools.
  • True Linux Kernel: Kubernetes requires native Linux cgroups, namespaces, and kernel features that only WSL2 provides on Windows.
  • Mirrored Networking: With networkingMode=mirrored, Kubernetes ingress ports (80/443) bind directly to Windows localhost, eliminating port-forwarding issues.
  • Keep projects in LaraKube Linux: Every project command runs inside LaraKube Linux, so keep your project folders there (\\wsl.localhost\larakube-ubuntu\home\larakube\projects). Builds and file watching are much faster there than across a Windows drive.