| title | dotnet nuget push command |
|---|---|
| description | The dotnet nuget push command pushes a package to the server and publishes it. |
| author | karann-msft |
| ms.date | 10/28/2025 |
This article applies to: ✔️ .NET 6 SDK and later versions
dotnet nuget push - Pushes a package to the server and publishes it.
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
The dotnet nuget push command pushes a package to the server and publishes it. The push command uses server and credential details found in the system's NuGet config file or chain of config files. For more information on config files, see Configuring NuGet Behavior. NuGet's default configuration is obtained by loading %AppData%\NuGet\NuGet.config (Windows) or $HOME/.nuget/NuGet/NuGet.Config (Linux/macOS), then loading any nuget.config or .nuget\nuget.config starting from the root of drive and ending in the current directory.
The command pushes an existing package. It doesn't create a package. To create a package, use dotnet pack.
This command can store packages in a hierarchical folder structure, which is recommended to optimize performance. It stores packages in a hierarchical folder structure when publishing to a local folder (feed), like nuget add does, if there already is at least one package in the feed that is in a hierarchical folder structure. If the feed has a hierarchical folder structured package already in it, dotnet nuget push respects that structure. So, if you want to publish to a local feed using the .NET CLI instead of the NuGet CLI:
- Before you publish the first package, go to your global packages folder, at %userprofile%.nuget\packages, 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 pushto publish your package to the local feed. - You can now delete the folder you previously copied in, and you can freely use
dotnet nuget pushto publish to your local feed.
Alternatively, use the NuGet CLI for the first package, then you can use dotnet nuget push for the rest. For more information, see Local feeds.
-
ROOTSpecifies the file path to the package to be pushed.
-
--allow-insecure-connectionsAllows pushing to HTTP sources (insecure). Available since .NET 10 SDK.
-
-d|--disable-bufferingDisables buffering when pushing to an HTTP(S) server to reduce memory usage.
-
--force-english-outputForces the application to run using an invariant, English-based culture.
-
[!INCLUDE help]
-
[!INCLUDE interactive]
-
-k|--api-key <API_KEY>The API key for the server.
-
-n|--no-symbolsDoesn't push symbols (even if present).
-
--no-service-endpointDoesn'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.
[!IMPORTANT] Starting with NuGet 3.4.2, this is a mandatory parameter unless the NuGet config file specifies a
DefaultPushSourcevalue. For more information, see Configuring NuGet behavior. -
--skip-duplicateWhen 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.
-
--configfileThe 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. Available since .NET 9 SDK.
-
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 -
Push foo.nupkg to the custom push source
https://customsource, specifying an API key: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.