← Back to DevBytes

WebStorm Remote Development: Complete Guide

Introduction to WebStorm Remote Development

WebStorm Remote Development is a JetBrains feature that allows you to run the IDE backend on a remote server while the thin client runs on your local machine. This architecture decouples the user interface from the actual code processing, enabling developers to work on projects hosted anywhere — from cloud instances to on-premise servers — without sacrificing the full IDE experience.

Introduced as part of JetBrains' broader remote development initiative, WebStorm Remote Development supports multiple connection types including SSH, Docker containers, WSL (Windows Subsystem for Linux), and JetBrains Space dev environments. The local client is lightweight, fast to launch, and consumes minimal resources, while the heavy lifting — indexing, code analysis, file operations, and tool integration — happens on the remote host.

Why Remote Development Matters

Modern development workflows increasingly demand flexibility. Teams are distributed, infrastructure lives in the cloud, and local machines often lack the resources to run large projects efficiently. Remote development addresses several pain points:

How the Architecture Works

WebStorm Remote Development uses a split architecture. Understanding this model helps you troubleshoot and optimize your setup.

The Two Components

Thin Client: A lightweight application installed on your local machine. It handles rendering the IDE interface, capturing keyboard and mouse input, and displaying editor output. It does not access your project files directly.

IDE Backend: The full WebStorm backend runs on the remote host. It performs indexing, code inspection, refactoring, running tests, executing terminal commands, and interacting with version control. All file operations occur on the remote filesystem.

The two components communicate over a secure protocol. The thin client sends input events, and the backend responds with UI updates and code intelligence results. This separation means your local machine's specs matter far less than your remote server's capabilities.

Prerequisites and System Requirements

Before setting up WebStorm Remote Development, ensure your environment meets the requirements.

Local Machine Requirements

Remote Server Requirements

Connection Methods

WebStorm Remote Development supports several connection types, each suited to different scenarios.

SSH Connections

The most common method. You connect directly to a remote server over SSH. JetBrains Gateway handles installing the IDE backend on the remote host automatically.

Docker Containers

Connect to a running Docker container. This is ideal for reproducible development environments defined by Dockerfiles.

WSL (Windows Subsystem for Linux)

Windows users can run the IDE backend inside WSL, giving them a native Linux development environment without leaving Windows.

JetBrains Space Dev Environments

If your team uses JetBrains Space, you can spin up cloud-based dev environments and connect directly through Gateway.

Step-by-Step Setup Guide

Method 1: Connecting via SSH

This is the most straightforward approach. Follow these steps to connect to a remote server over SSH.

Step 1: Install JetBrains Gateway

Download JetBrains Gateway from the JetBrains website. You can also launch it directly from WebStorm via the Remote Development section on the welcome screen.

Step 2: Configure SSH Access

Ensure you can SSH into your remote server from your local machine. Set up key-based authentication for a smoother experience:

# Generate an SSH key pair on your local machine
ssh-keygen -t ed25519 -C "your_email@example.com"

# Copy the public key to the remote server
ssh-copy-id -i ~/.ssh/id_ed25519.pub username@remote-server-ip

# Test the connection
ssh username@remote-server-ip

Step 3: Launch JetBrains Gateway and Connect

Open JetBrains Gateway, select "SSH Connection," and enter your server details. You can also use an existing SSH configuration file. Gateway will connect, detect whether the IDE backend is installed, and download it if necessary.

Alternatively, configure your SSH config file for easier management:

# ~/.ssh/config

Host dev-server
    HostName 203.0.113.50
    User developer
    Port 22
    IdentityFile ~/.ssh/id_ed25519
    ServerAliveInterval 60
    ServerAliveCountMax 10

With this config, you can simply type dev-server in Gateway's host field.

Step 4: Select Your Project

After connecting, browse the remote filesystem and select your project directory. Gateway will launch the thin client and start indexing the project on the remote server.

Method 2: Connecting via Docker

For containerized development, you can connect WebStorm to a Docker container. First, create a Dockerfile for your development environment:

# Dockerfile.dev
FROM node:20-slim

