Zwift on Linux

Zwift on Linux

Zwift is one of the most popular platforms for indoor cycling. But Linux users who want to connect their smart trainer to Zwift know the problem: there is no native Linux version. For a long time, that meant installing Wine, tinkering, and hoping. With every Zwift update came the fear that the setup would break again.

But there is hope: the open-source project netbrain/zwift offers a clever container solution that makes Zwift surprisingly stable and performant on Linux. This blog post shows how it all works, what happens under the hood, and how to set it up.

Why Zwift on Linux is so tricky

Zwift is available exclusively for Windows (and macOS). Although the Wine community has made considerable progress, DirectX, updates, and copy protection keep creating stumbling blocks:

  • DirectX 11/12 rendering: Wine partially supports this, but it is prone to errors.
  • Bluetooth connections: Trainers and sensors connected through USB Bluetooth are often unreliable.
  • Updates: Every Zwift version can cause new problems. No "set it and forget it."

The solution: Zwift in a Docker container

Instead of using Wine directly on the host, netbrain/zwift packages the entire setup in a Docker container. The project comes from Norwegian developer Kim Eik and is fully open source. This brings several advantages at once:

  • Isolated Wine: The Wine version is tailored and preconfigured.
  • GPU support: Hardware acceleration can be enabled through the NVIDIA Container Toolkit.
  • Bluetooth bridge: Sensors connect through the Zwift Companion App.
  • Automated setup: Everything is installed with one command.

Setup in detail

Prerequisites

Before you get started, a few basic prerequisites should be met. You need either Docker or Podman to run containers on Linux. If you use an NVIDIA graphics card, the NVIDIA Container Toolkit must also be installed to use hardware acceleration in the container. And finally, you need the Zwift Companion App on your smartphone so you can pair sensors such as heart rate monitors or smart trainers via Bluetooth and bring them into the game.

Also note: the finished container is over 11 GB in size because it contains both a complete, preconfigured Wine setup and the Windows version of the Zwift application. So allow sufficient disk space and, if necessary, a little patience during the download.

Installation

sudo bash -c "$(curl -fsSL https://raw.githubusercontent.com/netbrain/zwift/master/bin/install.sh)"

This installs a desktop shortcut and the zwift command in the terminal. To start, simply run:

zwift

Many aspects can optionally be configured through environment variables (see the GitHub documentation).

Typical sources of errors and container features

In everyday use of the Zwift container, you can encounter a few classic pitfalls. First, the NVIDIA driver setup needs to be correct—a simple nvidia-smi in the terminal must work, otherwise the graphics card won't be detected in the container. Docker itself also needs the appropriate permissions: if you work without root, you should configure your user group accordingly or use Podman instead. In addition, PulseAudio must be properly integrated, as sound is passed from the host into the container. So check whether the socket file at /run/user/UID/pulse/native is available in the container.

Once everything is in place, the container offers plenty of practical features: GPU passthrough lets you use your graphics card fully in the game—especially with the NVIDIA Container Toolkit. As mentioned, sound is transmitted through PulseAudio. Your trainer or heart rate monitor connects through the Companion App over Wi-Fi, avoiding many Bluetooth problems. You can easily include your own .zwo workout files through a volume mount. And for power users: multiple Zwift instances can be launched in parallel—useful for testing or virtual group rides, for example.

NVIDIA and Wine under the hood

Despite the use of Docker, Wine is still used inside the container. However, this is not just any setup, but a specially tailored and preconfigured version. It already includes optimizations for DirectX, particularly through the use of DXVK, a Direct3D-to-Vulkan translator that significantly improves graphics performance. The environment has also been actively tested for stable operation with current Zwift versions—this considerably reduces the risk of update-related failures.

NVIDIA support is provided through nvidia-container-toolkit. It is important that nvidia-docker2 is installed and default-runtime is set accordingly:

{
  "default-runtime": "nvidia",
  "runtimes": {
    "nvidia": {
      "path": "nvidia-container-runtime",
      "runtimeArgs": []
    }
  }
}

Conclusion

With netbrain/zwift, using Zwift on Linux becomes a practical alternative. No Wine tinkering on the host, stable graphics performance through NVIDIA, no frustration during updates. Sure, some terminal work is required, but that's exactly what we Linux nerds love.

If you love indoor cycling and don't want to leave Linux, you'll find an almost perfect solution here. And if you want, you can even start multiple Zwift instances at the same time—in case you feel like simulating a group race ;-)