book/src/getting-started/install-linux.md
raylib-rs builds on Linux using the system GCC or Clang toolchain. You need the X11 and/or Wayland development headers, CMake, and the OpenGL headers. The exact package names differ by distribution.
Rust 1.85+ — install via rustup.
CMake 3.15+ and build essentials — see the distribution-specific instructions below.
Native graphics headers — X11 + OpenGL are required for the default build. Wayland headers are optional (only needed for the wayland feature).
sudo apt-get update
sudo apt-get install --no-install-recommends -y \
cmake \
libasound2-dev \
libudev-dev \
libx11-dev \
libxrandr-dev \
libxinerama-dev \
libxcursor-dev \
libxi-dev \
libgl1-mesa-dev
This is the exact package list used by the CI check.yml, test.yml, and book.yml workflows.
sudo dnf install -y \
cmake \
gcc-c++ \
alsa-lib-devel \
systemd-devel \
libX11-devel \
libXrandr-devel \
libXinerama-devel \
libXcursor-devel \
libXi-devel \
mesa-libGL-devel
sudo pacman -S --needed \
cmake \
base-devel \
alsa-lib \
systemd-libs \
libx11 \
libxrandr \
libxinerama \
libxcursor \
libxi \
mesa
cargo new my-raylib-game
cd my-raylib-game
cargo add raylib
cargo build
Replace src/main.rs with the hello-window snippet from the Quickstart and run with cargo run.
--features wayland. Additionally requires:
libwayland-dev libxkbcommon-devwayland-devel libxkbcommon-develwayland libxkbcommon--features drm,opengl_es_20. Renders directly to the framebuffer without a display server; useful for embedded/kiosk targets.cannot find libclang — install clang and libclang-dev (Ubuntu: sudo apt-get install clang libclang-dev; Fedora: sudo dnf install clang). Set the LIBCLANG_PATH environment variable if bindgen still cannot find it.
cmake: command not found — install cmake from your package manager (see above).
Wayland: display server not detected — if you are running under X11 and get Wayland compositor errors, ensure you are either using the wayland feature intentionally or have omitted it (X11 is the default).