AMWD.FtpDeploy6 0.1.0
dotnet-ftp-deploy
Deploys applications to remote hosts using FTP through the .NET CLI.
Inspired by DotnetSshDeploy created by Yves Goergen on Github!
Installation
dotnet local tool
Install the NuGet package AMWD.SshDeploy6 to your project directory. Then you can run it from the project directory to deploy your application.
Installation:
dotnet new tool-manifest
dotnet tool install AMWD.SshDeploy6
Command invocation:
dotnet publish -c Release
dotnet ssh-deploy staging
dotnet global tool
Install the NuGet package AMWD.SshDeploy6 as a global tool. Then you can run it from all directories to publish your project. This requires the .NET 6.0 runtime to be installed.
Installation:
dotnet tool install -g AMWD.SshDeploy6
Command invocation:
ssh-deploy staging
Learn more about managing .NET tools.
Configuration
ftpDeploy.json
The deployment is configured through a single file that should be placed somewhere in your project directory. This file contains all deployment profiles.
Security notice:
You don't want hackers to deploy anything to your site, do you? Because the config file contains access credentials or at least personal data, it should never be added to version control. Add it to your .gitignore file. It should also never land on your web server (it has no use there anyway). Keep this file local and give it to everybody who needs to deploy the project to your server. You might check in a template of this file that contains all public data and has placeholders for confidential data, if you like.
The file ftpDeploy.json is automatically discovered in the current working directory and in its subdirectory "Properties" which is common for .NET/Visual Studio projects. If it's located somewhere else, specify its path with the -c command line option.
The JSON structure looks like this:
{
"profiles": {
"profilename": {
"isDefault": true,
"hostName": "example.com",
"userName": "appuser",
"insecure": false,
"ignoreCertificateErrors": false,
"localPath": "../bin/Release/net10.0/publish",
"remotePath": "app",
"ignoredLocalFiles": [
"appsettings.Development.json"
],
"ignoredRemoteFiles": [
"cgi-bin/**"
]
}
}
}
profiles
The profiles property contains a map of all profile names with their data.
In this example, the profile name is "profilename".
Call it "production", "staging" or whatever you want.
You can add multiple of these profiles. One of them can be the default profile.
isDefault (optional)
Declares the default profile that is used when none is specified on the command line. If this option is not specified and there is no default profile, the first profile is used if there is only one.
hostName, port (optional, not shown), userName
FTP connection and login data. The port defaults to 21.
password
The plain password for FTP login.
insecure (optional)
If set to true, the FTP connection is not encrypted. This is not recommended for production servers.
ignoreCertificateErrors (optional)
If set to true, SSL/TLS certificate errors are ignored. This is not recommended for production servers.
localPath
The path to the local files to be deployed.
This is usually the output directory of dotnet publish or just your project directory for other web project types.
It can contain environment variables in Windows syntax like %myprojects%/projectname.
Non-rooted paths are evaluated relative to the config file directory.
Directory separators can be backslash (\) or forward slash (/), but the forward slash is more convenient in JSON files.
remotePath
The path on the remote server to deploy the files into. This path is relative to the home directory that you are in after SSH login.
ignoredLocalFiles (optional)
A list of names or glob patterns of local files that are not deployed.
ignoredRemoteFiles (optional)
A list of names or glob patterns of remote files that are not deleted. If ftp-deploy finds a remote file that doesn't exist locally and is not matched by this list, it asks you what to do with it. If you choose to always keep it, it is added to this list.
Command Line Arguments
ftp-deploy [-c configfile] [-np] [-q] [-v] [-P <n>] [-K/-D] [profilename]
-c, --config
Specifies the configuration file to use. See above for default locations if unspecified.
-np, --no-progress
Hide upload progress. Prints normal messages but no upload progress information. Quiet mode includes this.
-q, --quiet
Quiet mode. Does not print anything except error messages and questions about what to do with remote-only files.
-v, --verbose
Verbose mode. Prints more details about what is going on. Useful for troubleshooting. This overrides quiet mode.
-P, --parallel
Set the number of parallel actions on file transfers. This can speed up the deployment process by performing multiple file operations simultaneously. The default value is 1, which means single-threaded mode.
-K, --keep
Keeps all remote files that are not present locally. No questions are asked, and no remote files are deleted.
This is not compatible with -D.
-D, --delete
Deletes all remote files that are not present locally. No questions are asked, and no remote files are kept.
This is not compatible with -K.
If no profile name is specified, the default or single profile is used. See the isDefault property above.
License
MIT License (see choose a license)
| Version | Downloads | Last updated |
|---|---|---|
| 0.1.0 | 0 | 23.07.2026 |