Next-generation BMC webserver for OpenBMC, written in Rust
bmcweb-ng is a modern rewrite of bmcweb, the embedded webserver for OpenBMC. Built from the ground up in Rust, it provides a high-performance, memory-safe implementation of the Redfish API and other BMC management interfaces.
The original bmcweb is a mature, production-ready C++ application. This rewrite aims to:
- Improve Maintainability - Simpler architecture, less template metaprogramming
- Enhance Safety - Memory safety guarantees from Rust
- Better Testing - Mockable interfaces, comprehensive test coverage
- Developer Experience - Faster compile times, better tooling, clearer error messages
- Modern Async - Clean async/await syntax instead of callback chains
- β Redfish API - Broad Redfish coverage from ServiceRoot through TelemetryService, plus OData, Fabrics, and Virtual Media routes
- β Multiple Protocols - HTTP/1.1, HTTP/2, HTTPS with TLS 1.3
- β Authentication - Basic auth with PAM, Session management, Token-based auth
- β Event Service - Event subscriptions, async notifications, SSE endpoint, and PATCH-configurable retry settings
- β Task Service - Long-running operation tracking and management
- β Update Service - Firmware update management and live DBus inventory
- β DBus Integration - Comprehensive async DBus wiring to OpenBMC services
- β WebSocket Support - Serial console, KVM proxy, and Virtual Media/NBD UNIX-socket proxies
- β Performance - ~5MB binary, <10MB memory (idle), fast request latency on QEMU and real hardware
- β Observability - Structured logging, Prometheus metrics support
βββββββββββββββββββββββββββββββββββββββ
β API Layer (Redfish/REST/WS) β β HTTP handlers, routing
βββββββββββββββββββββββββββββββββββββββ€
β Business Logic (Resources) β β Redfish resource handlers
βββββββββββββββββββββββββββββββββββββββ€
β Service Layer (DBus) β β DBus abstraction, caching
βββββββββββββββββββββββββββββββββββββββ€
β Protocol Layer (HTTP/WS/TLS) β β axum, hyper, tokio-tungstenite
βββββββββββββββββββββββββββββββββββββββ€
β Runtime (Async I/O) β β tokio runtime
βββββββββββββββββββββββββββββββββββββββ
- Layered Architecture - Clear separation of concerns
- Dependency Injection - Testable components via traits
- Schema-Driven - Generate types from Redfish schemas
- Configuration as Code - Runtime TOML configuration
- Fail Fast - Validate at startup, not at runtime
- Observability First - Logging, metrics, and tracing built-in
- Rust 1.96.1 or later
- OpenBMC development environment (for DBus integration)
- OpenSSL 3.0+ (for TLS support)
# Clone the repository
git clone https://github.com/gtmills/bmcweb-ng.git
cd bmcweb-ng
# Build in debug mode
cargo build
# Build optimized release
cargo build --release
# Run tests
cargo test
# Run with logging
RUST_LOG=info cargo runCreate a config.toml file:
[server]
bind_address = "0.0.0.0"
port = 443
tls_cert = "/etc/bmcweb/cert.pem"
tls_key = "/etc/bmcweb/key.pem"
max_connections = 100
[auth]
session_timeout_seconds = 3600
max_sessions = 64
[logging]
level = "info"
[metrics]
enabled = true
port = 9090# Run with default config
cargo run --release
# Run with custom config
cargo run --release -- --config /path/to/config.toml
# Run in development mode with hot reload
cargo watch -x runbmcweb-ng/
βββ src/
β βββ main.rs # Application entry point
β βββ lib.rs # Core library with AppState
β βββ persistent_data.rs # UUID and session persistence
β βββ config/
β β βββ mod.rs # Configuration management (TOML)
β βββ api/
β β βββ mod.rs # API layer
β β βββ redfish/ # Redfish endpoints
β β βββ mod.rs # Router + route table
β β βββ service_root.rs # ServiceRoot
β β βββ systems.rs # Systems + sub-resources
β β βββ chassis.rs # Chassis + sub-resources
β β βββ managers.rs # Managers + sub-resources
β β βββ sessions.rs # SessionService + Sessions
β β βββ accounts.rs # AccountService + Accounts + Roles
β β βββ event_service.rs # EventService + Subscriptions
β β βββ task_service.rs # TaskService + Tasks
β β βββ update_service.rs # UpdateService + FirmwareInventory
β β βββ certificate_service.rs # CertificateService
β β βββ telemetry_service.rs # TelemetryService
β βββ auth/ # Authentication & authorization
β β βββ mod.rs # Auth exports
β β βββ basic.rs # Basic auth with PAM
β β βββ session.rs # Session management
β β βββ middleware.rs # Auth middleware
β β βββ privilege.rs # RBAC privilege checking
β βββ dbus/
β β βββ mod.rs # DbusClient trait + ZBusClient + MockDbusClient
β βββ services/ # Business logic services
β β βββ mod.rs
β β βββ event.rs # Event Service
β β βββ task.rs # Task Service
β β βββ update.rs # Update Service
β βββ protocol/ # Protocol layer
β β βββ mod.rs
β β βββ http.rs # HTTP/HTTPS server (axum + rustls)
β βββ observability/ # Prometheus metrics
β βββ mod.rs
β βββ metrics.rs
βββ Cargo.toml # Rust dependencies
βββ config.toml # Default configuration
βββ bmcweb-ng.service # Systemd service file
βββ bmcweb-ng.socket # Systemd socket activation
βββ README.md # This file
We follow the Rust standard style guide. Format your code before committing:
cargo fmtRun clippy to catch common mistakes:
cargo clippy -- -D warnings# Run all tests
cargo test
# Run specific test
cargo test test_name
# Run with output
cargo test -- --nocapture
# Run integration tests only
cargo test --test '*'
# Run benchmarks
cargo benchGenerate and view documentation:
cargo doc --openMeasured on OpenBMC qemuarm (Cortex-A15, 256 MB RAM, 4 cores) β July 2026.
| Metric | Target | Current | Notes |
|---|---|---|---|
| Binary Size | <1MB | 4.75 MB | ARM dynamically-linked release build; musl static target would be smaller β see note below |
| Memory RSS (idle) | <10MB | 5.7 MB | Measured via /proc/<pid>/status after cold start, no active requests |
| Startup Time | <1s | ~1.6s | Cold start on emulated ARM; <200ms expected on real hardware |
| Request Latency (p99) | <100ms | <10ms | p50=4ms p95=5ms p99=7ms β 30 sequential GETs to /redfish/v1 on QEMU |
| Concurrent Connections | 100+ | 20/20 β | 20 simultaneous GETs all succeeded; full 100+ load test pending on real hardware |
| Unit tests (v0.5.0) | β | 239 | 0 failures; covers all major handlers across systems/chassis/managers/accounts |
Binary size note: The
<1MBtarget assumed a musl static build. The current dynamically-linked ARM EABI release build is 4.75 MB stripped. This is because Tokio, hyper, rustls, zbus, and serde_json together contribute significant code. Switching toaarch64-unknown-linux-muslwith LTO andopt-level = "z"(already set) typically yields 3β5 MB β still larger than the original target which was aspirational. The<10MBmemory target is met at 5.7 MB RSS.
Startup time note: 1.6s is measured on QEMU's emulated Cortex-A15. On a real BMC SoC (e.g. AST2600 at 800 MHz) startup is expected to be under 500ms. The
<1starget is realistic for production hardware.
- Redfish API: High parity with upstream bmcweb for the currently implemented route set
- DBus Interface: Same DBus calls and object model intent as bmcweb for implemented resources
- Configuration: New TOML format defined in
config.toml
No standalone migration guide is checked into this repository yet. Use BUILDING.md, ARCHITECTURE.md, and DEVELOPMENT_STATUS.md for current setup and parity details.
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests (
cargo test) - Format code (
cargo fmt) - Run linter (
cargo clippy) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- Original bmcweb project and contributors
- OpenBMC community
- DMTF for the Redfish specification
- Rust community for excellent async ecosystem
- Project Lead: Gunnar Mills
- Repository: https://github.com/gtmills/bmcweb-ng
- Issues: https://github.com/gtmills/bmcweb-ng/issues
- IBM fork of upstream: https://github.com/ibm-openbmc/bmcweb