Setting Up a Remote Development Environment with VS Code Server and Docker
A step-by-step guide to building a secure, compliant remote dev environment using VS Code Server and Docker — code from anywhere without compromising security.
Siddhartha Lahiri · · 1 min read

In today's distributed development world, having a secure, compliant, and accessible development environment is crucial. This guide walks you through setting up a containerized VS Code Server environment that helps maintain SOC compliance while providing developers with a powerful remote development platform.
This article demonstrates setting up locally using docker-compose. For production, the same can be achieved by deploying the Docker image using Helm Charts.
Key Advantages
- Production-Like Development: Code is developed in an environment matching production, significantly reducing "it works on my machine" issues and deployment problems.
- Machine Independence: Developers can work from any device with a browser, eliminating the need for powerful local machines and specific configurations.
- Resource Flexibility: Docker containers can be configured to use host machine resources, including GPUs for ML/LLM workloads, providing scalable computing power.
- Standardized Environment: Every developer works with identical tools, dependencies, and configurations, ensuring consistency across the team.
- Enhanced Security: Code remains in a controlled environment with centralized access management and monitoring.
- Consistent and Approved Extensions: The installation can be setup with pre-configured extensions approved by the organization.
Setting Up Your Development Environment
Step 1: Get the code
Clone the repository and navigate to the project directory:
git clone https://github.com/slahiri/vscode-docker.git
cd vscode-docker Step 2: Docker File Configuration
FROM ubuntu:latest
# Install prerequisites and developer tools
RUN apt-get update && apt-get install -y \
curl \
wget \
sudo \
build-essential \
python3 \
python3-pip \
python3-venv \
python3-full \
git \
zsh \
vim \
nano \
htop \
tree \
ripgrep \
ssh \
gnupg \
software-properties-common \
locales \
man-db \
bash-completion
# Set locale
RUN locale-gen en_US.UTF-8
# Install Node.js
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
apt-get install -y nodejs
# Install pnpm
RUN npm install -g pnpm
# Install Yeoman and generator
RUN npm install -g yo
# Install Code-Server (VS Code in the browser)
RUN curl -fsSL https://code-server.dev/install.sh | sh
# Create and activate Python virtual environment
RUN python3 -m venv /root/.python_venv
ENV PATH="/root/.python_venv/bin:$PATH"
# Install Python packages in the virtual environment
RUN pip3 install --no-cache-dir \
ipython \
pytest \
pylint \
black \
flake8
# Install Oh My Zsh
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
# Create projects directory
RUN mkdir -p /root/projects
# Set working directory
WORKDIR /root/projects
# Add virtual environment activation to .zshrc and .bashrc
RUN echo "source /root/.python_venv/bin/activate" >> /root/.zshrc && \
echo "source /root/.python_venv/bin/activate" >> /root/.bashrc
# Expose port for Code-Server
EXPOSE 8080
# Start Code-Server on container launch with projects folder
CMD ["code-server", "--bind-addr", "0.0.0.0:8080", "--auth", "none", "/root/projects"] Step 3: Docker Compose Setup
services:
code-server:
build: .
ports:
- "8080:8080"
volumes:
- ./workspace:/root/workspace
- code-server-data:/root/.local/share/code-server
- ./extensions:/root/.local/share/code-server/extensions
- code-projects:/root/projects
environment:
- TZ=UTC
restart: unless-stopped
volumes:
code-server-data:
code-projects: Step 4: Running Visual Studio Code
docker-compose up -d Step 5: Access VS Code on Browser
http://localhost:8080 Best Practices
- Regularly update base images and dependencies
- Implement proper authentication and access controls
- Monitor container resources and logs
- Maintain regular backups
- Document all customizations
This setup creates a secure, compliant, and efficient development environment that meets both your team's needs and organizational compliance requirements.
#DevOps #Docker #VSCode #RemoteDevelopment #Security #SOC2
First published on LinkedIn. Join the discussion there →


