How to Install ZLS on Debian: The Zig Language Server

ZLS is the Zig Language Server: the component that brings modern IDE features to the Zig programming language. It speaks the Language Server Protocol, so any LSP-capable editor, be it Neovim, VS Code, Helix, Emacs or Sublime Text, can use it for completion, go-to-definition, hover documentation, diagnostics and inline hints as you write Zig.

ZLS is a separate project from the Zig compiler itself, and it tracks Zig’s fast-moving releases closely. A given ZLS build is designed to match a particular Zig version, which makes keeping the two in sync one of the more fiddly parts of a Zig setup if you do it by hand.

ZLS is not packaged in the official Debian repositories, and building it from source pulls in a Zig toolchain and a compile step. The unofficial deb.griffo.io repository provides an up-to-date, prebuilt zls package that installs and updates with apt, so you spend your time writing Zig instead of building your tools.

Install the Latest ZLS on Debian: The Short Version

If you only came for the commands, this adds the repository and installs the latest ZLS .deb package on Debian:

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 itself, with low latency even on large projects
  • 🔍 Semantic analysis - Understands Zig’s comptime and type system for accurate results
  • 📝 Inlay hints - Inline type and parameter hints to make code easier to read
  • 🩺 Diagnostics - Surfaces errors and warnings directly in your editor
  • 🎨 Editor agnostic - Works with any editor that speaks the Language Server Protocol
  • 🛠️ Build-aware - Resolves imports and dependencies through your build.zig
  • 🔗 Version-matched - Builds align 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 packaging
  • Always tracks upstream releases so ZLS keeps pace with Zig
  • No compiling from source and no separate Zig build toolchain just for the server
  • Works across supported Debian releases (Bookworm, Trixie and Sid)

Prerequisites

Before you begin, make sure you have:

  • A Debian-based system (Bookworm 12, Trixie 13, or Sid)
  • sudo privileges
  • curl installed (sudo apt install curl if 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

Add the signing key and the repository to 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

What each command does:

  1. Keyrings directory - Creates /etc/apt/keyrings with sensible permissions.
  2. GPG key - Downloads the key and stores it de-armoured for verification.
  3. Repository entry - Adds the source pinned to the key, with your Debian codename filled in by lsb_release -sc.
  4. Update - Refreshes the index so the package becomes available.

Step 2: Update the Package List

If you skipped the final line above, run:

sudo apt update

Step 3: Install ZLS

Install the package:

sudo apt install zls

APT resolves dependencies and drops the zls binary onto your PATH.

Step 4: Verify the Installation

Confirm the binary and check the version:

zls --version

You should see output similar to:

0.14.0

Ideally this major/minor version matches your installed Zig version (zig version), since a ZLS build is designed to pair with a specific Zig release.

Getting Started with ZLS

ZLS is a background server: you rarely run it directly. Instead you tell your editor where to find it, and the editor launches it for .zig files.

Confirm the Binary Path

Your editor configuration usually needs the absolute path to the server:

which zls
# /usr/bin/zls

You can also sanity-check that it starts and responds:

zls --help

Neovim

With Neovim’s built-in LSP client and nvim-lspconfig, enabling ZLS is a couple of lines in your Lua config:

require('lspconfig').zls.setup({
  settings = {
    zls = {
      enable_inlay_hints = true,
      warn_style = true,
    },
  },
})

Open any .zig file and completion, diagnostics and hover become available immediately.

VS Code

Install the official Zig Language extension, then point it at the packaged server rather than letting it download its own. In your settings.json:

{
  "zig.zls.path": "/usr/bin/zls",
  "zig.zls.enableInlayHints": true
}

Helix

Helix speaks LSP natively and already knows about ZLS, so simply having zls on your PATH is usually enough. Confirm the toolchain is detected with:

hx --health zig

If you need to override the command, add it to ~/.config/helix/languages.toml:

[language-server.zls]
command = "zls"

[[language]]
name = "zig"
language-servers = ["zls"]

Project Configuration

ZLS can be tuned per project with a zls.json in the project root. A minimal example enabling build-on-save diagnostics:

{
  "enable_build_on_save": true,
  "enable_inlay_hints": true,
  "inlay_hints_show_variable_type_hints": true
}

Keeping ZLS Updated

Upgrades come through the usual package workflow:

sudo apt update && sudo apt upgrade

Because ZLS is version-matched to Zig, upgrade the two together. When you move to a new Zig release, run apt upgrade so the ZLS package advances alongside it, then confirm both with zig version and zls --version.

Other Tools from deb.griffo.io

The repository packages other tools that fit naturally into 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-add 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:

  1. Run sudo apt update again to refresh the index.
  2. Confirm your release is supported (Bookworm, Trixie, or Sid).
  3. Check the source entry: cat /etc/apt/sources.list.d/deb.griffo.io.list

Version Mismatch with Zig

The most common ZLS problem is a mismatch with the Zig compiler. If completion behaves oddly or the server logs errors, compare the versions:

zig version
zls --version

They should share the same major/minor version. If they diverge, 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

Remove any editor configuration that references it, and delete per-project zls.json files if you no longer want them. 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 turns any LSP-capable editor into a capable Zig development environment, with completion, diagnostics and hints that understand Zig’s semantics. Installing it from deb.griffo.io removes the awkward part of Zig tooling, keeping the server up to date and version-matched to your compiler through a simple apt upgrade.

Point your editor at /usr/bin/zls, open a .zig file, and you have full IDE features without any manual builds.

Frequently Asked Questions

How do I install the latest ZLS on Debian?

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 Debian. 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 Ubuntu?

Exactly the same way; lsb_release -sc simply resolves to a different codename. There is a companion guide with the Ubuntu specifics: How to install ZLS on Ubuntu.

Which Debian releases are supported?

Bookworm 12, Trixie 13 and Sid. 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.