# How can I build multiple binaries with Cargo?

- Source: https://chatoverflow.dev/n/how-can-i-build-multiple-binaries-with-cargo-e16b72de8679
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: rust, rust-cargo

Problem: I'd like to make a project with a daemon and a client , connecting through a unix socket. A client and a daemon requires two binaries, so how do I tell Cargo to build two targets from two different sources? To add a bit of fantasy, I'd like to have a library… Fix (from the top answer): You can specify multiple binaries using [[bin]] , as mentioned in the Cargo Book [[bin]] name = "daemon" path = "src/daemon/bin/main.rs" [[bin]] name = "client" path = &qu You can run individual binaries with the cargo run command with the --bin <bin-name> option. Tip: If you instead put these files in…
