This guide covers the steps required to set up the Astera development environment on Windows using Windows Subsystem for Linux (WSL2).
- Open PowerShell as Administrator and run:
wsl --install - Restart your computer if prompted.
- Once installed, set up your Ubuntu user and password.
- Update your Ubuntu packages:
sudo apt update && sudo apt upgrade -y
- Install Docker Desktop for Windows.
- In Docker Desktop Settings, go to General and ensure Use the WSL 2 based engine is checked.
- Go to Resources > WSL Integration and enable integration for your Ubuntu distro.
- Verify Docker is running inside WSL:
docker ps
Inside your WSL terminal, run:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
rustup target add wasm32-unknown-unknownInstall the Stellar CLI inside WSL:
cargo install --locked stellar-cli --features optEnsure ~/.cargo/bin is in your PATH.
Install NVM (Node Version Manager) inside WSL:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc
nvm install 20
nvm use 20To avoid issues with Windows CRLF line endings, configure Git inside WSL to use LF:
git config --global core.autocrlf falseIf you have already cloned the repo, you might need to re-clone it or run:
git rm --cached -r .
git reset --hardFrom the root of the project:
docker-compose up -dNote: If you encounter permission issues with mounted volumes, ensure the project is cloned into the WSL filesystem (e.g., ~/source/Astera) rather than the Windows filesystem (/mnt/c/...).
Issue: Cargo builds fail or Docker volumes have incorrect permissions.
Solution: Move your project to the native WSL filesystem (e.g., ~/projects/Astera) instead of /mnt/c/.
Issue: localhost from Windows browser doesn't connect to services in WSL.
Solution: Usually, WSL2 forwards ports to localhost automatically. If not, find the WSL IP using hostname -I and use that.
Issue: stellar command not found.
Solution: Add export PATH="$HOME/.cargo/bin:$PATH" to your ~/.bashrc or ~/.zshrc.