# Install essential tools
RUN apt-get update && apt-get install -y \
    git \
    curl \
    vim \
    openssh-server \
    && rm -rf /var/lib/apt/lists/*

# Set up SSH for remote development
RUN mkdir /var/run/sshd
RUN echo 'root:devpassword' | chpasswd
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config

# Set working directory
WORKDIR /workspace

# Expose SSH port
EXPOSE 22

CMD ["/usr/sbin/sshd", "-D"]

Build and run the container:

# Build the image
docker build -t webstorm-dev -f Dockerfile.dev .

# Run the container with mounted volume
docker run -d \
    --name dev-container \
    -p 2222:22 \
    -v $(pwd)/my-project:/workspace/my-project \
    webstorm-dev

In JetBrains Gateway, connect to localhost on port 2222 using SSH. The IDE backend will install inside the container, and your project at /workspace/my-project will be available.

Method 3: Connecting via WSL

Windows users can leverage WSL2 for a Linux development environment. First, ensure WSL2 is installed:

# In PowerShell as Administrator
wsl --install -d Ubuntu-22.04

# Verify installation
wsl --list --verbose

Inside WSL, install necessary tools:

# Inside WSL
sudo apt update && sudo apt upgrade -y
sudo apt install -y git curl build-essential

# Install Node.js via nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc
nvm install 20

In JetBrains Gateway, select "WSL" as the connection type. Choose your WSL distribution and the project path within the WSL filesystem. Gateway will install the backend inside WSL and connect.

Configuring Your Remote Environment

Installing Plugins on the Remote Backend

Plugins in remote development are installed on the backend, not the thin client. To install plugins, use the Settings dialog in the thin client — changes propagate to the remote backend automatically. You can also install plugins via command line on the server:

# Navigate to the IDE backend plugins directory
cd ~/.cache/JetBrains/WebStorm/remote-dev/plugins

# Download and install a plugin manually
wget https://plugins.jetbrains.com/plugin/download?rel=true&id=12345 -O my-plugin.zip
unzip my-plugin.zip -d my-plugin

Configuring Node.js and Package Managers

Since code execution happens on the remote server, your Node.js runtime must be installed there. Configure the Node.js interpreter in WebStorm settings to point to the remote installation:

# On the remote server, find your Node.js path
which node
# Output: /home/developer/.nvm/versions/node/v20.11.0/bin/node

# Verify npm and other tools
which npm
which npx
which pnpm

In WebStorm, go to Settings > Languages & Frameworks > Node.js and set the Node interpreter to the path returned by which node.

Setting Up Run Configurations

Run configurations execute on the remote server. Here is an example .run configuration file for a Next.js project:

<component name="ProjectRunConfigurationManager">
  <configuration default="false" name="Dev Server" type="js.build_tools.npm">
    <package-json value="$PROJECT_DIR$/package.json" />
    <command value="run" />
    <scripts>
      <script value="dev" />
    </scripts>
    <node-interpreter value="project" />
    <envs>
      <env name="NODE_ENV" value="development" />
      <env name="PORT" value="3000" />
    </envs>
    <method v="2" />
  </configuration>
</component>

Port Forwarding for Local Preview

When running a dev server on the remote machine, you need port forwarding to preview it locally. WebStorm handles this automatically for recognized dev servers, but you can also set it up manually:

# Forward remote port 3000 to local port 3000
ssh -L 3000:localhost:3000 dev-server -N

# Or forward multiple ports
ssh -L 3000:localhost:3000 -L 5432:localhost:5432 dev-server -N

With port forwarding active, open http://localhost:3000 in your local browser to access the remote dev server.

Working with Version Control Remotely

Git operations execute on the remote server, so your SSH keys and Git configuration must be set up there. Configure Git on the remote host:

# Set up Git identity
git config --global user.name "Your Name"
git config --global user.email "your_email@example.com"

# Generate SSH keys for Git hosting (GitHub, GitLab, etc.)
ssh-keygen -t ed25519 -C "your_email@example.com"

# Add the key to your SSH agent
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519

# Display the public key to add to your Git hosting service
cat ~/.ssh/id_ed25519.pub

Once configured, all Git operations in WebStorm — commits, pushes, pulls, merges — execute on the remote server using the remote server's credentials.

Performance Optimization

Choosing the Right Server Specs

The remote server's resources directly impact IDE responsiveness. Here are general recommendations based on project size:

Excluding Directories from Indexing

Indexing is the most resource-intensive operation. Exclude directories that do not need indexing, such as node_modules, build outputs, and cache directories:

<component name="ProjectModuleManager">
  <modules>
    <module fileurl="file://$PROJECT_DIR$/.idea/project.iml" filepath="$PROJECT_DIR$/.idea/project.iml">
      <excludeFolder url="file://$PROJECT_DIR$/node_modules" />
      <excludeFolder url="file://$PROJECT_DIR$/dist" />
      <excludeFolder url="file://$PROJECT_DIR$/.next" />
      <excludeFolder url="file://$PROJECT_DIR$/coverage" />
      <excludeFolder url="file://$PROJECT_DIR$/.turbo" />
    </module>
  </modules>
</component>

Using SSD Storage

IDE caches and project files benefit enormously from SSD storage. If using a cloud provider, always choose SSD-backed volumes. You can also move the IDE cache directory to a faster mount:

# Create a symlink for IDE caches on a faster disk
mv ~/.cache/JetBrains /mnt/fast-ssd/jetbrains-cache
ln -s /mnt/fast-ssd/jetbrains-cache ~/.cache/JetBrains

Network Optimization

Latency between the thin client and backend affects perceived performance. Choose a server geographically close to your location. You can also compress SSH traffic:

# ~/.ssh/config with compression enabled
Host dev-server
    HostName 203.0.113.50
    User developer
    Compression yes
    CompressionLevel 6
    ServerAliveInterval 60
    ServerAliveCountMax 10
    ControlMaster auto
    ControlPath ~/.ssh/sockets/%r@%h-%p
    ControlPersist 600

Create the sockets directory:

mkdir -p ~/.ssh/sockets
chmod 700 ~/.ssh/sockets

Best Practices

Use Dedicated Development Users

Create a dedicated user account for development rather than using root. This improves security and prevents accidental system-wide changes:

# Create a development user
sudo useradd -m -s /bin/bash developer
sudo usermod -aG sudo developer
sudo passwd developer

# Set up directory permissions
sudo mkdir -p /home/developer/projects
sudo chown -R developer:developer /home/developer/projects

Automate Environment Setup

Use provisioning scripts to set up new remote environments consistently. Here is an example setup script:

#!/bin/bash
# setup-dev-env.sh - Run on a fresh remote server

set -e

# Update system packages
sudo apt update && sudo apt upgrade -y

# Install essential packages
sudo apt install -y git curl wget vim build-essential \
    openssh-server htop unzip software-properties-common

# Install Node.js via NodeSource
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs

# Install pnpm globally
npm install -g pnpm

# Install Docker
curl -fsSL https://get.docker.com | sudo sh
sudo usermod -aG docker developer

# Configure Git
git config --global init.defaultBranch main
git config --global pull.rebase false
git config --global core.editor "vim"

# Create project directory
mkdir -p ~/projects

echo "Development environment setup complete!"

Keep the IDE Backend Updated

JetBrains releases updates that include performance improvements and bug fixes. Update the remote backend regularly:

# Check for available updates in Gateway
# Or manually update via command line on the remote server

# List installed IDE backends
ls ~/.cache/JetBrains/WebStorm/remote-dev/

# Download the latest version
# Gateway handles this automatically when you connect

Use .editorconfig for Consistency

Since multiple developers may connect to the same remote environment, enforce consistent formatting:

# .editorconfig
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2

Leverage Run Targets for Containerized Execution

WebStorm's Run Targets feature lets you execute run configurations inside Docker containers or on remote machines. This is useful for testing in production-like environments:

# docker-compose.dev.yml
version: '3.8'

services:
  app:
    build:
      context: .
      dockerfile: Dockerfile.dev
    ports:
      - "3000:3000"
    volumes:
      - .:/app
      - /app/node_modules
    environment:
      - NODE_ENV=development
      - CHOKIDAR_USEPOLLING=true
    command: npm run dev

Troubleshooting Common Issues

Connection Drops Frequently

If your connection drops often, adjust SSH keepalive settings and check your network stability:

# Increase keepalive frequency in SSH config
Host dev-server
    ServerAliveInterval 30
    ServerAliveCountMax 20
    TCPKeepAlive yes

# Check network stability
ping -c 10 your-server-ip
mtr your-server-ip

IDE Backend Fails to Start

Check the backend logs on the remote server for error details:

# View IDE backend logs
cat ~/.cache/JetBrains/WebStorm/remote-dev/log/idea.log

# Check Java version compatibility
java -version

# Verify disk space
df -h

# Check available memory
free -h

Slow Indexing Performance

If indexing takes too long, verify your exclusions and check server resources:

# Check CPU and memory usage during indexing
top -u developer

# Monitor disk I/O
iostat -x 2

# Check if node_modules is being indexed (it should be excluded)
find ~/.cache/JetBrains/WebStorm/remote-dev/index -name "*.index" | head -20

Port Forwarding Not Working

If you cannot access your dev server locally, verify the port forwarding and firewall settings:

# Check if the dev server is running on the remote machine
curl http://localhost:3000

# Verify SSH port forwarding is active
ss -tlnp | grep 3000

# Check remote firewall settings
sudo ufw status
sudo ufw allow 3000/tcp

Permission Denied Errors

File permission issues are common when multiple users or Docker volumes are involved:

# Fix ownership of project files
sudo chown -R developer:developer ~/projects/my-project

# Fix permissions
find ~/projects/my-project -type d -exec chmod 755 {} \;
find ~/projects/my-project -type f -exec chmod 644 {} \;

# For Docker volume permissions
sudo chown -R 1000:1000 ./my-project

Advanced Configuration

Custom JVM Options for the Backend

Tune the IDE backend's JVM for better performance on large projects. Create or edit the VM options file on the remote server:

# ~/.cache/JetBrains/WebStorm/remote-dev/webstorm.vmoptions

# Increase maximum heap size for large projects
-Xmx4096m

# Use the G1 garbage collector
-XX:+UseG1GC

# Reduce GC pause times
-XX:MaxGCPauseMillis=200

# Enable string deduplication
-XX:+UseStringDeduplication

# Reserve code cache
-XX:ReservedCodeCacheSize=512m

Sharing IDE Backends Across Projects

If you work on multiple projects on the same server, you can reuse a single IDE backend installation. Each project gets its own session but shares the downloaded IDE binaries and caches where appropriate:

# Connect to the same server but select different project directories
# Gateway reuses the installed backend

# To manage multiple backends, list installed versions
ls -la ~/.cache/JetBrains/WebStorm/remote-dev/

# Clean up old versions to save disk space
rm -rf ~/.cache/JetBrains/WebStorm/remote-dev/ws-231.*

Using Environment Variables

Set up environment variables on the remote server for your development workflow:

# ~/.bashrc or ~/.profile on the remote server

# Database configuration
export DB_HOST=localhost
export DB_PORT=5432
export DB_NAME=dev_database
export DB_USER=developer
export DB_PASSWORD=secure_password

# API keys
export STRIPE_API_KEY=sk_test_your_key
export SENDGRID_API_KEY=your_api_key

# Application settings
export NODE_ENV=development
export LOG_LEVEL=debug
export PORT=3000

# Load project-specific variables
if [ -f ~/projects/my-project/.env ]; then
    set -a
    source ~/projects/my-project/.env
    set +a
fi

Security Considerations

When working with remote development, security is paramount. Follow these practices to keep your environment secure:

Here is a basic server hardening script:

#!/bin/bash
# harden-server.sh

# Disable root login
sudo sed -i 's/PermitRootLogin yes/PermitRootLogin no/' /etc/ssh/sshd_config

# Disable password authentication
sudo sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config

# Restart SSH service
sudo systemctl restart sshd

# Install and configure fail2ban
sudo apt install -y fail2ban
sudo systemctl enable fail2ban
sudo systemctl start fail2ban

# Configure UFW firewall
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow 22/tcp
sudo ufw allow 3000/tcp
sudo ufw enable

echo "Server hardening complete!"

Conclusion

WebStorm Remote Development transforms how you interact with your codebase by separating the IDE interface from the processing engine. Whether you are working with resource-intensive monorepos, developing in Docker containers, or collaborating across distributed teams, the remote development architecture provides flexibility, consistency, and performance that local-only setups cannot match. By following the setup methods, configuration steps, and best practices outlined in this guide, you can establish a robust remote development workflow that scales with your team's needs. Start with a simple SSH connection, optimize your server resources, and gradually incorporate advanced configurations like custom JVM tuning, automated provisioning, and containerized run targets as your requirements grow. The investment in setting up a proper remote development environment pays dividends in productivity, security, and developer satisfaction.

— Ad —

Google AdSense will appear here after approval

← Back to all articles