Connecting via SSH

Develop Faster with VS Code + Remote SSH

By the Domain India teamPublished 8 min read
Knowledge base article
Contents (10 sections)

VS Code's Remote - SSH extension lets you keep the editor on your laptop while the files, the terminal and the running code live on a Linux server. You get IntelliSense, linting, debugging and an integrated terminal, all working against the server's real operating system and dependencies. This guide sets it up with an SSH key, and explains how it fits a Domain India VPS and our shared hosting.

Key takeaways

Install VS Code and the Remote - SSH extension, create an ed25519 key, put the public key on the server, add a host entry to ~/.ssh/config, then run Remote-SSH: Connect to Host and open your project folder. On your own VPS everything works, including port forwarding and Docker. On Domain India shared hosting you first need jailed SSH enabled (ask support), login is by key only, and the VS Code server process counts against your account's resource limits, so keep sessions light.

1. How Remote - SSH works

When you connect, VS Code logs in over SSH and installs a small VS Code Server in ~/.vscode-server on the remote machine. Extensions that read your code (language servers, linters, debuggers) run there; the interface stays on your laptop. Nothing about your project is copied to your computer.

The server side needs a reasonably modern Linux: current VS Code releases require glibc 2.28 or newer, which means Ubuntu 20.04 or later, Debian 10 or later, or AlmaLinux and Rocky Linux 8 or later. Older systems such as CentOS 7 are no longer supported.

2. Where this fits on Domain India

HostingRemote - SSHWhat to know
VPSYesSelf-managed with root access; you control SSH, ports and software
cPanel and DirectAdmin shared hostingPossible, not officially supportedJailed SSH is off by default; ask support to enable it. Key login only. The VS Code server counts against your resource limits
Webuzo shared hostingPossible, not officially supportedJailed SSH is off by default; ask support. Use a key
Windows (Plesk) hostingNoThere is no SSH on Windows hosting

On shared hosting you work inside a jailed (CageFS) shell: your own home folder and a limited set of tools, with no root and no sudo. We have not tested the VS Code server inside the jail, so treat it as "try it and see". If it is slow or keeps disconnecting, use the lighter workflow in section 8.

3. Install VS Code and the extension

  1. Install Visual Studio Code
    from the official site for Windows, macOS or Linux.
  2. Install Remote - SSH.
    Open the Extensions view, search for Remote - SSH (publisher Microsoft, ID ms-vscode-remote.remote-ssh) and install it.
  3. Check you have an SSH client.
    macOS and Linux have one built in. Windows 10 and 11 include the OpenSSH client; run ssh -V in PowerShell to confirm.

4. Create an SSH key

Run this on your laptop, press Enter to accept the default location, and set a passphrase:

bash
ssh-keygen -t ed25519 -C "laptop-key"

On Windows, start the SSH agent once so you don't retype the passphrase (PowerShell as Administrator):

powershell
Get-Service ssh-agent | Set-Service -StartupType Automatic
Start-Service ssh-agent
ssh-add $env:USERPROFILE\.ssh\id_ed25519

On macOS and Linux, ssh-add ~/.ssh/id_ed25519 does the same. More detail is in how to generate SSH keys.

5. Put your public key on the server

Only ever copy the file ending in .pub. The private key never leaves your laptop.

  • Your VPS: from macOS or Linux, ssh-copy-id -i ~/.ssh/id_ed25519.pub user@your-server-ip. On Windows, paste the contents of id_ed25519.pub as one line into ~/.ssh/authorized_keys on the server (folder 700, file 600). See how to access your VPS using SSH.
  • cPanel shared hosting: in cPanel, open Security › SSH Access › Manage SSH Keys, choose Import Key, paste the public key, then click Manage and Authorize. An imported key that is not authorised will not work.
  • DirectAdmin and Webuzo: create .ssh/authorized_keys in your home folder with the File Manager and paste the key as one line, or send support your public key.

Your username, server IP and panel URL for shared hosting are on the Access tab of your hosting account in your hosting services. The full setup is in enabling and accessing jailed SSH.

6. Save a host entry

Add an entry to ~/.ssh/config on your laptop (C:\Users\you\.ssh\config on Windows):

text
Host mysite
    HostName yourdomain.com
    User yourusername
    Port 22
    IdentityFile ~/.ssh/id_ed25519
    IdentitiesOnly yes
    ServerAliveInterval 30

Test it in a terminal first with ssh mysite. If that works, VS Code will work too. On Domain India shared hosting SSH is always port 22; port 2222 on DirectAdmin servers is the control panel, not SSH.

