Skip to content

Instantly share code, notes, and snippets.

@soukron
Created July 11, 2025 09:16
Show Gist options
  • Save soukron/e352218bf42a7489dd6173da36c522ce to your computer and use it in GitHub Desktop.
Save soukron/e352218bf42a7489dd6173da36c522ce to your computer and use it in GitHub Desktop.
Install VSCode Server / CLI to remote development
#!/bin/bash
# Usage: ./install-vscode.sh [commit_id] [src_dir]
COMMIT=${1:-18e3a1ec544e6907be1e944a94c496e302073435}
SRC_DIR=${2:-/opt/vscode}
DST_DIR="${HOME}/.vscode-server/cli/servers/Stable-${COMMIT}/server"
SERVER_TAR="${SRC_DIR}/${COMMIT}/vscode-server-linux-x64.tar.gz"
CLI_TAR="${SRC_DIR}/${COMMIT}/vscode_cli_alpine_x64_cli.tar.gz"
echo "Using commit: $COMMIT"
echo
# Check if files exist
echo -e "🔎 Checking source files in ${SRC_DIR}/${COMMIT}...\n"
MISSING=0
if [ ! -f "$SERVER_TAR" ]; then
echo "❌ Missing file: vscode-server-linux-x64.tar.gz"
echo "➡️ Please download it from:"
echo -e " https://update.code.visualstudio.com/commit:$COMMIT/server-linux-x64/stable\n"
MISSING=1
fi
if [ ! -f "$CLI_TAR" ]; then
echo "❌ Missing file: vscode_cli_alpine_x64_cli.tar.gz"
echo "➡️ Please download it from:"
echo -e " https://update.code.visualstudio.com/commit:$COMMIT/cli-alpine-x64/stable\n"
MISSING=1
fi
if [ "$MISSING" -eq 1 ]; then
echo "⚠️ One or more required files are missing. Please download them and try again."
exit 1
fi
echo "✅ All required files are present."
# Extract Server
mkdir -p "${DST_DIR}"
tar -xz -C "${DST_DIR}" --strip-components=1 --no-same-owner -f "$SERVER_TAR"
# Extract CLI
tar -xz -C ~/.vscode-server --no-same-owner -f "$CLI_TAR"
ln -fs ~/.vscode-server/code "${HOME}/.vscode-server/code-${COMMIT}"
@soukron
Copy link
Author

soukron commented Jul 11, 2025

I work with VSCode locally but I connect to remote servers which don't have access to Internet, therefore the installation of the components in the remote server fails.

It's 2025 and there's no a way to configure VSCode so the local client downloads everything and copies to the remote server, or if it exists I can't find it.

Therefore here's my usual script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment