HUB
Sign inSign up

libzonda/antigravity-server

By libzonda

â€ĸUpdated about 19 hours ago

Self-hosted cloud & mobile server for Google Antigravity with touch UX patches

Image
1

2.5K

libzonda/antigravity-server repository overview

⁠Antigravity Server Docker

GitHub Docker Multi-Arch License

Ready-to-use Docker container for Google Antigravity⁠ based on antigravity-server⁠. It turns Antigravity's standalone binary into a secure, self-hosted cloud and mobile assistant with 100+ runtime UX patches (compatible with Antigravity 2.34–2.35+), remote direct access, and zero relay dependencies.

Supports linux/amd64 and linux/arm64 (Apple Silicon, Raspberry Pi 5, AWS Graviton, Oracle Cloud ARM).


⁠🚀 Quick Start

Save the following as docker-compose.yml:

services:
  antigravity-server:
    # Docker Hub image (or use GHCR: ghcr.io/libzonda/antigravity-server:latest)
    # Pin a specific release tag if preferred, e.g. libzonda/antigravity-server:v0.2.78
    image: libzonda/antigravity-server:latest
    container_name: antigravity-server
    restart: unless-stopped
    ports:
      - "8765:8765"
    environment:
      - AGY_PORT=8765
      - AGY_BIND=0.0.0.0
      - AGY_WORKSPACE_ROOT=/workspace
      # Optional: set access password (auto-generated and printed in logs if omitted)
      - AGY_PASSWORD=YourSecurePassword123!
      # Optional: public HTTPS domain when behind a reverse proxy (e.g. https://agy.example.com)
      - AGY_PUBLIC_URL=
      # Optional: trusted reverse proxy CIDR (e.g. 127.0.0.1/32)
      - AGY_TRUSTED_PROXIES=
      # Optional: user permissions for mounted files (0 for root, or 1000)
      - PUID=0
      - PGID=0
    volumes:
      - ./data:/data
      - ./workspace:/workspace
      - ./gemini:/data/.gemini
      - ./opt-ls:/opt/agy-server
    healthcheck:
      test: ["CMD-SHELL", "curl -fsSL http://127.0.0.1:8765/favicon.ico || exit 1"]
      interval: 30s
      timeout: 5s
      retries: 3
      start_period: 15s

Start the container:

docker compose up -d

Open http://<your-server-ip>:8765 in your browser.


⁠Option 2: Docker Run
docker run -d \
  --name antigravity-server \
  --restart unless-stopped \
  -p 8765:8765 \
  -v $(pwd)/data:/data \
  -v $(pwd)/workspace:/workspace \
  -v $(pwd)/gemini:/data/.gemini \
  -v $(pwd)/opt-ls:/opt/agy-server \
  -e AGY_PASSWORD=YourSecurePassword123! \
  libzonda/antigravity-server:latest

View the generated password (if AGY_PASSWORD was omitted):

docker logs antigravity-server

⁠🌟 Key Features & Why This Image?

FeatureOfficial Bridge (antigravity.google.com)This Docker Image (antigravity-server)
Mobile & Touch UXDesktop web bundle (missing + and ⋮ menus)100+ runtime patches: restored (+) button, agent picker, context window indicator, delete/pin/archive menu, permanent Undo & Copy buttons
iOS Keyboard & ScrollingVisual viewport jitter, safe-area gap, IME text duplicationVisual viewport tracking, safe-area collapsed to 0px, CJK IME composition protection, scroll anchoring
Sidecar, Preview & OAuthLocalhost tools unreachable remotelyOpaque-origin Sidecar UI sandbox (/__agy/sidecar/), localhost preview (/__agy/api/loopback-fetch), and remote OAuth callback relay (/__agy/api/oauth-callback)
Connection PathRelayed through Google serversDirect connection (your domain, VPN, or private LAN)
RPC WebSocket TransportUncompressed large JSON transfers, prone to timeoutRelay termination with context compression (70–85% bandwidth reduction)
Reconnect on RestartCSRF Token invalidation causing 502 crashPersistent CSRF Token & gRPC Status 14 mapping for seamless auto-reconnect
File UploadsStrict 1MB RPC text payload limitChunked streaming uploader for logs, datasets, and large files
Memory ManagementMemory creeps up to 4GB+ on prolonged sessionsDaily idle maintenance restart recycling memory
Access ControlGoogle login requiredSelf-hosted PBKDF2-SHA256 password, session tokens, and IP brute-force limiter

