Before you start
- Linux, or WSL2 on Windows.
- Docker with Compose v2, working without
sudo. - Git.
macOS and Windows outside WSL are not supported yet.
Install
curl -fsSL https://nants.tmdevlab.com/install.sh | sh
The installer downloads the latest release, verifies its SHA-256 and puts the binary in ~/.local/bin/nants. Nothing runs with sudo.
Check your setup
nants doctor
Shows OK or FAIL for Docker, Compose, Git, the port and disk space, with what to do about each one.
Open
nants
Nants opens in your browser. If it does not, use the address printed in the terminal.
Use it from your phone
By default, Nants opens only on your computer. To open it on your phone or another device on the same network, go to Settings > Network access. The page guides you in steps and checks each one.
- WSL, NAT mode
- Turn on Local network access and restart Nants. Run the Script to enable it on Windows once, in PowerShell as administrator; it works on any network type. If Windows restarts, run it again. Then add your devices.
- WSL, mirrored mode
- The same steps. Here the script only creates the Windows firewall rule.
- Linux
- Turn it on, restart and add your devices. If you use a firewall, allow the Nants port and the app preview ports.
The option is saved and applies from the next start: Ctrl+C in the terminal and nants again. In network mode, the terminal shows the sign-in link for this computer, single use and valid for 10 minutes.
To add a device, click Add device. On the other device, open the address or scan the QR code and type the 6-digit code, which changes every 60 seconds. In the list of authorized devices, you can rename or revoke each one.
To turn it off, switch it off on the same page and, on WSL, run the Script to undo it on Windows. To turn it on for a single run, without saving:
nants --lan
Only devices you add can open Nants. The preview ports show the generated app, not Nants. On the local network, traffic is plain HTTP, not encrypted: for the most security, use it on a network you trust.
Troubleshooting
nants: command not found
~/.local/bin is not on your PATH. Add the line below to ~/.bashrc and open a new terminal.
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
Docker asks for permission
Add your user to the docker group and log in again. On WSL with Docker Desktop, turn on the integration for your distro under Settings, Resources, WSL integration.
sudo usermod -aG docker $USER
The port is already in use
Nants tries the next ports on its own and tells you which one it picked. To use a fixed port:
nants --port 3100
The page does not open in the Windows browser
An old Windows port redirect, set up for network access, takes the Nants port. Nants detects it, opens on the next free port and explains it in the terminal.
To undo it, run the Script to undo it on Windows in Settings > Network access. Or turn local network access on, if you want to keep it.
The sign-in link expired
The terminal link works once and for 10 minutes. Restart Nants for a new one, or add this browser with a code shown on a device that is already authorized.
It does not open on the other device?
Common causes: the device is on another network or on a guest network; the router isolates devices from each other; step 2 is still pending (on WSL, the IP may have changed after a Windows restart); the address was typed wrong, so prefer the QR code.
If the sign-in page opens on the device, the network is fine.
The first browser test is slow
The first time, Docker pulls the Playwright image, about 2 GB. After that it is cached.
Update
Run the install command again. It replaces the binary and keeps your settings, data and projects.
Uninstall
nants uninstall
Removes the binary and keeps your settings and data. To remove settings and data too, run nants uninstall --purge, which asks for confirmation.
Your projects in ~/NantsProjects and their containers are never deleted.