vs code extension · free
The server
inside the editor.
Remote SFTP/FTP brings remote servers inside Visual Studio Code: SFTP over SSH, FTP and FTPS, the folder tree in the sidebar, a terminal on the same connection as the files, search executed on the server. Passwords live in the system keychain, not in a file inside your project.
the remote tree in the sidebar, the file opened straight from the server, the shell on the same connection.
Why I wrote it
For years I've been moving files onto remote servers while developing, and for years it's been the same scene: you open the file with an FTP client, edit it in an editor that isn't the one you're using for the project, save, reload. Or you install one of the VS Code extensions that do the same thing, and discover that your production password ended up in clear text inside a JSON file in the project folder, one "git add ." away from the repository.
I wrote Remote SFTP/FTP to get that problem off my desk, and since it works, I'm giving it away for free.
The server becomes part of the editor
The idea is simple. You configure the connection once, SFTP over SSH or FTP and FTPS, and the remote folder tree appears in the sidebar. You click a file, it opens. You edit it, hit Save, and the file is written back to the server. There's no local copy that two days later you can't tell is newer or older than the remote one, and there's no sync job to launch and remember. A remote folder can even become the workspace root, and from there you work on it exactly like a project on your own disk.
Terminal, search, drag and drop
On SSH connections there's also the remote terminal, and here's a detail I care about: the shell opens on the same connection already used for the files. No second login, no second password. If you launch the command from a folder in the tree, the shell starts right there.
The feature I use most, though, is search. Looking for a string inside a project on a remote server is usually a chore: either you download everything, or you log in over SSH and make do with grep. Here you pick which folder to start from and what to look for, and if the SSH account has a shell the search runs directly on the server with grep and find. Only the list of results crosses the network, not the files. You click a result and the file opens at the right line. On FTP connections, where no shell exists, the extension scans the folders from the client: slower, but it works.
Below the connections tree there's also an outline of the open file: classes, functions and methods, one click to jump into them. It works on remote files whose language has no active language server too, thanks to a fallback textual scan.
Then there's the whole drag and drop side. Files and folders from your system file manager onto a remote folder to upload them, items inside the remote tree to move them on the server without the data travelling through your computer, and even between two different connections to copy from one server to another: in that case the data goes from one stream into the other without touching disk or memory, so a few-hundred-megabyte file is not a problem.
If you already use other tools
You don't have to reconfigure anything by hand: there's a command that reads connections from your ~/.ssh/config, from the projects' sftp.json files and from another widespread extension, shows you what it found and imports the ones you pick, merging duplicates. Passwords and passphrases it finds go into the keychain, not into the configuration.
Servers reachable only through a bastion are supported too, and if the connection drops the operation in flight is retried on its own: a save or a transfer survives a network blip with no error dialogs.
The three things I'm proudest of
You can't see them, and they're the reason I wrote it.
In the keychain, not in the project
Passwords live in the system keychain, through VS Code's secret storage. Not in a file inside the project folder, so not in a commit by accident.
The server key gets verified
Just like ssh does: if the host is new it shows you the fingerprint and asks; if the key changed it warns you explicitly, because that can be a legitimate rotation or someone in the middle.
No silent overwrites
If a colleague touched that file after you opened it, the save stops before writing: you can compare the two versions and decide for yourself.
Limits
- It's tested on macOS and Linux; not on Windows.
- Files over 16 megabytes don't open in the editor: that's a VS Code constraint, it receives remote files as a single block. For those, use the download instead.
- An open SSH terminal does not survive a dropped connection and has to be reopened.
- Content search over FTP, as I said, is slower.
How to install
Install from VSIX
Extensions (Cmd/Ctrl+Shift+X) › ··· menu › Install from VSIX... › pick the file.
Or from the terminal:
On macOS enable code once: Cmd+Shift+P › "Shell Command: Install 'code' command in PATH".
Reload the window and connect
Cmd/Ctrl+Shift+P › "Reload Window". Then the SFTP / FTP icon in the sidebar.
Needs VS Code 1.85+. To update, same steps with the new file: your connections stay.
Licence
Free, any use, commercial included. Not open source: don't redistribute the file, link this page.