> ## Documentation Index
> Fetch the complete documentation index at: https://support.labex.io/llms.txt
> Use this file to discover all available pages before exploring further.

# LabEx VM WebIDE Interface

> The LabEx WebIDE provides a modern, VS Code-like development environment for coding tasks. Built on Ubuntu 22.04, it offers a familiar interface for writing, compiling, and running code across multiple programming languages.

## WebIDE Preview

<img src="https://mintcdn.com/huhuhang/q4ekfuwM7mDVAiiH/images/webide.png?fit=max&auto=format&n=q4ekfuwM7mDVAiiH&q=85&s=da64f20fc4317410e337993b75c16904" alt="WebIDE Preview" width="960" height="640" data-path="images/webide.png" />

The WebIDE environment is particularly useful for:

1. Writing and debugging code in various programming languages (Java, JavaScript, Python, etc.)
2. Web development projects with live preview capabilities, see [Create Your First HTML Page in WebIDE
   ](https://labex.io/tutorials/html-create-your-first-html-page-in-webide-451041)
3. Managing project files and directories through an intuitive interface
4. Integrated terminal operations for command-line tasks

## Environment Layout

The WebIDE interface consists of several key components:

1. Left Sidebar:
   * File explorer for project navigation
   * Search functionality
   * Source control for Git operations
   * Extensions panel
2. Editor Area: Main coding workspace
3. Bottom Panel: Terminal, problems, and output
4. Status Bar: Quick access to settings and live preview
5. Top Menu Bar: File, Edit, View, and other options

## Terminal Access

You can open the terminal in two ways:

1. Click the <i className="fa-regular fa-circle-xmark" /> icon in the left bottom corner, and switch to the Terminal tab;
   <img src="https://mintcdn.com/huhuhang/q4ekfuwM7mDVAiiH/images/screenshot-20241022-fOGlaC78@2x.png?fit=max&auto=format&n=q4ekfuwM7mDVAiiH&q=85&s=d39064241ec13475b8a5f07b9b5b6c0e" alt="Terminal Access" width="1860" height="806" data-path="images/screenshot-20241022-fOGlaC78@2x.png" />
2. Use the top menu: Terminal > New Terminal
   <img src="https://mintcdn.com/huhuhang/q4ekfuwM7mDVAiiH/images/screenshot-20241022-wyYSNaTb@2x.png?fit=max&auto=format&n=q4ekfuwM7mDVAiiH&q=85&s=891ad0b51501dc8941fe3c726f853a92" alt="Terminal Access" width="1204" height="584" data-path="images/screenshot-20241022-wyYSNaTb@2x.png" />

## Preview HTML

To preview your HTML file:

1. In the WebIDE, click on the "Go Live" button at the bottom right corner.
   <img src="https://mintcdn.com/huhuhang/lbTGZZG7azHYkwfT/images/461shots_so.png?fit=max&auto=format&n=lbTGZZG7azHYkwfT&q=85&s=d5a94c83ffb5faa003192de94eaed9c8" alt="Go Live button in WebIDE" width="1920" height="1080" data-path="images/461shots_so.png" />
2. A new browser tab will open with your HTML page rendered.
   <img src="https://mintcdn.com/huhuhang/lbTGZZG7azHYkwfT/images/429shots_so.png?fit=max&auto=format&n=lbTGZZG7azHYkwfT&q=85&s=e49e551fb117a34bfb487062a3310348" alt="HTML page rendered in browser tab" width="1920" height="1080" data-path="images/429shots_so.png" />
3. Or, you can click on the "Web 8080" tab to open the preview.
   <img src="https://mintcdn.com/huhuhang/lbTGZZG7azHYkwfT/images/236shots_so.png?fit=max&auto=format&n=lbTGZZG7azHYkwfT&q=85&s=86e55e8dcc899fedd7bd3d130ce392b3" alt="WebIDE Web 8080 tab preview" width="1920" height="1080" data-path="images/236shots_so.png" />
4. If your project under a subdirectory, you can access it by click the subdirectory name in the explorer, then it will automatically preview the `index.html` file in that directory.
   <img src="https://mintcdn.com/huhuhang/lbTGZZG7azHYkwfT/images/20250110-11-19-17-1N4fwHBz.png?fit=max&auto=format&n=lbTGZZG7azHYkwfT&q=85&s=ef3a2f7bbd795218b50d9b95086b1ed4" alt="WebIDE subdirectory preview" width="425" height="169" data-path="images/20250110-11-19-17-1N4fwHBz.png" />
5. If your project has multiple HTML files, including `index.html`, you can append the file name to the URL to preview it directly. For example, `https://xxx.labex.io/another-file.html`.
   <img src="https://mintcdn.com/huhuhang/lbTGZZG7azHYkwfT/images/20250113-09-42-31-4EbLwccE.png?fit=max&auto=format&n=lbTGZZG7azHYkwfT&q=85&s=07166edb93053840f14d3f73923e2d0e" alt="WebIDE multiple HTML files preview" width="851" height="311" data-path="images/20250113-09-42-31-4EbLwccE.png" />
6. You can open the preview in a new tab by clicking the "Open in New Tab" button. It will open the preview in a new browser tab.
   <img src="https://mintcdn.com/huhuhang/lbTGZZG7azHYkwfT/images/20250113-09-48-45-BnqYObPj.png?fit=max&auto=format&n=lbTGZZG7azHYkwfT&q=85&s=7ba9545421a5bd671ec47a8989342134" alt="WebIDE Open in New Tab" width="872" height="191" data-path="images/20250113-09-48-45-BnqYObPj.png" />

"Go Live" will automatically:

* Start a web server
* Provide real-time updates as you modify your code

> Tips: LabEx VM hosts the preview on port 8080. You can share the preview link with others to showcase your work. After your lab vm is stopped, the preview link will no longer work.

## Usage Scenarios

<AccordionGroup>
  <Accordion title="Java Development Sample" icon="coffee">
    <Card title="Your First Java Lab" icon="flask-conical" href="https://labex.io/labs/java-your-first-java-lab-411751">
      This is a sample Java lab that demonstrates how to write, compile, and run a
      simple Java program using the LabEx WebIDE.
    </Card>

    Working with Java projects in WebIDE:

    <img src="https://mintcdn.com/huhuhang/lbTGZZG7azHYkwfT/images/20241016-13-50-50-DprQuVyZ.png?fit=max&auto=format&n=lbTGZZG7azHYkwfT&q=85&s=188bffef44632334239fd25e7710a872" alt="Java Development" width="1203" height="696" data-path="images/20241016-13-50-50-DprQuVyZ.png" />

    1. Create a new Java file via the explorer
    2. Write your Java code with syntax highlighting
    3. Compile and run in the terminal:

    ```bash theme={null}
    javac MyClass.java
    java MyClass
    ```

    4. View compilation errors and warnings in real-time
  </Accordion>

  <Accordion title="Web Development Sample" icon="globe">
    <Card title="Your First HTML Lab" icon="flask-conical" href="https://labex.io/labs/html-your-first-html-lab-92740">
      This is a sample HTML lab that demonstrates how to create a simple web page
      using the LabEx WebIDE.
    </Card>

    For frontend development tasks:

    <img src="https://mintcdn.com/huhuhang/lbTGZZG7azHYkwfT/images/20240725-14-54-07-RbKQNn37@2x.png?fit=max&auto=format&n=lbTGZZG7azHYkwfT&q=85&s=d86a1ee42ec3fc28320706c8e2af29ad" alt="Go Live Button" width="2402" height="2020" data-path="images/20240725-14-54-07-RbKQNn37@2x.png" />

    1. Create HTML, CSS, and JavaScript files
    2. Click the "Go Live" button in the bottom right corner
    3. Access your web page through:
       * Web 8080 tab at the top of the LabEx VM
       * Create new port preview tabs using the + button

    Note: Your project is automatically deployed to a public URL on the LabEx server, making it accessible through the Web tabs.
  </Accordion>

  <Accordion title="Python Development Sample" icon="code">
    <Card title="Create an Astronaut Name Tag Processor" icon="flask-conical" href="https://labex.io/labs/python-create-an-astronaut-name-tag-processor-393083">
      This is a sample Python challenge that demonstrates how to process astronaut
      names using the LabEx WebIDE.
    </Card>

    For Python programming:

    <img src="https://mintcdn.com/huhuhang/lbTGZZG7azHYkwfT/images/20241008-16-18-06-HuMxDYQy.png?fit=max&auto=format&n=lbTGZZG7azHYkwfT&q=85&s=d88a4be0db03de93afc0ea7c2a0962bc" alt="Python Development" width="946" height="641" data-path="images/20241008-16-18-06-HuMxDYQy.png" />

    1. Create a Python file in the explorer
    2. Write your Python code with:
       * Syntax highlighting
       * Code completion
       * Error detection
    3. Run your script in the terminal:

    ```bash theme={null}
    python3 script.py
    ```

    4. Use the integrated debugger for step-by-step execution
  </Accordion>
</AccordionGroup>

## Frequently Asked Questions

<AccordionGroup>
  <Accordion title="How do I access my web application?" icon="globe">
    LabEx VM automatically deploys your web projects:

    <img src="https://mintcdn.com/huhuhang/q4ekfuwM7mDVAiiH/images/screenshot-20241022-Sgt0GGyu@2x.png?fit=max&auto=format&n=q4ekfuwM7mDVAiiH&q=85&s=79d82dcc58719cf5b4b19530b488fcbe" alt="Web Preview" width="1287" height="379" data-path="images/screenshot-20241022-Sgt0GGyu@2x.png" />

    1. Default port 8080:
       * Click the "Web 8080" tab at the top of the LabEx VM
       * Your application will be accessible through a public URL

    2. Custom ports:
       * Click the + button to create new port preview tabs
       * Each port gets its own public URL
       * Useful for running multiple services (e.g., frontend and backend)

    Note: Unlike local development, you don't access localhost directly as LabEx runs in the cloud.
  </Accordion>

  <Accordion title="What are the essential keyboard shortcuts?" icon="keyboard">
    Common shortcuts in the WebIDE:

    * **File Operations**
      * New File: Ctrl+N
      * Save: Ctrl+S
      * Find: Ctrl+F
      * Replace: Ctrl+H

    * **Panel Controls**
      * Toggle Sidebar: Ctrl+B
      * Toggle Terminal: Ctrl+\`
      * Command Palette: Ctrl+Shift+P

    * **Editor Features**
      * Multi-cursor: Alt+Click
      * Select All Occurrences: Ctrl+Shift+L
      * Format Document: Shift+Alt+F
  </Accordion>

  <Accordion title="Can I install additional tools or packages?" icon="wrench">
    Yes, you can install additional tools using the Ubuntu package manager:

    ```bash theme={null}
    sudo apt update
    sudo apt install package-name
    ```

    For language-specific package managers:

    * Node.js/npm:

    ```bash theme={null}
    npm install package-name
    ```

    * Python/pip:

    ```bash theme={null}
    pip install package-name
    ```

    Remember that installations are temporary and will be reset when your session ends.
  </Accordion>

  <Accordion title="How do I handle file uploads and downloads?" icon="upload">
    The WebIDE provides several ways to manage files:

    1. **Upload Files:**

       * Drag and drop files into the explorer
       * Use the upload/download after right-clicking in the explorer

           <img src="https://mintcdn.com/huhuhang/q4ekfuwM7mDVAiiH/images/screenshot-20241022-j7Pl3YZQ@2x.png?fit=max&auto=format&n=q4ekfuwM7mDVAiiH&q=85&s=ab2b59536671cb0184c1f57d3a981fec" alt="Upload Files" width="1412" height="1250" data-path="images/screenshot-20241022-j7Pl3YZQ@2x.png" />

    2. **Download Files:**
       * Right-click the file in explorer
       * Select "Download"

    3. **Copy/Paste:**
       * Text content can be copied directly between your local machine and the WebIDE
       * Binary files should use the upload/download features

    Remember that all files are temporary and will be lost when your session ends.
  </Accordion>
</AccordionGroup>
