How to Sync VS Code Extensions in Remote Projects (SSH, WSL, Docker)| Sabbirz | Blog

How to Sync VS Code Extensions in Remote Projects (SSH, WSL, Docker)

Sync VS Code Extensions in Remote Projects

Syncing VS Code Extensions in Remote Projects

When you open a remote project in VS Code — whether through SSH, WSL, Docker, or Codespaces — it feels great… until you realize half your favorite extensions are missing. You know, the ones you already installed locally?

And then you go:

“Wait, I already installed Prettier, Python, and GitLens — why do I have to do it again?!”

That’s a common frustration, so let’s fix it once and for all.


🧩 Solution for My Noob and Impatient Users

If you just want the quick fix — here you go:

💨 Quick 3-Step Solution

  1. Export all your local extensions:
    code --list-extensions > extensions.txt
  2. Copy extensions.txt to your remote environment (or open it in Remote Explorer).
  3. Install them all at once remotely:
    cat extensions.txt | xargs -L 1 code --install-extension

That’s it! All your extensions will be cloned to the remote setup in one go.


🧠 Let's Dig Deeper & Find Out Why You See Missing Extensions in Remote Projects

When you open a folder through:

  • Remote-SSH,
  • WSL (Windows Subsystem for Linux), or
  • Dev Containers,

VS Code launches a different server instance inside that environment. That means it uses a separate set of extensions (specific to that environment), instead of reusing your local ones.

In short: 🖥️ Local VS Code = runs on your computer 🌐 Remote VS Code = runs inside that environment (SSH, WSL, etc.)

So yes — you need to install your favorite tools there too. But we can make that painless.


This is by far the cleanest way to keep all your extensions (and settings) in sync across all environments.

Steps:

  1. Open Command Palette:
    Ctrl + Shift + P
  2. Run:
    Settings Sync: Turn On
  3. Sign in using your Microsoft or GitHub account.
  4. Check Extensions, Settings, and Keybindings to sync.

Now, when you connect to any remote environment (SSH, WSL, Codespace), VS Code will automatically install and sync your extensions.

⚡ Pro Tip: You can view what’s being synced at any time using Settings Sync: Show Synced Data.

Pros

  • Super easy to maintain.
  • Works across devices and environments.
  • Includes themes, keybindings, and UI settings too.

Cons

  • Requires login (some enterprise setups block that).
  • Might sync too much if you want separate profiles.

🧱 Option 2: Export and Install Manually

If you like control — or you’re in an offline setup — this method is your friend.

1. Export your extensions list

code --list-extensions > extensions.txt

This saves something like:

ms-python.python
esbenp.prettier-vscode
eamodio.gitlens

2. Copy the list to your remote environment

If using SSH:

scp extensions.txt user@remote-server:~/

3. Install all extensions in one go

cat extensions.txt | xargs -L 1 code --install-extension

💡 If you use VS Code Remote Explorer, just open a terminal inside the remote environment and run this there.

Pros

  • Works offline.
  • Perfect for reproducible setups.
  • Easy to version-control (you can keep extensions.txt in your repo).

Cons

  • Manual export/import each time.

⚙️ Option 3: Project-Specific Recommendations

You can make VS Code automatically suggest extensions for a project — super useful if you share the workspace with teammates.

Just add a file inside your project at:

.vscode/extensions.json

Example:

{
  "recommendations": [
    "ms-python.python",
    "ms-azuretools.vscode-docker",
    "esbenp.prettier-vscode"
  ]
}

Next time someone (including you) opens that project, VS Code will say:

“This workspace has extension recommendations.”

You click “Install All” — done.

Pros

  • Keeps project environments consistent.
  • Great for teams.
  • Requires no login or export.

Cons

  • Doesn’t auto-install — it just recommends.

🧰 Option 4: Sync via Script (Automation Junkies Only)

If you frequently switch between environments, make a simple sync script:

# sync-extensions.sh

echo "Exporting current extensions..."
code --list-extensions > ~/.vscode/extensions.txt

echo "Installing extensions in remote..."
cat ~/.vscode/extensions.txt | xargs -L 1 code --install-extension

Then just run:

bash sync-extensions.sh

💡 You can even add this to your dotfiles or post-SSH setup script.


🚀 Final Thoughts

Your extensions define how productive you are in VS Code — losing them every time you open a remote project is just not acceptable.

So whether you:

  • Use Settings Sync for a fully automated setup,
  • Export manually for portability, or
  • Recommend extensions for team consistency —

you now know exactly how to make your remote VS Code behave like home.


Bonus Tip: You can also run

code --install-extension <extension-id>

for a single extension anytime. To find its ID, open the extension’s details in VS Code Marketplace — it’s usually in the format publisher.extensionName (like ms-python.python).

Related posts