How to set up a development environment for Zig on Ubuntu¶
This guide covers installing the Zig toolchain and setting up a development environment on Ubuntu. Zig is a general-purpose systems programming language designed for robustness, performance, and simplicity, with built-in cross-compilation support.
Installing Zig¶
There are two main options for installing Zig on Ubuntu:
Using Ubuntu packages from the Ubuntu archive: Official packages maintained by the Ubuntu team and installed through the Ubuntu package-management system. Packages are available from Ubuntu 25.10 onward. Use this method on a supported release to get a system-managed installation.
Using the Zig snap, a community-maintained snap package. Use this method if you need a recent Zig release on an older Ubuntu release, or want a version not yet available in the archive.
Installing Zig from Ubuntu packages¶
Zig packages are available in the Ubuntu archive from Ubuntu 25.10 (Questing Quokka) onward.
Install the
zigpackage:dev@ubuntu:~$sudo apt install zigVerify the installation:
dev@ubuntu:~$zig version
Installing Zig from the snap¶
The Zig snap is a community-maintained package available for all Ubuntu releases. The latest/beta channel tracks Zig stable releases.
Install the snap from the
latest/betachannel:dev@ubuntu:~$sudo snap install zig --classic --channel=latest/betaVerify the installation:
dev@ubuntu:~$zig version
Note
The Zig snap does not currently publish a latest/stable channel. The latest/beta channel tracks the most recent Zig stable releases. The latest/edge channel tracks nightly development builds.
IDE integrations¶
Several editors and IDEs support Zig, primarily through ZLS (Zig Language Server), which provides code completion, go-to-definition, error highlighting, and other language features.
- Visual Studio Code
Install VS Code from the Snap Store, then add the Zig Language Support extension from the VS Code Marketplace. The extension automatically installs and manages ZLS.
Install VS Code with:
dev@ubuntu:~$sudo snap install code --classic- Codium
The freely-licensed binary distribution of VS Code. Install the Zig Language Support extension from the Open VSX registry.
Install Codium with:
dev@ubuntu:~$sudo snap install codium --classic
Note
ZLS is managed automatically by the VS Code and Codium extensions. For other editors (Vim,
What next¶
See the tutorial introducing the use of Zig and related tooling: Develop with Zig on Ubuntu.