Tutorial browser use ui , without docker

Here is a step-by-step tutorial to set up the Python environment web-ui2 in /media/backup_006_3/workspace.01.main/ and run the webui.py script locally (Option 1):


1. Create the Python Environment

  1. Navigate to the Target Directory:

     cd /media/backup_006_3/workspace.01.main/
    
  2. Create a Virtual Environment Named web-ui2:

     python3 -m venv web-ui2
    
  3. Activate the Virtual Environment:

     source web-ui2/bin/activate
    

2. Install Dependencies

  1. Navigate to the web-ui Directory:

     cd /media/backup_006_3/workspace.01.main/web-ui/
    
  2. Install Required Packages:

     pip install -r requirements.txt
    
  3. Install Playwright:

     playwright install
    

3. Set Up the Environment Variables

  1. Copy the .env.example File:

     cp .env.example .env
    
  2. Edit the .env File: Use a text editor to update the .env file with your API keys:

     nano .env
    

    Example content for .env:

     OPENAI_API_KEY=your_openai_api_key
     ANTHROPIC_API_KEY=your_anthropic_api_key
     GOOGLE_API_KEY=your_google_api_key
    

4. Clone and Run the WebUI

  1.  git clone https://github.com/browser-use/web-ui.git
     cd web-ui
    
  2. Run the Script with the Desired IP and Port:

     python webui.py --ip 127.0.0.1 --port 7788
    
  3. Access the WebUI: Open your browser and navigate to:

     http://127.0.0.1:7788
    

Additional Options

  • Dark Mode: Add the --dark-mode flag to enable dark mode:

      python webui.py --ip 127.0.0.1 --port 7788 --dark-mode
    
  • Customize Theme: Specify a theme using --theme. Available themes include Ocean, Soft, Monochrome, Glass, Origin, Citrus:

      python webui.py --ip 127.0.0.1 --port 7788 --theme Glass
    

Troubleshooting

  • Python Not Found:
    Ensure Python 3.11+ is installed:

      sudo apt update
      sudo apt install python3 python3-venv python3-pip
    
  • Permission Issues:
    Ensure proper permissions for the webui.py file:

      chmod +x webui.py
    
  • Dependencies Not Found:
    Re-run:

      pip install -r requirements.txt
    

This should successfully set up and run the WebUI locally.