# Eclipse Theia Cloud IDE

> Cloud IDE with Eclipse Theia supporting multiple languages and plugins.

- Category: Development Tools
- Difficulty: intermediate
- Components: theia, node, go, rust, postgresql
- Tags: theia, ide, cloud, vscode, eclipse
- Source: https://docker.recipes/development/theia-ide-complete

## Overview

Eclipse Theia is a modern, web-based IDE framework that brings VS Code-like functionality to the browser while maintaining extensibility through the Language Server Protocol and VS Code extension ecosystem. Built on TypeScript and running on Node.js, Theia offers a truly cloud-native development environment that supports multiple programming languages including Go, Rust, Python, and JavaScript out of the box. Unlike traditional desktop IDEs, Theia enables teams to standardize development environments across different machines and operating systems while providing the familiar interface developers expect from modern code editors.

This stack combines Theia with PostgreSQL for relational data storage, MongoDB for document-based development projects, and Redis for caching and session management. The configuration creates a complete cloud development workspace where developers can build full-stack applications with immediate access to multiple database technologies. Adminer provides a web-based database administration interface, eliminating the need to install separate database clients or configure complex connection tunnels.

Development teams working on polyglot applications, remote development scenarios, or those requiring consistent development environments across team members will find this stack particularly valuable. The combination is ideal for organizations transitioning to cloud-native development practices, educational institutions providing standardized coding environments, or companies building applications that require both relational and NoSQL data storage patterns.

## Features

- VS Code extension compatibility with full Language Server Protocol support for Go, Rust, TypeScript, and Python
- Web-based terminal with Node.js, npm, and development tools pre-installed in the Theia container
- PostgreSQL 15 with JSONB support for hybrid relational-document data models in development projects
- MongoDB 6.0 with automatic replica set initialization for testing distributed database scenarios
- Redis 7 integration for caching layer development and session storage testing
- Adminer web interface supporting both PostgreSQL and MongoDB connections through a single interface
- Git integration with environment variable configuration for automatic commit attribution
- Workspace persistence allowing projects to survive container restarts and updates

## Use cases

- Full-stack web application development requiring both PostgreSQL and MongoDB data storage
- Remote development teams needing consistent Node.js and database environments
- Code bootcamps and educational institutions providing browser-based development environments
- API development and testing with immediate database access for backend services
- Microservices development where different services use different database technologies
- Rapid prototyping of applications requiring Redis caching with persistent data storage
- Organizations implementing Infrastructure as Code for development environment standardization

## Prerequisites

- Docker Engine 20.10+ and Docker Compose v2 for container orchestration
- Minimum 4GB RAM available for containers (Theia: 1GB, PostgreSQL: 512MB, MongoDB: 1GB, Redis: 256MB)
- Ports 3000, 5432, 6379, 8080, and 27017 available on the host system
- Basic familiarity with VS Code interface and extensions for optimal Theia usage
- Understanding of environment variables for Git configuration (GIT_USER, GIT_EMAIL, POSTGRES_PASSWORD)
- Local workspace directory structure for persistent file storage between container sessions

## docker-compose.yml

```yaml
services:
  theia:
    image: theiaide/theia-full:latest
    ports:
      - "3000:3000"
    volumes:
      - ./workspace:/home/project
      - theia_data:/home/theia
    environment:
      - GITPOD_GIT_USER_NAME=${GIT_USER}
      - GITPOD_GIT_USER_EMAIL=${GIT_EMAIL}
    networks:
      - theia_net

  postgres:
    image: postgres:15-alpine
    environment:
      - POSTGRES_USER=dev
      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
      - POSTGRES_DB=devdb
    volumes:
      - postgres_data:/var/lib/postgresql/data
    ports:
      - "5432:5432"
    networks:
      - theia_net

  redis:
    image: redis:7-alpine
    ports:
      - "6379:6379"
    volumes:
      - redis_data:/data
    networks:
      - theia_net

  mongodb:
    image: mongo:6
    ports:
      - "27017:27017"
    volumes:
      - mongo_data:/data/db
    networks:
      - theia_net

  adminer:
    image: adminer:latest
    ports:
      - "8080:8080"
    networks:
      - theia_net

volumes:
  theia_data:
  postgres_data:
  redis_data:
  mongo_data:

networks:
  theia_net:
```

## .env

```bash
# Theia IDE
POSTGRES_PASSWORD=secure_postgres_password
GIT_USER=Your Name
GIT_EMAIL=your@email.com

# Theia at http://localhost:3000
# Adminer at http://localhost:8080
```

## Usage notes

- Theia IDE at http://localhost:3000
- Full VS Code extensions support
- Multiple language support built-in
- Connect to databases for development
- Git configured automatically

## Troubleshooting

- Theia shows 'Cannot connect to workspace': Ensure ./workspace directory exists and has proper permissions (chmod 755)
- VS Code extensions fail to install in Theia: Check container memory limits and increase Docker Desktop memory allocation to 6GB+
- PostgreSQL connection refused from Adminer: Use service name 'postgres' instead of 'localhost' when connecting through Adminer
- MongoDB authentication errors: MongoDB container runs without authentication by default - connect using only hostname 'mongodb' and port 27017
- Git commits show 'unknown author': Set GIT_USER and GIT_EMAIL environment variables in .env file before starting containers
- Workspace files disappear after restart: Verify volume mount ./workspace:/home/project is correctly mapped to an existing local directory

