CommunityToolkit.Aspire.Hosting.Mosquitto 13.5.0

Prefix Reserved
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package CommunityToolkit.Aspire.Hosting.Mosquitto --version 13.5.0
                    
NuGet\Install-Package CommunityToolkit.Aspire.Hosting.Mosquitto -Version 13.5.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CommunityToolkit.Aspire.Hosting.Mosquitto" Version="13.5.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CommunityToolkit.Aspire.Hosting.Mosquitto" Version="13.5.0" />
                    
Directory.Packages.props
<PackageReference Include="CommunityToolkit.Aspire.Hosting.Mosquitto" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CommunityToolkit.Aspire.Hosting.Mosquitto --version 13.5.0
                    
#r "nuget: CommunityToolkit.Aspire.Hosting.Mosquitto, 13.5.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CommunityToolkit.Aspire.Hosting.Mosquitto@13.5.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CommunityToolkit.Aspire.Hosting.Mosquitto&version=13.5.0
                    
Install as a Cake Addin
#tool nuget:?package=CommunityToolkit.Aspire.Hosting.Mosquitto&version=13.5.0
                    
Install as a Cake Tool

CommunityToolkit.Aspire.Hosting.Mosquitto

Overview

This Aspire hosting integration runs Eclipse Mosquitto in a container. Mosquitto is an open source MQTT message broker, so the resource can be referenced by any MQTT client integration. The integration exposes the MQTT endpoint on port 1883 (target port tcp) and a protocol-level health check so the broker only reports healthy once it actually accepts MQTT connections.

Usage

Example 1: Add a Mosquitto broker

var builder = DistributedApplication.CreateBuilder(args);

var mqtt = builder.AddMosquitto("mqtt");

builder.AddProject<Projects.MyApp>("myapp")
       .WithReference(mqtt)
       .WaitFor(mqtt);

builder.Build().Run();

The connection string injected into the referencing resource is the broker address in the form mqtt://host:port.

Example 2: Pin the MQTT host port

var mqtt = builder.AddMosquitto("mqtt", port: 1883);

Example 3: Persist data with a volume or bind mount

var mqtt = builder.AddMosquitto("mqtt")
                  .WithDataVolume();

// or

var mqtt = builder.AddMosquitto("mqtt")
                  .WithDataBindMount("./mosquitto-data");

Example 4: Mount a custom configuration

By default the integration ships a mosquitto.conf that exposes the MQTT listener on all interfaces (listener 1883), allows anonymous connections, and persists state to /mosquitto/data. To customize the broker, override the configuration with your own mosquitto.conf at /mosquitto/config:

var mqtt = builder.AddMosquitto("mqtt")
                  .WithContainerFiles("/mosquitto/config",
                      [new ContainerFile { Name = "mosquitto.conf", Contents = "listener 1883" }]);

Endpoints

Name Description
tcp MQTT protocol endpoint (port 1883)

Upstream Image

This integration pins the eclipse-mosquitto image (from docker.io) to a specific version tag (2.0.22) rather than a floating tag. Mosquitto publishes immutable, fully-versioned tags; update the pinned tag to adopt newer releases.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
13.5.1-beta.748 45 9/7/2026
13.5.1-beta.744 44 9/7/2026
13.5.1-beta.743 55 9/7/2026
13.5.1-beta.736 51 9/1/2026
13.5.0 121 8/25/2026
13.5.0-beta.731 66 8/24/2026