dotnet-nuget-push(1)

πŸ“¦
version 11.0.0~rc3 Β· 6 versions
, in alpine 3.24, centos-stream 10, centos-stream 9, fedora 43, fedora 44, nixpkgs unstable, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– dotnet-nuget-push πŸ’–

okay bestie, welcome to the dotnet-nuget-push(1) page from the .NET Documentation set ✨

This article applies to: βœ”οΈ .NET 6 SDK and later versions β€” so if you're on something older, this is not your era, sorry babe πŸ’…

NAME

dotnet-nuget-push β€” Pushes a package to the server and publishes it. fr fr that's the whole job. πŸ“¦βœ¨


SYNOPSIS

dotnet nuget push [<ROOT>] [--allow-insecure-connections] [-d|--disable-buffering] [--force-english-output]
    [--interactive] [-k|--api-key <API_KEY>] [-n|--no-symbols]
    [--no-service-endpoint] [-s|--source <SOURCE>] [--skip-duplicate]
    [-sk|--symbol-api-key <API_KEY>] [-ss|--symbol-source <SOURCE>]
    [-t|--timeout <TIMEOUT>]
    [--configfile <FILE>]

dotnet nuget push -h|--help

DESCRIPTION

So the dotnet nuget push command pushes a package to the server and publishes it. That's it. That's the vibe. πŸš€

It grabs all the server + credential deets from the system's NuGet config file, or from a whole chain of config files. Wanna know more about config files? Go read Configuring NuGet Behavior πŸ‘‘

NuGet's default configuration? It gets loaded like this, bestie:

  • first it loads %AppData%.config on Windows, or $HOME/.nuget/NuGet/NuGet.Config on Linux/macOS
  • then it loads any nuget.config or .nuget.config, starting from the root of the drive and ending in the current directory πŸ“‚
⚠️ Important moment: this command pushes an existing package. It does not create a package. If you need to make one, that's dotnet pack's whole job, not this one's. πŸŽ€

Hierarchical folder structure

okay so this command can store packages in a hierarchical folder structure, and that's genuinely recommended because it optimizes performance ✨

Here's the tea: it stores packages in a hierarchical folder structure when you're publishing to a local folder (a feed), just like nuget add does β€” but only if there's already at least one package in the feed that's in a hierarchical folder structure. If the feed already has a hierarchical-folder-structured package in it, dotnet nuget push respects that structure. 🫢

So, if you wanna publish to a local feed using the .NET CLI instead of the NuGet CLI:

  • Before you publish the very first package, go to your global packages folder, at *%userprofile%.nuget, and select the root folder of a package id. It can be any package that is not part of a framework, like .NET standard or ASP.NET. πŸ‘€
  • Copy the selected package folder into the root folder of the local feed. πŸ“
  • Use dotnet nuget push to publish your package to the local feed. πŸš€
  • You can now delete the folder you previously copied in, and you can freely use dotnet nuget push to publish to your local feed. periodt πŸ’…

Alternatively (no stress, there's another way), use the NuGet CLI for the first package, then you can use dotnet nuget push for the rest. For more information, see Local feeds. 🌸


ARGUMENTS

  • ROOT β€” Specifies the file path to the package to be pushed. Like, where's the package at, bestie? Tell the command. πŸ“

OPTIONS

  • --allow-insecure-connections β€” Allows pushing to HTTP sources (insecure). 😬 it's giving "risky behavior" but ok, you do you.
  • -d, --disable-buffering β€” Disables buffering when pushing to an HTTP(S) server, which reduces memory usage. 🧠✨
  • --force-english-output β€” Forces the application to run using an invariant, English-based culture. πŸ‡¬πŸ‡§
  • -?, -h, --help β€” Prints out a description of how to use the command. classic. πŸ™ˆ
  • --interactive β€” Allows the command to stop and wait for user input or action. For example, to complete authentication. Available since .NET Core 3.0 SDK. βΈοΈπŸ”
  • -k, --api-key <API_KEY> β€” The API key for the server. πŸ”‘
  • -n, --no-symbols β€” Doesn't push symbols (even if present). nope, not today. πŸ™…
  • --no-service-endpoint β€” Doesn't append "api/v2/package" to the source URL. πŸ”—
  • -s, --source <SOURCE> β€” Specifies the server URL. NuGet identifies a UNC or local folder source and simply copies the file there instead of pushing it using HTTP. πŸ“¦
Starting with NuGet 3.4.2, this is a mandatory parameter unless the NuGet config file specifies a DefaultPushSource value. For more information, see Configuring NuGet behavior. ⚠️ mandatory!! no cap.
  • --skip-duplicate β€” When pushing multiple packages to an HTTP(S) server, treats any 409 Conflict response as a warning so that other pushes can continue. πŸ›Ÿ
  • -sk, --symbol-api-key <API_KEY> β€” The API key for the symbol server. πŸ”‘
  • -ss, --symbol-source <SOURCE> β€” Specifies the symbol server URL. πŸ”—
  • -t, --timeout <TIMEOUT> β€” Specifies the timeout for pushing to a server in seconds. Defaults to 300 seconds (5 minutes). Specifying 0 applies the default value. ⏰
  • --configfile β€” The NuGet configuration file (nuget.config) to use. If specified, only the settings from this file will be used. If not specified, the hierarchy of configuration files from the current directory will be used. For more information, see Common NuGet Configurations. πŸ“„

EXAMPLES

okay now the fun part, let's see it in action 🎬

  • Push foo.nupkg to the default push source specified in the NuGet config file, using an API key:
dotnet nuget push foo.nupkg -k 4003d786-cc37-4004-bfdf-c4f3e8ef9b3a
  • Push foo.nupkg to the official NuGet server, specifying an API key:
dotnet nuget push foo.nupkg -k 4003d786-cc37-4004-bfdf-c4f3e8ef9b3a -s https://api.nuget.org/v3/index.json
dotnet nuget push foo.nupkg -k 4003d786-cc37-4004-bfdf-c4f3e8ef9b3a -s https://customsource/
  • Push foo.nupkg to the default push source specified in the NuGet config file:
dotnet nuget push foo.nupkg
  • Push foo.symbols.nupkg to the default symbols source:
dotnet nuget push foo.symbols.nupkg
  • Push foo.nupkg to the default push source specified in the NuGet config file, with a 360-second timeout:
dotnet nuget push foo.nupkg --timeout 360
  • Push all .nupkg files in the current directory to the default push source specified in the NuGet config file:
dotnet nuget push "*.nupkg"
  • Push all .nupkg files to the default push source specified in the NuGet config file, even if a 409 Conflict response is returned by an HTTP(S) server:
dotnet nuget push "*.nupkg" --skip-duplicate
  • Push all .nupkg files in the current directory to a local feed directory:
dotnet nuget push "*.nupkg" -s c:\mydir
  • For pushing to Azure Artifacts, see Azure Artifacts' push documentation. ☁️✨

πŸ’œ and that's the whole page bestie, you ate that. go push some packages, you're the main character now πŸ‘‘

with love, from the dotnet-nuget-push(1) girlies β€” dated 2025-10-30, and this page comes straight from the .NET Documentation set πŸŽ€πŸ’–

πŸ“¦ where this page comes from