Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/PX4/PX4-Autopilot/llms.txt

Use this file to discover all available pages before exploring further.

Before you can build PX4 from source you need a working toolchain: a C++ cross-compiler for ARM targets, CMake, Python, and the Gazebo simulator libraries. The fastest path is Ubuntu 22.04 or 24.04 with the automated setup script. macOS and Windows via WSL2 are also supported, though with additional manual steps.
Ubuntu 22.04 (Jammy) and 24.04 (Noble) are the primary supported platforms. PX4’s CI and release builds run on Ubuntu 24.04; Ubuntu 22.04 is also fully supported. Older Ubuntu versions are not supported.The ubuntu.sh script installs everything you need in one step: the GCC ARM cross-compiler, CMake, Ninja, Python packages, and Gazebo Harmonic.
Run the script on a clean Ubuntu LTS installation. Running it on top of an existing customised system or an unsupported Ubuntu release may produce errors.
1

Clone the PX4 source repository

The setup script lives inside the repository, so clone it first. The --recursive flag fetches all required submodules.
git clone https://github.com/PX4/PX4-Autopilot.git --recursive
2

Run the setup script

Navigate into the cloned directory and run ubuntu.sh:
bash ./PX4-Autopilot/Tools/setup/ubuntu.sh
Acknowledge any prompts as the script progresses. The script installs packages via apt and pip, so you need sudo access.
Pass --no-nuttx to skip the ARM cross-compiler (if you only need SITL simulation), or --no-sim-tools to skip Gazebo (if you only need hardware builds).
3

Restart your computer

Some environment changes (group membership for serial ports, updated PATH) only take effect after a full reboot.
4

Verify the toolchain

Confirm that the ARM compiler installed correctly:
arm-none-eabi-gcc --version
You should see output similar to:
arm-none-eabi-gcc (15:13.2.rel1-2) 13.2.1 20231009
If you want the script without cloning the full source tree first, you can download it directly:
wget https://raw.githubusercontent.com/PX4/PX4-Autopilot/main/Tools/setup/ubuntu.sh
wget https://raw.githubusercontent.com/PX4/PX4-Autopilot/main/Tools/setup/requirements.txt
bash ubuntu.sh

Docker alternative

If you do not want to modify your host system, you can build inside a pre-configured Docker container. From the root of the PX4-Autopilot directory:
./Tools/docker_run.sh 'make px4_fmu-v6x_default'
The docker_run.sh script pulls the official PX4 build container and runs the provided make command inside it. No toolchain installation is required on the host.
Docker builds require Docker Engine (or Docker Desktop on macOS/Windows) to be installed and running. The first run downloads a multi-gigabyte container image.

Next steps

With your environment set up, you are ready to compile firmware and run your first simulation.

Build PX4 firmware

Compile for SITL and hardware targets, and flash firmware to a flight controller.

Developer overview

Understand the development workflow, key tools, and code structure before diving in.

Build docs developers (and LLMs) love