Skip to main content
How to manage server files with VS Code via SFTP?

How to manage server files with VS Code via SFTP?

·431 words·3 mins

This tutorial will provide you with information on how to set up your installation of VS Code to manage files of your servers with ease.

A bit of info before we start
#

You will probably notice, based on the screenshots below, that this tutorial has been created on a Windows installation. That’s correct, but you should be able to replicate the same procedure on other operating systems without much headaches.

This tutorial works on:

  • Windows, Linux and MacOS, with some minor differences in file/folder picker and overall UI.
  • VSCodium (A truly open VS Code experience, without the proprietary or AI integrations).

Tip: You can click on images to zoom in and out.

Prerequisites
#

  • Installation of VS Code.
  • An up to date operating system.
  • A few minutes of your spare time. :)

Setup
#

  1. Open VS Code and go to Extensions.
Step 1 Image
  1. Search for sftp.

  2. Install SFTP extension from Natizyskunk author (actively maintained and updated).

Step 2 & 3 Image
  1. Click Trust Publisher & Install.
Step 4 Image
  1. Press Ctrl + Shift + P or click View > Command Palette..., and type sftp config. Click on SFTP: Config.
Step 5 Image
  1. Click on Open Folder in notification area.
Step 6 Image
  1. Create a new folder, name it however you want, make sure it’s selected and click Select Folder.
  1. Click Yes, I trust the authors (it’s your own empty folder, so it’s safe).
Step 8 Image
  1. Press Ctrl + Shift + P or click View > Command Palette..., and type sftp config. Click on SFTP: Config (same as step 5).
Step 9 Image
  1. A file named sftp.json will be opened.

You will need to update 3 required fields in this file:

  • host -> files.peanuthost.net
  • port -> 42069
  • username -> see steps below on how to acquire your username
Step 10.0 Image

In order to get your username for your server (different for each server you own), you will need to follow the following steps:

  • Login on PeanutHost panel with your account.
  • Click on your server.
Step 10.1 Image
  • Click on Settings and then on SFTP Details > Username. The username will then get copied to the clipboard. If that’s not the case, just select + copy, like usually.
Step 10.2 Image
  • Now you can update the sftp.json file in VS Code.
Step 10.3 Image
  • Save the file.
  1. Make sure you’re on the SFTP module.
Step 11 Image
  1. Click on Refresh button or on My Server in order to login.
Step 12.0 Image Step 12.1 Image
  1. Type the password of your PeanutHost panel account and press Enter.
Step 13 Image
  1. Congratsulations! You have successfully connected to your PeanutHost server files.
Step 14 Image
  1. Now you can create, modify and delete files/folders, right from your VS Code installation. Enjoy! :)
Step 15 Image

Background image by Boskampi from Pixabay.

This article is licensed under the Creative Commons Attribution 4.0 International (CC BY 4.0) license.