Skip to content

Repository files navigation

Remote Chrome in the Cloud

Spin up a persistent, full-featured Chrome instance in the cloud (Docker/Kasm) and access it securely via an SSH tunnel.

This repository provides a "one-file" configuration to deploy a remote Chrome desktop environment on a cheap cloud VPS (like Hetzner, DigitalOcean, or AWS). It uses cloud-init to automatically set up Docker, Kasm, and security rules.

Features

  • Full Chrome Experience: Runs with --shm-size=2g and --security-opt seccomp=unconfined to support all modern websites and extensions without sandbox errors.
  • Persistent Sessions: Your tabs, logins, and extensions (like LinkedIn Gateway) are saved even if you disconnect or restart the server.
  • Secure Access: The Chrome interface is bound to 127.0.0.1 on the server. You connect via an encrypted SSH tunnel. No open ports are exposed to the public internet except SSH.
  • Automated Setup: Just paste the cloud-config.yaml content when creating your server.

Prerequisite

  • A Cloud VPS Provider (e.g., Hetzner Cloud).
  • OS: Ubuntu 22.04 or 24.04 LTS.
  • Resources: Recommended 2 vCPU / 4 GB RAM (e.g., Hetzner CX22).

Quick Start Guide

1. Deploy the Server

  1. Open cloud-config.yaml in this repository.
  2. Edit Passwords:
    • Replace CHANGE_ME_PASSWORD with a strong password for the Kasm web login.
    • Replace CHANGE_ME_SSH_PASSWORD with a strong password for the SSH user.
  3. Copy the Content.
  4. Create Server:
    • Go to your cloud provider's console (e.g., Hetzner).
    • Select Ubuntu as the image.
    • Paste the content into the User Data / Cloud Config section.
    • Launch the server.
  5. Wait: It takes about 2-3 minutes for the server to install Docker and pull the Chrome image.

2. Connect (Windows)

We provide a remote_chrome.bat script for one-click connection.

  1. Download remote_chrome.bat.
  2. Edit the Script:
    • Right-click -> Edit.
    • Change set "SERVER_IP=YOUR_SERVER_IP" to your actual server IP address.
  3. Run:
    • Double-click remote_chrome.bat.
    • Enter your SSH password (CHANGE_ME_SSH_PASSWORD) when prompted.
    • The script will automatically open your default browser to https://localhost:6901.

3. Connect (Mac / Linux)

We provide a remote_chrome.sh script for one-click connection.

  1. Download remote_chrome.sh.
  2. Make it executable:
    chmod +x remote_chrome.sh
  3. Edit the Script:
    • Open remote_chrome.sh in a text editor.
    • Change SERVER_IP="YOUR_SERVER_IP" to your actual server IP address.
  4. Run:
    ./remote_chrome.sh
    • Enter your SSH password (CHANGE_ME_SSH_PASSWORD) when prompted.
    • The script will automatically open your default browser to https://localhost:6901.

Manual Connection (without script):

Open your terminal and run:

# Replace YOUR_SERVER_IP with your server's IP address
ssh -N -T -L 6901:127.0.0.1:6901 chrome@YOUR_SERVER_IP
  • Password: Enter the CHANGE_ME_SSH_PASSWORD you set in the config.
  • Access: Open your browser to https://localhost:6901.
  • Web Login:
    • User: kasm_user
    • Password: The CHANGE_ME_PASSWORD you set in the config.

Troubleshooting

  • Sandbox / "Aw, Snap!" Errors: This config includes --security-opt seccomp=unconfined which fixes common Chrome crashing issues in Docker environments.
  • "Site can't be reached": Ensure the SSH tunnel is running. The terminal window must remain open.
  • Certificate Warning: You will see a "Not Secure" warning because the server uses a self-signed certificate for HTTPS. This is normal for localhost; click "Advanced" -> "Proceed".

Architecture

  • Container: kasmweb/chrome:1.17.0 running in Docker.
  • Persistence: Data stored in /opt/kasm/data.
  • Network: Port 6901 bound locally. Access via SSH Local Port Forwarding.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages