The Good Side of Electron

A few weeks ago I found a laptop thrown out on the street. In fact there were two, though one was so old I still haven’t figured out what to do with it. I took them both in, and a few days ago decided to get rid of a Contabo server I used to run YunoHost on, and use this laptop as a personal server instead.

I’ve had many old laptops serving as servers before. When I was a teenager, the reason it usually didn’t work well was because the IP at home kept changing and something about the dynamic DNS script failed, or the router was switched and port forwarding wasn’t working anymore, or who knows what. One way or another, they failed their main task: to always be available. I think this has become much easier over the last few years, with Tailscale and Cloudflare Tunnels. I don’t need to worry about my IP changing or about port forwarding — I just access things through my-server-hostname.

YunoHost was unfortunately way too buggy over the years I ran it on my server. Apps that were installed through it broke and were hard to configure, and things I tried to do with the server that weren’t part of YunoHost were also a pain. I always thought NixOS could be great on a server due to its declarative nature (it’s hard to accumulate junk and lose track of things, which often happens when a computer isn’t my main one), so I went with it.

NixOS and AI are a pretty great combo. Just ask: “I want a server with X, Y, accessible through foo.example.com and bar.example.com”, review the configuration, and run nixos-rebuild switch. It took just a few hours to migrate ~6 different services from my old server (including their data), set up all the networking, and create a little API to report server health metrics to Home Assistant.

But there was one thing I wanted to add to this server that the previous one didn’t have: I wanted to have an AI agent web interface so that I have one always available, can continue conversations remotely even when my computer is off, and have the context I use often (mainly: how to search Swedish second-hand markets, and how to communicate with my Home Assistant instance).

My family already has a Google One subscription that includes some AI usage, so I thought I might as well use that. The problem was that all the ways to connect OpenCode or Pi or whatever with my Google auth come with a warning about getting my Google account blocked. It seemed like I had to use the official Google app(s). It’s quite a mess: Antigravity 2.0, Antigravity IDE, Antigravity CLI and some SDK. I checked out Antigravity 2.0 and it seemed like a usable UI, and it didn’t take much to notice it was an Electron app.

An Electron app is basically a web app with some backend, which is pretty much exactly what I need. The server will run the backend, and I just need to find a way to expose the web interface to the internet. But where is the web interface?

$ lsof -i -P -n | grep -i antig
antigravi 1615162 bjesus  60u  IPv4 5463466      0t0  TCP 127.0.0.1:40929 (LISTEN)
antigravi 1615162 bjesus  69u  IPv4 5466739      0t0  TCP 127.0.0.1:40929->127.0.0.1:35724 (ESTABLISHED)

I just tried out these ports, and 35724 was indeed it. Not only was the web interface fully responsive, it even worked (better?) on Firefox.

From there the route was quite simple. I ended up with a little Python bridge that checks for the open port and proxies it, and if there’s none it starts Antigravity. Caddy proxies the bridge, a Cloudflare Tunnel puts it online, and Cloudflare Access makes sure only I can log in.

I’m always a little disappointed when Electron is the only way to use an app, but this time it was actually great. An Electron app is essentially a web interface and an HTTP API, and knowing you can break them into two separate pieces can be super useful.

- August 15, 2026