Basic installation
Add Tokio to yourCargo.toml dependencies:
Cargo.toml
full feature flag enables all of Tokio’s public APIs, which is the recommended starting point for applications.
The latest stable version of Tokio is 1.50.0. Check crates.io for the most recent version.
Feature flags
Tokio uses feature flags to reduce compiled code size. You can enable only the features your application needs.Common feature combinations
Available features
Here are the main feature flags available in Tokio:Runtime features
Runtime features
rt: Enablestokio::spawnand the current-thread schedulerrt-multi-thread: Enables the multi-threaded, work-stealing schedulermacros: Enables#[tokio::main]and#[tokio::test]macros
I/O features
I/O features
io-util: Enables IO-based extension traitsio-std: EnablesStdout,Stdin, andStderrtypesnet: Enablestokio::nettypes likeTcpStreamandUdpSocketfs: Enablestokio::fsfor asynchronous filesystem operations
Task features
Task features
sync: Enables alltokio::synctypes (channels, mutexes, etc.)time: Enablestokio::timetypes for timeouts and intervalsprocess: Enablestokio::processfor spawning child processessignal: Enablestokio::signalfor OS signal handling
Other features
Other features
full: Enables all stable features (recommended for applications)test-util: Enables testing utilities for the Tokio runtimeparking_lot: Uses theparking_lotcrate’s synchronization primitives internally
Minimum supported Rust version
Tokio requires Rust 1.71 or later. The library follows a rolling MSRV policy where the minimum supported Rust version must have been released at least 6 months ago.Cargo.toml
LTS releases
Tokio offers LTS (long term support) releases that receive backported bugfixes for at least one year:- 1.43.x - LTS until March 2026 (MSRV 1.70)
- 1.47.x - LTS until September 2026 (MSRV 1.70)
Cargo.toml
Unstable features
Some features require thetokio_unstable configuration flag. These features may break in 1.x releases.
To enable unstable features, add this to .cargo/config.toml:
.cargo/config.toml
tracing: Enables tracing eventsio-uring: Enables io-uring support (Linux only)taskdump: Enables taskdump functionality (Linux only)
Verification
Verify your installation by creating a simple hello world program:Next steps
Quickstart
Build your first async application with Tokio
API documentation
Explore the complete API reference