How to Use ftp-simple for SFTP in Visual Studio Code

To edit remote files over SFTP in VS Code, create an ftp-simple connection profile, then open a remote file or download a copy to edit. Start with autosave: false and manually upload one staging file so you can verify the destination. SFTP (SSH File Transfer Protocol) transfers files over SSH (Secure Shell).

Get connection details and install the extension

Get the authorized host, port, username, authentication method, and remote directory from your hosting provider or administrator. SFTP usually uses port 22, but use the port you were given. FTP and FTPS are separate protocols. Switching from SFTP to plain FTP can expose credentials and files in transit.

  1. In the Extensions view, search for humy2833.ftp-simple. Check that the publisher is humy2833 before installing.
  2. Open the Command Palette with F1, search for ftp-simple, and select ftp-simple : Config.

See the ftp-simple page in Visual Studio Marketplace for the extension and its commands.

Create an SFTP connection profile

Each object in the JSON array is a connection profile. This example uses password authentication on a staging server. Replace the example host, username, and directory with the details you were given, then save the configuration tab. The password is blank so the extension prompts when you connect.

[
  {
    "name": "Staging SFTP",
    "host": "sftp.example.com",
    "port": 22,
    "type": "sftp",
    "username": "staging-user",
    "password": "",
    "path": "/site-preview",
    "autosave": false,
    "confirm": true
  }
]
Setting What to enter or check
host / port Use the host and port from your administrator. Enter the host without sftp:// or a directory path.
type / path Choose sftp and set path to a starting directory visible to the account. The account’s / may be different from the server’s filesystem root.
autosave false disables upload-on-save for a file opened directly from the server. Manual uploads remain available.
confirm true prompts before overwriting an existing file in an ordinary manual upload. This example leaves out project mappings that can use fixed destinations or upload immediately.

For multiple profiles, separate the objects with commas and give each a distinct name. Enter real credentials only in the extension’s local configuration. Keep them out of your project repository, shared screens, and screenshots. For a key-only account, use the key method specified by your provider.

If the provider specifies explicit FTPS, create a separate profile with type: "ftp", secure: true, and the port supplied. When switching to another account or port on the same hostname, close the extension’s existing connections first so it opens a fresh session.

Open, edit, and upload one file

To inspect a file, choose ftp-simple : Open from the palette and select the connection and remote file. The editor opens a temporary copy. The following workflow keeps a separate local copy for editing and recovery.

  1. Open a local working folder in VS Code and run ftp-simple : Download. Download a staging file you are allowed to change, such as transfer-check.txt. Keep an untouched copy.
  2. Open the local working copy, change one line, and save it in the editor. Run ftp-simple : Save. Pick the connection and the original remote file, then check the complete path before confirming the overwrite.
  3. In the ftp-simple output channel, check for transfer errors. Run ftp-simple : Open again or download the file to another folder and make sure the server copy contains your change.

To undo the upload, upload the untouched copy to the same path and verify it again on the server. If other people edit the file, check for their changes before replacing it. The editor’s local Undo does not roll back an upload.

Open a directory or close the connection

To browse a directory in Explorer, run ftp-simple : Remote directory open to workspace and choose the profile and folder. The extension documents this as a beta feature. It uses a local working copy, so first try it on a small folder. Remote rename and delete commands are separate operations that change the server.

When you are finished, preserve any local changes you need, close the remote workspace, and run ftp-simple : Close all FTP connections.

If you also need a remote terminal, runtime, or debugger and the host allows an SSH shell, check the requirements in Microsoft’s VS Code Remote – SSH guide. An SFTP-only account is for file transfer.

Troubleshoot connection and upload failures

Open View → Output and select ftp-simple. Use the stage at which the operation failed to narrow down the cause.

  • Connection refused or timed out. Check the host, port, and any VPN or firewall requirements against the access details provided.
  • Authentication failed. Check the username and the configured password or key method. Resolve certificate or host verification errors with the administrator instead of disabling verification.
  • Listing works but upload fails. Check the target path, write permissions, and available storage. If you only saved the editor tab, check autosave and use the manual upload command.

For the connection fields and directory options, see the ftp-simple project documentation.