How to Install ZLS on Ubuntu: The Zig Language Server
ZLS is the Zig Language Server, the piece that adds IDE-grade features to the Zig programming language. It implements the Language Server Protocol, so any LSP-aware editor, Neovim, VS Code, Helix, Emacs or Sublime Text, can lean on it for autocompletion, go-to-definition, hover docs, diagnostics and inlay hints while you write Zig.
ZLS is maintained separately from the Zig compiler and follows Zig’s rapid release cadence. Each ZLS build targets a specific Zig version, which is why keeping the language server aligned with the compiler is one of the trickier parts of a hand-rolled Zig setup.
Ubuntu does not include ZLS in its default archives, and building it yourself means bringing in a Zig toolchain and a compile step. The unofficial deb.griffo.io repository solves this with an up-to-date, prebuilt zls package installable via apt, so you can get straight to writing Zig.
Install the Latest ZLS on Ubuntu: The Short Version
If you only came for the commands, this adds the repository and installs the latest ZLS .deb package on Ubuntu:
sudo install -d -m 0755 /etc/apt/keyrings
curl -fsSL https://deb.griffo.io/EA0F721D231FDD3A0A17B9AC7808B4DD62C41256.asc | sudo gpg --dearmor --yes -o /etc/apt/keyrings/deb.griffo.io.gpg
echo "deb [signed-by=/etc/apt/keyrings/deb.griffo.io.gpg] https://deb.griffo.io/apt $(lsb_release -sc 2>/dev/null) main" | sudo tee /etc/apt/sources.list.d/deb.griffo.io.list > /dev/null
sudo apt update
sudo apt install zls
The rest of this guide explains what each command does, how to verify the install, how to keep ZLS up to date, and what to check when something goes wrong.
What Makes ZLS Special?
- 🧠 Full LSP feature set - Completion, go-to-definition, find references, hover and rename
- ⚡ Fast and native - Written in Zig, with low latency even on large codebases
- 🔍 Semantic analysis - Understands Zig’s comptime and type system for accurate results
- 📝 Inlay hints - Inline type and parameter hints for more readable code
- 🩺 Diagnostics - Reports errors and warnings straight in the editor
- 🎨 Editor agnostic - Works with any editor that speaks LSP
- 🛠️ Build-aware - Resolves imports and dependencies via your
build.zig - 🔗 Version-matched - Builds pair with specific Zig releases for correctness
Why Use the deb.griffo.io Repository?
- Easy installation and updates through the APT package manager
- Automatic dependency management handled by Debian/Ubuntu packaging
- Always tracks upstream releases so ZLS stays in step with Zig
- No compiling from source and no dedicated Zig build toolchain for the server
- Works across supported Ubuntu releases with the codename detected automatically
Prerequisites
Before you begin, make sure you have:
- An Ubuntu system (Jammy 22.04 LTS, Noble 24.04 LTS, or newer)
sudoprivilegescurlinstalled (sudo apt install curlif needed)- The Zig compiler installed (see the Zig install guide)
- An LSP-capable editor such as Neovim, VS Code or Helix
Step 1: Add the deb.griffo.io Repository
Register the signing key and repository with APT:
# Create the keyrings directory
sudo install -d -m 0755 /etc/apt/keyrings
# Download and install the repository GPG key
curl -fsSL https://deb.griffo.io/EA0F721D231FDD3A0A17B9AC7808B4DD62C41256.asc | sudo gpg --dearmor --yes -o /etc/apt/keyrings/deb.griffo.io.gpg
# Add the repository (auto-detects your distro codename)
echo "deb [signed-by=/etc/apt/keyrings/deb.griffo.io.gpg] https://deb.griffo.io/apt $(lsb_release -sc 2>/dev/null) main" | sudo tee /etc/apt/sources.list.d/deb.griffo.io.list > /dev/null
# Update the package list
sudo apt update
Command by command:
- Keyrings directory - Ensures
/etc/apt/keyringsexists with correct permissions. - GPG key - Downloads and de-armours the key for signature verification.
- Repository entry - Adds the source bound to the key, with
lsb_release -scinserting your Ubuntu codename such asnoble. - Update - Refreshes the package metadata.
Step 2: Update the Package List
Run this if you have not already:
sudo apt update
Step 3: Install ZLS
Install the package:
sudo apt install zls
APT handles the dependencies and puts the zls binary on your PATH.
Step 4: Verify the Installation
Check the version:
zls --version
Expected output looks like:
0.14.0
For best results this should share its major/minor version with your Zig install (zig version), because each ZLS build is tuned for a particular Zig release.
Getting Started with ZLS
ZLS runs as a background server; your editor starts it automatically for .zig files rather than you invoking it directly.
Confirm the Binary Path
Editor configurations often want the absolute path:
which zls
# /usr/bin/zls
You can confirm it launches with:
zls --help
VS Code
Install the official Zig Language extension, then tell it to use the packaged server instead of downloading its own. In settings.json:
{
"zig.zls.path": "/usr/bin/zls",
"zig.zls.enableInlayHints": true
}
Neovim
Using Neovim’s built-in LSP client with nvim-lspconfig, ZLS is a short block of Lua:
require('lspconfig').zls.setup({
settings = {
zls = {
enable_inlay_hints = true,
warn_style = true,
},
},
})
Open a .zig file and completion, hover and diagnostics are ready.
Helix
Helix has native LSP support and ships with a ZLS definition, so having zls on your PATH is generally sufficient. Verify detection with:
hx --health zig
To override the command, add it to ~/.config/helix/languages.toml:
[language-server.zls]
command = "zls"
[[language]]
name = "zig"
language-servers = ["zls"]
Project Configuration
Tune ZLS per project with a zls.json in the project root, for example to enable build-on-save diagnostics and hints:
{
"enable_build_on_save": true,
"enable_inlay_hints": true,
"inlay_hints_show_variable_type_hints": true
}
Keeping ZLS Updated
Upgrades come through routine package maintenance:
sudo apt update && sudo apt upgrade
Since ZLS is version-matched to Zig, upgrade them together. When you adopt a new Zig release, run apt upgrade so ZLS moves with it, then confirm both with zig version and zls --version.
Other Tools from deb.griffo.io
The repository packages other tools that suit a Zig workflow:
- Zig - The systems programming language ZLS supports
- Helix - A post-modern modal editor with built-in LSP
- Neovim - The hyperextensible Vim-based editor
- Lazygit - A fast terminal UI for Git
Troubleshooting
GPG or Key Errors
If APT cannot verify the repository, re-import the signing key:
sudo rm -f /etc/apt/keyrings/deb.griffo.io.gpg
curl -fsSL https://deb.griffo.io/EA0F721D231FDD3A0A17B9AC7808B4DD62C41256.asc | sudo gpg --dearmor --yes -o /etc/apt/keyrings/deb.griffo.io.gpg
sudo apt update
Package Not Found
If APT cannot find the zls package:
- Run
sudo apt updateto refresh the index. - Confirm you are on a supported release (Jammy 22.04, Noble 24.04, or newer).
- Inspect the source entry:
cat /etc/apt/sources.list.d/deb.griffo.io.list
Version Mismatch with Zig
By far the most common ZLS issue is a version mismatch with the compiler. If completion misbehaves or the server logs errors, compare the two:
zig version
zls --version
They should share the same major/minor version. If they differ, run sudo apt upgrade to bring both current and restart your editor so it relaunches the server.
Uninstalling
To remove ZLS:
sudo apt remove zls
Delete any editor settings that reference it and remove per-project zls.json files you no longer need. To remove the repository:
sudo rm /etc/apt/sources.list.d/deb.griffo.io.list
sudo rm /etc/apt/keyrings/deb.griffo.io.gpg
sudo apt update
Conclusion
ZLS makes any LSP-capable editor a productive Zig environment, with completion, diagnostics and hints that genuinely understand Zig. Installing it from deb.griffo.io takes the pain out of Zig tooling, keeping the server current and matched to your compiler through a plain apt upgrade.
Point your editor at /usr/bin/zls, open a .zig file, and full IDE features are yours with no manual builds.
Frequently Asked Questions
How do I install the latest ZLS on Ubuntu?
Add the deb.griffo.io APT repository and its signing key, then run sudo apt install zls. The repository tracks upstream ZLS releases, so you get the latest packaged version rather than a build frozen when your distribution was released.
Is there a .deb package for ZLS?
Yes. deb.griffo.io publishes ZLS as a signed .deb for Ubuntu. You could download that .deb and install it by hand, but adding the repository is the better option: APT then resolves dependencies and picks up new versions on its own.
How do I update ZLS to the latest version?
Run sudo apt update && sudo apt upgrade. Once ZLS is installed from APT there is no separate updater to remember, since new releases arrive with the rest of your system updates.
How do I install ZLS on Debian?
Exactly the same way; lsb_release -sc simply resolves to a different codename. There is a companion guide with the Debian specifics: How to install ZLS on Debian.
Which Ubuntu releases are supported?
Jammy 22.04 LTS, Noble 24.04 LTS and newer. Because the repository line is built from lsb_release -sc, the matching suite is selected for you.
Resources
Disclaimer: The deb.griffo.io repository is an unofficial community project and is not affiliated with the official Debian or Ubuntu projects, or with the upstream ZLS project.