⁠🔑 Google Account Sign-In in Headless Docker

Google's standalone build opens xdg-open for OAuth and redirects to localhost. This container intercepts the flow so you can sign in from any remote browser without SSH tunnels:

  1. Open http://<your-server-ip>:8765 in your browser.
  2. Go to Settings → Account and click Sign In.
  3. It redirects to the built-in sign-in page (/__agy/signin). Click the Google consent link.
  4. Authorize with your Google account. Google will present a one-time verification code.
  5. Paste the code back into the web interface to complete login.

(Alternative): If you already signed in on a desktop machine, simply copy the token into the mounted ./gemini directory:

cp ~/.gemini/jetski-standalone-oauth-token ./gemini/jetski-standalone-oauth-token

⁠📁 Volume Persistence

Host PathContainer PathPurpose
./data/dataWeb login password verifier, sessions, CSRF token, and config
./workspace/workspaceUser project directory where the Agent creates and edits code
./gemini/data/.geminiGoogle OAuth token (jetski-standalone-oauth-token), custom skills & rules
./opt-ls/opt/agy-serverGoogle language_server binary (~200–240MB; persisted to prevent re-downloading)

â âš™ī¸ Environment Variables

VariableDefaultDescription
AGY_PORT8765Server listening port inside the container (keep 8765 for healthcheck; remap host side via ports)
AGY_BIND0.0.0.0Bind IP address
AGY_PASSWORD(Generated)Access password (auto-generated on first boot if omitted)
AGY_PUBLIC_URL(Empty)Public domain URL (e.g. https://agy.example.com)
AGY_WORKSPACE_ROOT/workspaceRoot directory for workspace projects
AGY_TRUSTED_PROXIES(Empty)Trusted proxy CIDRs (e.g. 127.0.0.1/32 behind Nginx/Caddy)
AGY_SESSION_DAYS30Login session lifetime in days
AGY_WS_RELAYonSet to off / 0 / false / no to pass /connect-websocket through uncompressed
AGY_DISABLE_PATCHES(Empty)Comma-separated patch IDs to disable (e.g. websocket-transport-default)
PUID / PGID0 (root)Optional user/group ID to avoid root-owned files on host

⁠🌐 Reverse Proxy Configuration

When hosting behind Nginx or Caddy with HTTPS, ensure buffering is disabled (for real-time token streaming), WebSocket upgrade is enabled, and Host / X-Forwarded-Host headers are preserved:

⁠Nginx
server {
    listen 443 ssl http2;
    server_name agy.example.com;

    client_max_body_size 0;

    location / {
        proxy_pass http://127.0.0.1:8765;
        proxy_http_version 1.1;

        # WebSocket support
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";

        # Disable buffering for real-time streaming
        proxy_buffering off;
        proxy_cache off;
        proxy_read_timeout 86400s;

        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}
⁠Caddy
agy.example.com {
    encode zstd gzip
    reverse_proxy 127.0.0.1:8765 {
        flush_interval -1
    }
}

â â„šī¸ Notes & Limitations

  • Built-in Browser Use: This lightweight container runs language_server headlessly without Electron or Chromium, so Antigravity's built-in WebView browser automation is not included. Localhost dev-server previews in the side panel still work automatically via /__agy/api/loopback-fetch.

Tag summary
Recent tags
Content type
Image
Digest
sha256:788e6fcaeâ€Ļ
Size
65.1 MB
Last updated
about 19 hours ago
docker pull libzonda/antigravity-server:latest