7. Connect and open your project

  1. Connect.
    Press Ctrl+Shift+P (Cmd+Shift+P on macOS), run Remote-SSH: Connect to Host and pick mysite. The first connection installs the VS Code server, which takes a minute.
  2. Check the status bar.
    The bottom-left corner shows SSH: mysite once connected.
  3. Open the folder.
    Use File › Open Folder and choose your project, for example /home/yourusername/public_html on shared hosting or /var/www/app on a VPS.
  4. Install extensions on the remote side
    only where you need them. Extensions installed "in SSH: mysite" run on the server and use its CPU and memory.
  5. Use the integrated terminal
    (Ctrl+`) for commands. It runs on the server.

Port forwarding (VPS). If your app listens on port 3000 on the server, open the Ports view and forward 3000; VS Code gives you http://localhost:3000 on your laptop, tunnelled over SSH. You can also debug Node.js or Python processes on the server from the Run and Debug view.

8. Working on shared hosting without hitting your limits

Everything the VS Code server does, including indexing files and running language servers, counts towards your account's CPU, memory and process limits, just like your website. See understanding hosting resource limits.

  • Open one site folder, not your whole home folder.
  • Exclude big folders from watching in .vscode/settings.json:
json
{
  "files.watcherExclude": {
    "**/node_modules/**": true,
    "**/vendor/**": true,
    "**/wp-content/uploads/**": true,
    "**/cache/**": true
  }
}
  • Close the remote window when you finish rather than leaving it connected overnight.
  • Don't run long-lived servers. Always-on apps don't suit shared hosting; use the App Platform or a VPS.

The lighter workflow. Edit locally, commit, and deploy with Git (available in the jail on our cPanel servers; see deploying with Git), or pack an archive and upload it: tar czf site.tgz site/, then scp site.tgz mysite:, then unpack it over SSH. rsync is not available in the jailed shell, but scp and SFTP are. Composer isn't pre-installed, so download composer.phar and run it with php over SSH, or build vendor/ locally and upload it.

9. Troubleshooting

ProblemWhat to check
Permission denied (publickey)The key is not authorised on the server, or the wrong key is used. Test with ssh -v mysite
Connection times outWrong host or port, or your IP is blocked by the server firewall after failed logins. Ask support with your public IP
Could not establish connection / server download failsSet remote.SSH.localServerDownload to always so VS Code copies the server from your laptop
Server installs but keeps disconnectingResource limits on shared hosting. Close other sessions and exclude large folders
Unsupported Linux / glibc errorThe server OS is too old for current VS Code. Upgrade the OS on your VPS
Securing your own VPS

On a VPS the SSH server is yours to harden: switch off password login once your key works, keep the system updated and use a firewall. Follow the SSH security hardening checklist and keep a second session open while you change sshd_config.

Frequently asked questions

Can I use VS Code Remote - SSH with Domain India shared hosting?

It is possible but not officially supported. Jailed SSH is available on every Domain India shared hosting plan, off by default; ask support to enable it. Login is by SSH key only, and the VS Code server counts against your account's resource limits.

Can I use it with a Domain India VPS?

Yes. Domain India VPS plans are self-managed with root access, so Remote - SSH, port forwarding, remote debugging and Docker all work as on any Linux server.

Does Remote - SSH work on Windows hosting?

No. Domain India Windows (Plesk) hosting has no SSH, so Remote - SSH cannot connect. Use FTP or the Plesk file manager.

Which port do I use for SSH on Domain India shared hosting?

Port 22 on cPanel, DirectAdmin and Webuzo. Port 2222 on DirectAdmin servers is the control panel, not SSH.

Can I log in with my cPanel password?

No. SSH on Domain India shared servers accepts key login only. Add your public key in cPanel under SSH Access, or in authorized_keys on DirectAdmin and Webuzo, or send your public key to support.

Why does VS Code say my server's Linux version is not supported?

Current VS Code releases need glibc 2.28 or newer on the server, such as Ubuntu 20.04 or later, Debian 10 or later, or AlmaLinux 8 or later. On an older VPS, upgrade the operating system.

Ready to set it up? Ask support to enable jailed SSH on your shared hosting, or compare VPS plans for a server you fully control. For anything else, open a support ticket; support is on 24/7 live chat, and tickets get a first response within 15 minutes.

Need SSH switched on?

Jailed SSH is available on every shared hosting plan. Tell us your domain and we will enable it for your account.

Open a support ticket

Ready when you are

Get VPS from ₹552.65/mo + GST

See plans

Was this article helpful?

Your answer helps us decide what to improve next.

Still need help? Open a support ticket and our team will reply.

Prefer an app? Add this site to your home screen.Get the app
VS Code Remote - SSH: Set Up and Use It | Domain India