Antigravity IDE in a Docker Container with GUI and Audio Forwarding for WSL2 (and Linux if you want) for people who are just as paranoid as me about running some proprietary AI IDE on their host machine because you have a lot of sensitive credentials and data in your local environment which you don't want to risk exposing no matter what, while also enjoying a hands-off experience of automated agents and loops that run in parallel and assist with boring work.
Containerized Antigravity IDE — with GUI, audio, and seamless filesystem integration.
Works out of the box on WSL2 (default) and Linux hosts.
Note
Although the project sandboxes Antigravity IDE, it does not sandbox the agentic hub, or any other related components outside of IDE. It is intended for users who want to run the IDE in a containerized environment.
This project builds a Docker image that runs the full Antigravity IDE desktop application inside a container, forwarding display (X11 / Wayland) and audio (PulseAudio) to the host. It is primarily designed for WSL2 on Windows using WSLg, but can be trivially adapted for any Linux distribution.
- Overview
- Credits & Attribution
- Why ever to use Antigravity IDE or Gemini of all things?
- Prerequisites
- Usage
- OAuth / Sign-In
- Platform Guides
- Customization Guide
- File Reference
- License
| Component | Detail |
|---|---|
| Base OS | Ubuntu (latest LTS) |
| Antigravity IDE | Latest release fetched automatically from antigravity-nix |
| Browser | Google Chrome (stable) |
| Developer Tools | neovim, git, jq, ripgrep, htop, curl, gpg |
| User | Non‑root antigravity user with passwordless sudo |
| Shared Memory | 4 GB (--shm-size=4g) |
This project would not exist without the work of others:
- jacopone / antigravity-nix — provides the automated version-tracking and download mechanism for Antigravity
IDE releases. The
Dockerfilerelies onversions.jsonfrom this repository to always fetch the latest IDE build. This project would've taken long enough I'd just move to OpenCode instead if it weren't for this handy tool. - Antigravity IDE — the original editor. All copyright and trademarks belong to its respective owners / Google / the Antigravity IDE team. This project is not affiliated with or endorsed by the Antigravity IDE developers. It is a simple sandboxing recipe for the IDE, and IDE alone. The agentic hub is not included.
- The Docker build recipe and wrapper scripts in this repository are a thin infrastructure layer on top of the above projects.
So far Antigravity IDE is the only thing which provides a seamless experience of running a Chrome browser + DevTools MCP feedback loop with pretty much zero configuration outside of clicking buttons to install the MCP extension itself. Add to that it supports using both Anthropic models for general correctness and Gemini for visual or quick tasks and chores, and the experience is decent enough to make use of a Google AI Pro plan to get some actual work done, while also enjoying the benefits it brings in terms of Google Drive, general Gemini Search / Deep Research / Nano Banana and other related promotional offers. Provided you are ok with extensions sometimes not working.
Goal here is for max convenience and minimal time spent, while also keeping a sandbox, bind mounting on host, and not having to install anything on the host machine. The container is a self-contained environment that can be easily rebuilt or updated without affecting the host system. If you have any ideas for improvements, feel free to open an issue or a pull request. I'll be more than happy to review and debate them.
It is not the goal here to find the most cracked way of using AI or Antigravity for that matter.
- Windows 11 (recommended) or Windows 10 build 22000+
- Docker Desktop with the WSL2 backend enabled
- WSLg — pre-installed on recent Windows 11 builds; provides X11/Wayland/PulseAudio out of the box
- Ensure your WSL distribution has
systemdenabled
- A Linux distribution with:
- Docker (or Podman with Docker compatibility)
- An X11 or Wayland display server
- PulseAudio (for audio forwarding, optional)
./BUILD.shThis cleans up any existing antigravity-docker container and builds a fresh image.
Under the hood
docker rm -f antigravity-docker
docker build -f Antigravity.Dockerfile -t antigravity-docker ../AGI.shBy default this starts the container with sleep infinity, keeping it alive for you to attach to. Uncomment the antigravity-ide --wait --verbose command at the end of AGI.sh to launch the IDE directly.
Antigravity IDE uses OAuth via Google. There are two ways to handle this inside the container.
Open Google Chrome inside the container and sign into your Google account there. Then launch Antigravity IDE and authenticate normally. Everything stays inside the container.
This method keeps your Google credentials entirely on the host machine's / some other machine's browser.
- Launch Antigravity IDE in the container. It will open an OAuth page in Chrome.
- Copy the URL from Chrome's address bar in the container.
- Open that URL in your host machine's browser (where you're already logged into Google).
- Type anything in the prompted input field and press Enter. An error will appear saying something went wrong and you need to restart/reload the process. Do so.
- Now sign in normally via Google. The OAuth flow will redirect to
localhost:<some-random-port>/.... - Copy that
localhost:<some-random-port>URL (complete url with everything) and paste it into Chrome inside the container, then press Enter. - Wait a moment. The IDE should activate.
Note: Chrome inside the container is convenient for this because you can also run Chrome DevTools MCP alongside it, making development much easier. If you choose not to use Chrome, the redirect URL can still be found in the IDE's debug logs, but it's far less convenient to dig out.
AGI.sh is pre-configured for WSL2 with WSLg. Mount paths use the /mnt/c/... WSL convention:
| Variable | Default | Purpose |
|---|---|---|
WS_DIR |
/mnt/c/Users/Zero/Codeworks/Antigravity |
Your project workspace → mounted at /workspace |
CNF_DIR |
/mnt/c/Users/Zero/Codeworks/Antigravity-Config |
IDE configuration → mounted at /root/.antigravity |
- User UID — the container user is created with
UID=1002. If your WSL user has a different UID, changeUSER_UIDinAntigravity.Dockerfile(and match it inXDG_RUNTIME_DIRinAGI.sh). - XDG_RUNTIME_DIR — verify your actual runtime directory path:
ls /run/user/inside WSL. Update/run/user/1002if different. - Mount paths — update
WS_DIRandCNF_DIRto point to your workspace and config directories.
To run on a native Linux host, create a runner script (e.g. AGI-linux.sh):
#!/usr/bin/env bash
CNF_DIR="$HOME/.config/antigravity"
WS_DIR="$HOME/Projects/MyAntigravityProject"
docker rm -f antigravity-docker
docker run \
--security-opt seccomp=unconfined \
--cap-add=SYS_ADMIN \
--network host \
-e DISPLAY="$DISPLAY" \
-e WAYLAND_DISPLAY="$WAYLAND_DISPLAY" \
-e XDG_RUNTIME_DIR="$XDG_RUNTIME_DIR" \
-e PULSE_SERVER="$PULSE_SERVER" \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v "$XDG_RUNTIME_DIR:$XDG_RUNTIME_DIR" \
-v "$WS_DIR:/workspace" \
-v "$CNF_DIR:/root/.antigravity" \
--shm-size=4g \
--name antigravity-docker \
antigravity-dockerKey differences from WSL2:
- Use
--network hostinstead of forwarding individual sockets (simpler on Linux) - No
/mnt/wslgbind mount - No
/mnt/c/...paths; use native$HOMEpaths XDG_RUNTIME_DIRis typically/run/user/$(id -u)
If your host user's UID is not 1002, edit the build args in Antigravity.Dockerfile:
ARG USER_UID=1000
ARG USER_GID=$USER_UIDThen also update the runtime XDG_RUNTIME_DIR in AGI.sh.
Extend the apt install line in Antigravity.Dockerfile:
apt install -y neovim curl gpg git htop jq ripgrep sudo <your-packages-here>... Edit the variables at the top of AGI.sh:
WS_DIR='/mnt/c/Users/YOU/Codeworks/YourProject'
CNF_DIR='/mnt/c/Users/YOU/Codeworks/YourConfig'Currently the image always fetches the latest version via the antigravity-nix versions.json. To pin a version, replace the RUN step in Antigravity.Dockerfile with a direct download URL for a .tar.gz release.
Remove the Chrome installation lines in Antigravity.Dockerfile:
# curl -o /root/chrome.deb ...
# apt install -y /root/chrome.deb
# rm /root/chrome.deb| File | Purpose |
|---|---|
Antigravity.Dockerfile |
Docker image definition — installs Ubuntu, Antigravity IDE, Chrome, and dev tools |
BUILD.sh |
Build script — removes old container and builds a fresh image |
AGI.sh |
WSL2 run script — starts the container with GUI/audio forwarding |
.gitignore |
Ignores IDE and OS metadata files |
Antigravity IDE is a proprietary / third-party editor. All rights, copyright, and trademarks belong to its original authors. This project is not affiliated with or endorsed by the Antigravity IDE developers. The IDE is fetched from its official distribution channels and is subject to its own license terms.
The Dockerfile, shell scripts, and documentation in this repository — i.e., the build recipe — are provided under the terms of the MIT License. It is in no way a license for the Antigravity IDE itself, or affiliated with its authors in any way.
MIT License
Copyright (c) 2026 L0RD-ZER0
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
A copy of this license is included in the repository at LICENSE.md.
In short: Use the build recipe freely — build it, modify it, share it. The Antigravity IDE binary itself carries its own license; refer to the official website for its terms.