Created
July 11, 2025 09:16
-
-
Save soukron/e352218bf42a7489dd6173da36c522ce to your computer and use it in GitHub Desktop.
Install VSCode Server / CLI to remote development
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.