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


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.
If you just want the quick fix — here you go:
code --list-extensions > extensions.txt extensions.txt to your remote environment (or open it in Remote Explorer). 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.
When you open a folder through:
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.
Ctrl + Shift + P Settings Sync: Turn On 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
Cons
If you like control — or you’re in an offline setup — this method is your friend.
code --list-extensions > extensions.txtThis saves something like:
ms-python.python
esbenp.prettier-vscode
eamodio.gitlensIf using SSH:
scp extensions.txt user@remote-server:~/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
extensions.txt in your repo). Cons
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{
"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
Cons
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-extensionThen just run:
bash sync-extensions.sh💡 You can even add this to your dotfiles or post-SSH setup script.
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:
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).

Stuck with SQLite errors in Superset? Learn why your metadata DB is locked and how to fix it permanently by migrating to PostgreSQL.

Confused by prototype and __proto__ in the browser console? Master JavaScript's inheritance model with this clear, expert guide.

Learn how to check and set your Git user.name and user.email for all projects (global) or a single repo (local). Fix your GitHub commit identity.