Documentation Index
Fetch the complete documentation index at: https://mintlify.com/DioxusLabs/dioxus/llms.txt
Use this file to discover all available pages before exploring further.
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:- macOS / Linux
- Windows
Open your terminal and run:Follow the on-screen instructions. When prompted, choose option 1 for the default installation.After installation completes, configure your current shell:Verify the installation:
Step 2: Install cargo-binstall (Recommended)
cargo-binstall allows you to install pre-compiled binaries of Rust tools, making the installation much faster than building from source.
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.
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: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:- macOS
- Linux
- Windows
No additional dependencies required! macOS includes WebKit by default.
Mobile Development
Mobile development requires platform-specific SDKs and tools.- Android
- iOS
Install Android Studio
Download and install Android Studio which includes the Android SDK.
Install NDK
Open Android Studio → Tools → SDK Manager → SDK Tools tabCheck and install:
- Android SDK Platform-Tools
- Android NDK
Step 5: Editor Setup (Optional but Recommended)
While you can use any text editor with Dioxus, these extensions will improve your development experience:VS Code
Install these extensions:- rust-analyzer - Rust language support with autocomplete, diagnostics, and more
- Dioxus - Syntax highlighting and autocompletion for RSX
RustRover / IntelliJ IDEA
- Install the Rust plugin from JetBrains Marketplace
- Install the Dioxus plugin for RSX support
Verification
Let’s verify your installation is complete by creating a test project:Run the development server
Troubleshooting
'dx' command not found
'dx' command not found
Make sure If it’s not there, add this to your shell profile:Then restart your terminal or run
~/.cargo/bin is in your PATH:source ~/.bashrc (or ~/.zshrc).Compilation errors on Linux
Compilation errors on Linux
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-configlibssl-devoropenssl-develwebkit2gtklibraries
Slow initial compilation
Slow initial compilation
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-binstallfor pre-compiled CLI tools - Consider using
sccachefor distributed compilation caching - Use
moldorlldas a faster linker
WebView2 issues on Windows
WebView2 issues on Windows
If your desktop app doesn’t launch on Windows:
- Ensure Windows is up to date
- Download and install WebView2 Runtime manually
- 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