Skip to main content

Installation

This guide will walk you through setting up your development environment for Dioxus, including installing Rust, the Dioxus CLI tool, and platform-specific dependencies.

Prerequisites

Before you begin, ensure you have:
  • A code editor (VS Code, RustRover, or your preferred editor)
  • Terminal/command line access
  • Internet connection for downloading dependencies
The minimum supported Rust version for Dioxus is 1.85.0. The installation steps below will install the latest stable version.

Step 1: Install Rust

Dioxus requires Rust to be installed on your system. If you don’t have Rust installed yet, follow these instructions:
Open your terminal and run:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Follow the on-screen instructions. When prompted, choose option 1 for the default installation.After installation completes, configure your current shell:
source $HOME/.cargo/env
Verify the installation:
rustc --version
cargo --version
cargo-binstall allows you to install pre-compiled binaries of Rust tools, making the installation much faster than building from source.
cargo install cargo-binstall
If you skip this step, you can still install the Dioxus CLI directly with cargo install dioxus-cli, but it will take longer to compile.

Step 3: Install Dioxus CLI

The Dioxus CLI (dx) is the command-line tool for creating, developing, and building Dioxus applications. It provides hot-reload, bundling, and deployment features.
cargo binstall dioxus-cli
Verify the installation:
dx --version
You should see output like:
dioxus-cli 0.7.0

Step 4: Platform-Specific Setup

Depending on which platforms you want to target, you may need additional dependencies.

Web Development

For web development, you need to add the WebAssembly target:
rustup target add wasm32-unknown-unknown
No additional tools are required for web development - the Dioxus CLI includes everything you need!

Desktop Development

Desktop apps use the system’s webview. Here’s what you need for each platform:
No additional dependencies required! macOS includes WebKit by default.
For building macOS app bundles (.app), the CLI uses built-in tools.

Mobile Development

Mobile development requires platform-specific SDKs and tools.
1

Install Android Studio

Download and install Android Studio which includes the Android SDK.
2

Install NDK

Open Android Studio → Tools → SDK Manager → SDK Tools tabCheck and install:
  • Android SDK Platform-Tools
  • Android NDK
3

Add Rust targets

rustup target add aarch64-linux-android
rustup target add armv7-linux-androideabi
rustup target add i686-linux-android
rustup target add x86_64-linux-android
4

Set environment variables

Add to your shell profile (~/.bashrc, ~/.zshrc, etc.):
export ANDROID_HOME=$HOME/Android/Sdk
export NDK_HOME=$ANDROID_HOME/ndk/<version>
Replace <version> with your installed NDK version.
While you can use any text editor with Dioxus, these extensions will improve your development experience:

VS Code

Install these extensions:
  1. rust-analyzer - Rust language support with autocomplete, diagnostics, and more
  2. Dioxus - Syntax highlighting and autocompletion for RSX
You can install them from the VS Code marketplace or via command line:
code --install-extension rust-lang.rust-analyzer
code --install-extension dioxuslabs.dioxus
The Dioxus extension provides RSX autocompletion, formatting, and component navigation!

RustRover / IntelliJ IDEA

  1. Install the Rust plugin from JetBrains Marketplace
  2. Install the Dioxus plugin for RSX support

Verification

Let’s verify your installation is complete by creating a test project:
1

Create a new project

dx new my-test-app
cd my-test-app
When prompted, select your preferred platform (web, desktop, or fullstack).
2

Run the development server

dx serve
This should compile your app and open it in your default browser (for web) or launch a window (for desktop).
3

Test hot-reload

Open src/main.rs in your editor and change some text in the rsx! macro. Save the file and watch your app update instantly!

Troubleshooting

Make sure ~/.cargo/bin is in your PATH:
echo $PATH
If it’s not there, add this to your shell profile:
export PATH="$HOME/.cargo/bin:$PATH"
Then restart your terminal or run source ~/.bashrc (or ~/.zshrc).
If you see errors about missing libraries, ensure you’ve installed all the development dependencies listed in the Desktop Development → Linux section above.Common missing packages:
  • pkg-config
  • libssl-dev or openssl-devel
  • webkit2gtk libraries
The first time you build a Dioxus app, Rust needs to compile all dependencies. This can take several minutes.Subsequent builds will be much faster thanks to incremental compilation and caching.To speed up compilation:
  • Use cargo-binstall for pre-compiled CLI tools
  • Consider using sccache for distributed compilation caching
  • Use mold or lld as a faster linker
If your desktop app doesn’t launch on Windows:
  1. Ensure Windows is up to date
  2. Download and install WebView2 Runtime manually
  3. Restart your application

Next Steps

Now that your environment is set up, you’re ready to build your first Dioxus app!

Quick Start Tutorial

Follow our step-by-step guide to build your first app

CLI Reference

Learn all the dx commands and options available

Keeping Up to Date

To update Dioxus CLI to the latest version:
cargo binstall dioxus-cli --force
To update Rust itself:
rustup update
Join the Dioxus Discord to stay informed about new releases and get help from the community!

Build docs developers (and LLMs) love