> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://wiki.volthosting.co.uk/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to use Visual Studio Code (VSCode) to edit files on your Linux server


# Using Visual Studio Code to Edit Files on a Linux Server

[Visual Studio Code](https://code.visualstudio.com/) is a lightweight text editor developed by Microsoft, making it an excellent tool for editing configuration files on your Linux server. This guide explains how to set it up and use it effectively.

| **Note:** Visual Studio Code is distinct from "Visual Studio"; they are entirely different tools!

One of Visual Studio Code's strengths is its extensive [marketplace of extensions](https://marketplace.visualstudio.com/vscode) that enhance its functionality. One such extension is [Remote-SSH](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh), which enables seamless editing of files on remote servers.

## Setting Up Visual Studio Code

Visual Studio Code is available for Windows, macOS, and Linux. Begin by downloading and installing it from the [official website](https://code.visualstudio.com/download). 

After installation, you will see the “Welcome” screen:

![](https://storage.crisp.chat/users/helpdesk/website/a7f74f9f83d47000/ghsrjufbocmtsjn1mrrpg4ptlmawn8_wv2vqx.png)

### Verifying SSH Requirements

The Remote-SSH extension requires an SSH client installed on your local machine (your Linux server already has an SSH server). To check if SSH is installed, open a command prompt/terminal and type `ssh`. If you see usage instructions, you're all set. Otherwise, you’ll need to install an SSH client.

#### Installing SSH Clients

- **Windows:**
  On Windows 10 (Build 1803 or higher), enable the built-in OpenSSH Client:  
  
1. Open **Settings** from the Start Menu.
2. Navigate to **Apps > Apps and Features > Manage Optional Features**.
3. Click **Add A Feature**, search for **OpenSSH Client** (not **OpenSSH Server**), and click **Install**.

  For older versions, install an SSH client via [Git for Windows](https://git-scm.com/download/win).

- **macOS:**
  SSH is pre-installed.  

- **Linux:**
  - Debian/Ubuntu: Run `sudo apt-get install openssh-client`.  
  - RHEL/CentOS/Fedora: Run `sudo yum install openssh-clients`.  

Re-test the `ssh` command after installation. If it’s still unrecognised, try logging out and back in.

### Installing the Remote-SSH Extension

Once SSH is ready, install the Remote-SSH extension. Visit the [extension page](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh) and click **Install**, which will open the Extensions page in Visual Studio Code.

![](https://storage.crisp.chat/users/helpdesk/website/a7f74f9f83d47000/rtt6gnmcygxtwzvfcesoxsqmul2qmv_gn6gg5.png)

Click the blue **Install** button to add the extension. This process only takes a few moments and doesn’t require restarting Visual Studio Code.

## Connecting to Your Server with Remote-SSH

1. Press **F1** or **Ctrl + Shift + P** ( **Cmd** instead of **Ctrl** on macOS).
2. Type `remote-ssh connect` and select **Remote-SSH: Connect to Host...**.
3. Choose **+ Add New SSH Host...** and enter the connection command in the format `ssh user@ip.address` (e.g., `ssh root@185.195.238.100`). Don't know your Linux SSH details? Take a look at our [Logging Into Your Linux VPS](https://wiki.volthosting.co.uk/en/article/logging-into-your-linux-vps-6x7d43/) guide.
4. When prompted, enter your password and confirm the server's fingerprint by clicking **Continue**.

![Step 1](https://storage.crisp.chat/users/helpdesk/website/a7f74f9f83d47000/1edsruzox9hco81tuoixbzhvusg6wl_1o4hl70.png)  
![Step 2](https://storage.crisp.chat/users/helpdesk/website/a7f74f9f83d47000/zdjivmervl7fwwshlizctjmsqmafqs_1j48qwe.png)  
![Step 3](https://storage.crisp.chat/users/helpdesk/website/a7f74f9f83d47000/potrxqhcmpto41sqx8hdld3rlj3qyz_lb0fyy.png) ||| Replace the IP address with your own servers IP address.

### Editing Files

Once connected:  
- Open files or folders via **File > Open**.  
- Edit files as you would in any text editor.  
- Save your changes via **File > Save**.

The Remote-SSH extension remembers your server, so next time you select **Remote-SSH: Connect to Host**, your server will appear as an option.

Enjoy efficient server file editing with Visual Studio Code!