Quick SFTP
SFTP/FTP sync for VS Code: edit files locally and keep them in sync with a remote server over SFTP, FTP or FTPS.
Forked from Natizyskunk's SFTP extension, which was itself forked from liximomo's SFTP extension.
Why this fork
Quick SFTP is a drop-in replacement: it reads the same .vscode/sftp.json and has the same commands and settings, so existing configurations keep working. Compared with the extension it was forked from:
- Many bug fixes, including sync deleting files it shouldn't, operations hanging after a lost connection, and broken uploads of changed files. See the CHANGELOG.
- Faster startup. Less code is loaded when VS Code starts, and the SSH and FTP libraries are loaded only when they are needed.
- Faster SFTP transfers of many small files.
- A new FTP library (basic-ftp) replacing the unmaintained
ftp package.
- A status bar menu: hover the SFTP item in the status bar for common actions and to switch profile.
- Up-to-date dependencies and an automated test suite, including tests against real FTP and SFTP servers.
Note: because the commands are the same, Quick SFTP can't be installed alongside another SFTP extension (liximomo's or Natizyskunk's). Uninstall or disable the other one first.
Features
Installation
- Open Extensions (Ctrl+Shift+X).
- Uninstall or disable any other SFTP extension (see the note above).
- Search for Quick SFTP and install it.
To install a .vsix file instead, open the "..." menu at the top of the Extensions view and choose "Install from VSIX…".
Documentation
Usage
If the latest files are already on a remote server, you can start with an empty local folder,
then download your project, and from that point sync.
- In
VS Code, open a local directory you wish to sync to the remote server (or create an empty directory
that you wish to first download the contents of a remote server folder in order to edit locally).
Ctrl+Shift+P on Windows/Linux or Cmd+Shift+P on Mac open command palette, run SFTP: config command.
- A basic configuration file will appear named
sftp.json under the .vscode directory, open and edit the configuration parameters with your remote server information. Once you have a setup you like, run SFTP: Save Config as Template to start from it in your next project.
For instance:
{
"name": "Profile Name",
"host": "name_of_remote_host",
"protocol": "ftp",
"port": 21,
"secure": true,
"username": "username",
"remotePath": "/public_html/project", // <--- This is the path which will be downloaded if you "Download Project"
"password": "password",
"uploadOnSave": false
}
The password parameter in sftp.json is optional, if left out you will be prompted for a password on sync.
Note: backslashes and other special characters must be escaped with a backslash.
- Save and close the
sftp.json file.
Ctrl+Shift+P on Windows/Linux or Cmd+Shift+P on Mac open command palette.
- Type
sftp and you'll now see a number of other commands. You can also access many of the commands from the project's file explorer context menus.
- A good one to start with if you want to sync with a remote folder is
SFTP: Download Project. This will download the directory shown in the remotePath setting in sftp.json to your local open directory.
- Done - you can now edit locally and after each save it will upload to sync your remote file with the local copy.
- Enjoy!
For all options, see the configuration reference.
Example configurations
You can see the full list of configuration options here.
Simple
{
"host": "host",
"username": "username",
"remotePath": "/remote/workspace"
}
Profiles
{
"username": "username",
"password": "password",
"remotePath": "/remote/workspace/a",
"watcher": {
"files": "dist/*.{js,css}",
"autoUpload": false,
"autoDelete": false
},
"profiles": {
"dev": {
"host": "dev-host",
"remotePath": "/dev",
"uploadOnSave": true
},
"prod": {
"host": "prod-host",
"remotePath": "/prod"
}
},
"defaultProfile": "dev"
}
Note: context and watcher are only available at root level.
Use SFTP: Set Profile to switch profile.
Multiple Context
The context must not be same.
[
{
"name": "server1",
"context": "project/build",
"host": "host",
"username": "username",
"password": "password",
"remotePath": "/remote/project/build"
},
{
"name": "server2",
"context": "project/src",
"host": "host",
"username": "username",
"password": "password",
"remotePath": "/remote/project/src"
}
]
Note: name is required in this mode.
Connection Hopping
You can connect to a target server through a proxy with ssh protocol.
Note: Variable substitution is not working in a hop configuration.
Single Hop
local -> hop -> target
{
"name": "target",
"remotePath": "/path/in/target",
// hop
"host": "hopHost",
"username": "hopUsername",
"privateKeyPath": "/Users/localUser/.ssh/id_rsa", // <-- The key file is assumed on the local.
"hop": {
// target
"host": "targetHost",
"username": "targetUsername",
"privateKeyPath": "/Users/hopUser/.ssh/id_rsa", // <-- The key file is assumed on the hop.
}
}
Multiple Hop
local -> hopa -> hopb -> target
{
"name": "target",
"remotePath": "/path/in/target",
// hopa
"host": "hopAHost",
"username": "hopAUsername",
"privateKeyPath": "/Users/hopAUsername/.ssh/id_rsa" // <-- The key file is assumed on the local.
"hop": [
// hopb
{
"host": "hopBHost",
"username": "hopBUsername",
"privateKeyPath": "/Users/hopaUser/.ssh/id_rsa" // <-- The key file is assumed on the hopa.
},
// target
{
"host": "targetHost",
"username": "targetUsername",
"privateKeyPath": "/Users/hopbUser/.ssh/id_rsa", // <-- The key file is assumed on the hopb.
}
]
}
Configuration in User Setting
You can use remote to tell sftp to get the configuration from remote-fs.
In User Setting:
"remotefs.remote": {
"dev": {
"scheme": "sftp",
"host": "host",
"username": "username",
"rootPath": "/path/to/somewhere"
},
"projectX": {
"scheme": "sftp",
"host": "host",
"username": "username",
"privateKeyPath": "/Users/xx/.ssh/id_rsa",
"rootPath": "/home/foo/some/projectx"
}
}
In sftp.json:
{
"remote": "dev",
"remotePath": "/home/xx/",
"uploadOnSave": false,
"ignore": [".vscode", ".git", ".DS_Store"]
}
Remote Explorer

Remote Explorer lets you explore files in remote. You can open Remote Explorer by:
- Run Command
View: Show SFTP.
- Click SFTP view in Activity Bar.
You can only view a files content with Remote Explorer. Run command SFTP: Edit in Local to edit it in local.
Multiple Select
You are able to select multiple files/folders at once on the remote server to download and upload. You can do it simply by holding down Ctrl or Shift while selecting all desired files, just like on the regular explorer view.
Note: You need to manually refresh the parent folder after you delete a file if the explorer isn't correctly updated.
Files and folders in the Remote Explorer have an inline download button, shown when hovering an item, to quickly run Download File or Download Folder.
Refresh Active Remote File
When a remote file is open in the editor, click the refresh button in the editor title bar (or run SFTP: Refresh Active Remote File) to reload its content from the server.
Order
You can order the remote Explorer by adding the remoteExplorer.order parameter inside your sftp.json config file.
In sftp.json:
{
"remoteExplorer": {
"order": 1 // <-- Default value is 0.
}
}
While a workspace has an sftp.json, the status bar shows the active profile (SFTP: dev), or the current transfer.
- Hover it for a menu with Config, View log, Upload Changed Files and Cancel All Transfers, and a list of profiles (the active one is checked). Click a profile to switch to it.
- Click it to pick a profile from a list, and to clear a warning or error icon.
Debug
- Open User Settings.
- On Windows/Linux -
File > Preferences > Settings
- On macOS -
Code > Preferences > Settings
- Set
sftp.debug to true and reload vscode.
- View the logs in
View > Output > sftp.
FAQ
You can see all the Frequently Asked Questions here.
License
MIT. See LICENSE.