Installing Visual Studio Code (VS Code) extensions in an offline environment typically involves the following steps:
Step 1: Download the extension from another machine with internet access
First, download the required extension file from a machine with internet access. VS Code extensions are typically available in the .vsix file format.
-
Open VS Code.
-
Navigate to the Extensions Marketplace and locate the desired extension.
-
Click the small gear icon next to the extension and select 'Download Extension'.

You will receive a .vsix file.
Step 2: Transfer the .vsix file to the offline machine
Use a USB drive or other medium to transfer the .vsix file from the machine with internet access to the offline machine.
Step 3: Install the extension on the offline machine
On the offline machine, install the .vsix file using VS Code.
-
Open VS Code.
-
Navigate to the Extensions view (
Ctrl+Shift+Xor click the Extensions icon in the sidebar). -
Click the three dots (...) in the top-right corner and select 'Install from VSIX...'.

-
In the file selection dialog that appears, locate your
.vsixfile, select it, and click 'Open'.
After completing these steps, the extension will be installed in your VS Code, allowing you to use it even without an internet connection.
Example
For instance, if you need to install the Python extension on a server without internet access, download the Python extension's .vsix file on your personal computer (with internet access), transfer it to the server via USB, and install it in VS Code on the server using the steps above. This enables you to use VS Code on the server to edit Python code, enjoying features like syntax highlighting and code completion without an internet connection.