Installation
- Linux
- Windows
- macOS
Consider getting Zig from your distribution's package manager. Most major linux distros package the latest Zig release.
Installing manually
-
Download a prebuilt version of Zig.
Choose a build of Zig 0.12 for Linux that matches your CPU architecture. If you're unsure which architecture you're using, this can be found with:
uname -m
-
Extract the archive using tar, e.g.
tar xf zig-linux-x86_64-0.12.0.tar.xz
-
Add the location of your Zig binary to your path, e.g.
echo 'export PATH="$HOME/zig-linux-x86_64-0.12.0:$PATH"' >> ~/.bashrc
Consider getting Zig from a package manager such as chocolatey, scoop, or winget.
All commands shown are to be used inside Powershell.
choco install zig
winget install zig.zig
scoop install zig
Installing manually
-
Download a prebuilt version of Zig.
Choose a build of Zig 0.12 for Windows that matches your CPU architecture. Most Windows systems use
x86_64
, also known asAMD64
. If you're unsure which architecture you're using, this can be found with:$Env:PROCESSOR_ARCHITECTURE
-
Extract Zig.
-
Add Zig to your path:
- Current User
- System Wide
[Environment]::SetEnvironmentVariable(
"Path",
[Environment]::GetEnvironmentVariable("Path", "User") + ";C:\_\zig-windows-_",
"User"
)[Environment]::SetEnvironmentVariable(
"Path",
[Environment]::GetEnvironmentVariable("Path", "Machine") + ";C:\_\zig-windows-_",
"Machine"
)Close your terminal and create a new one.
Consider getting Zig from a package manager such as brew.
brew install zig
Verifying your install
Verify your installation with zig version
. The output should look like this:
$ zig version
0.12.0
Extras
For completions and go-to-definition in your editor, consider installing the Zig Language Server.
Consider joining a Zig community.