💻
Hosting

VS Code Remote SSH: editing code directly on your server

11.11.2026
← All articles

Many developers still update websites the old way: edit a file locally, upload it with an FTP client and refresh the browser. Every small fix turns into several steps, and after a few weeks nobody remembers which files actually made it to the server. The VS Code Remote SSH extension takes a different approach: the editor runs on your computer, but files, the terminal and search all run on the server. The project on the server simply looks like a local folder.

How Remote SSH works

The extension connects over ordinary SSH and, on the first connection, installs a small server component into ~/.vscode-server in the user's home directory. From then on the heavy lifting, such as reading files, searching text, some extensions and the terminal, happens on the server while your machine only draws the interface. Nothing has to be downloaded, and a change lands on the server the moment you save. The trade-off is an extra process on the server that uses a few hundred megabytes of disk and some memory, which is why Remote SSH is most comfortable on a VPS. On shared hosting with SSH access, background process limits can drop the session; you can check whether your sayt.uz hosting plan includes SSH in the cabinet or through support.

Creating an SSH key

Typing a password for every connection is both tedious and less secure, so create a key pair first. ssh-keygen ships with Windows 10/11, macOS and Linux. Set a passphrase when asked.

ssh-keygen -t ed25519 -C "office-laptop"
# Creates ~/.ssh/id_ed25519 (private) and ~/.ssh/id_ed25519.pub (public)

# Linux/macOS: copy the public key to the server
ssh-copy-id -i ~/.ssh/id_ed25519.pub deploy@203.0.113.10

On Windows, where ssh-copy-id may be missing, paste the contents of the .pub file into ~/.ssh/authorized_keys on the server by hand. The private key must never leave your computer. Permissions on the server matter too, otherwise SSH silently ignores the key.

chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

Configuring ~/.ssh/config

Remote SSH reads the standard SSH config file, so you describe each server once and then just pick it from a list.

Host misol-vps
    HostName 203.0.113.10
    User deploy
    IdentityFile ~/.ssh/id_ed25519
    ServerAliveInterval 60

Host misol-hosting
    HostName example.uz
    User s0123
    IdentityFile ~/.ssh/id_ed25519

ServerAliveInterval sends a tiny keep-alive packet every 60 seconds so routers do not drop an idle session. Test with ssh misol-vps in a normal terminal first; if that logs in without a password, VS Code will too.

Connecting from VS Code

Install Microsoft's "Remote - SSH" extension, press F1 and choose "Remote-SSH: Connect to Host". Your config entries appear in the list. On first use VS Code asks for the server OS and installs its component, after which "Open Folder" lets you open /var/www/example.uz or your hosting site directory. The integrated terminal now runs on the server, so git status or composer install work without a separate SSH window. Language extensions such as PHP or Python analysers run remotely and may need "Install in SSH".

Example: a clinic website in Tashkent

A small Tashkent clinic runs a Laravel appointment site on a VPS, and its developer updates the doctors' schedule page every week. Previously he edited locally, uploaded via FTP and sometimes forgot to clear the cache, so the change never appeared. Now he connects to misol-vps, edits the Blade template, runs php artisan view:clear in the same window and sees the result immediately. When something breaks, he opens storage/logs/laravel.log in the editor and searches for the error.

Working safely on a live server

Because saving means deploying, a single typo can take the site down. A few habits reduce the risk:

Common problems

"Permission denied (publickey)" usually means the key is not on the server or authorized_keys has the wrong permissions. A connection stuck at "Setting up SSH host" often points to a full disk or blocked outbound internet, since the component is downloaded on first use. Open the "Output" panel and select the "Remote - SSH" log to read the exact error, and if the server side is broken, deleting ~/.vscode-server and reconnecting usually helps.

Related articles

🚦 MySQL "Too many connections" Error: Causes and Fixes 📁 Connecting to your hosting over SFTP with FileZilla and WinSCP 🗄️ How to Create a Database and User in ISPmanager 🔤 utf8mb4: keeping emoji and Uzbek letters intact in MySQL
🌐 Language
🇺🇿 O'zbek 🇺🇿 Ўзбек 🇷🇺 Русский 🇬🇧 English ✓