Grok Bot runs around the clock on Ubuntu, recovers after power loss and takes phone input
Overview
The author turned an Ubuntu 24.04 LTS Intel NUC into a 24/7 server, with desktop Grok Bot as a systemd user service, GDM auto-login, update checks every 30 minutes and a BIOS power recovery setting. The phone app controls Grok Build and home-network systems remotely.
Workflow
Trigger: Most AI coding setups assume someone stays at the keyboard to open an IDE, start an agent, watch it, approve and answer. The author instead keeps the computer at home and uses a phone anywhere. Away all afternoon on publication day, the author approved a software update, told an AI build agent to run the next tests and paused it at its usage cap without a laptop or VPN. After the Linux version launched, the author made the desktop app a Linux service that starts on boot, signs in, updates and recovers from crashes. It runs on a small Intel NUC with Ubuntu 24.04 LTS in six parts.
- By hand: Install desktop Grok Bot. Install the Ubuntu package from the official download page and sign in once. On the author's machine it comes from an apt repo, which matters for step 4.
- By hand: Enable GDM auto-login and lock the screen at startup. The desktop app needs a signed-in session, and nobody types a password after reboot. Edit /etc/gdm3/custom.conf for GDM auto-login:
[daemon] AutomaticLoginEnable=true AutomaticLogin=yourusername
Auto-login alone lets anyone at the machine use the desktop after boot. The author's script at ~/bin/lock-if-autologin.sh locks the screen only when auto-login is within 4 minutes of power-on. Put a file in ~/.config/autostart/ pointing to it. The session and Grok Bot keep running after lock:
#!/bin/sh # Lock only after a boot-time auto-login (system up less than 4 minutes) up=$(cut -d. -f1 /proc/uptime) [ "$up" -lt 240 ] || exit 0 sleep 8 loginctl lock-session
- By hand: Run Grok Bot as a systemd user service. The author calls this the core. Create ~/.config/systemd/user/grok-bot.service (the author's reported configuration with a placeholder username):
[Unit] Description=Grok Bot desktop app (always on) PartOf=graphical-session.target After=graphical-session.target StartLimitIntervalSec=300 StartLimitBurst=10
[Service] ExecStart=/usr/bin/grok-bot --password-store=basic Restart=always RestartSec=5
[Install] WantedBy=graphical-session.target
Enable the service and let user services run without an open terminal:
systemctl --user daemon-reload systemctl --user enable --now grok-bot.service sudo loginctl enable-linger $USER
Restart=always brings back a crash or accidental quit in five seconds. The author uses --password-store=basic because auto-login leaves GNOME keyring locked and the app cannot read its saved login. Basic storage reduces protection at rest and is for a physically controlled machine. A timer checks every two minutes for a desktop session. If present it ensures the service runs. Otherwise it starts a headless copy under xvfb-run so the bot remains reachable.
- By hand: Update automatically without interrupting use. Cron runs the author's script every 30 minutes. Refresh only the Grok Bot apt source, compare installed and latest versions, install if newer and use
systemctl --user restart grok-bot.service. Defer while the screen is in use and apply only when locked or headless. flock prevents concurrent copies. A sudoers rule lets apt run without a password, with scope as narrow as possible. The first version restarted from cron and failed on lock because cron lacked the desktop environment. Restarting through systemd fixed it. It updated 5 times in ten days unattended (author's claim, not reproduced). The source gives no updater script or sudoers rule. - By hand: Restore power automatically. Set the BIOS option After Power Failure or Restore on AC Power Loss to Power On. On the author's NUC it is under F2 → Power. After a power outage, power returns, the machine starts, GDM logs in, screen locks, systemd starts Grok Bot and the phone reconnects. The author says it requires no manual step.
- By hand: Connect the phone. Install Grok Bot on iPhone or Android and sign in to the same account. The home machine appears as a computer the bot can use. That finishes client setup.
Check: On publication day the author used only a phone while out to approve an upgrade, run Build tests and pause at its usage cap. The first ten days included 5 unattended updates (author's claim, not reproduced). Recovery after power loss is the author's described sequence, with no dedicated power-loss test in the source.
Key points and results
- Daily work from the phone. In bed the author asks what happened overnight. Grok Bot reads home logs and summarizes. Build runs in screen on the home machine to survive disconnects. The bot sends Build the next instructions, reads output and reports each pass or failure. The author approves the next stage in one message and corrects drift by phone. An actual status question:
Are all the VMs healthy?
Grok Bot checks on the home machine and answers in plain English. The author's laptop is usually closed except for larger-screen tasks.
- Most tasks no longer need Tailscale or VPN in the author's experience. VPN would put the phone on the home network. Grok Bot already runs inside it and issues VM checks or service restarts from there. The phone only talks to Grok Bot, with no ports, mobile VPN client or tailnet to maintain. The source gives no comparison test.
- Route traffic through this computer covers some other VPN uses. It routes the bot browser through the home machine so it can open internal-only pages like router admin or self-hosted dashboards. The author still recommends VPN when the phone itself must join the network, such as streaming from a media server.
- One agent monitors another, with separate allowance pools. In a follow-up the author says Legacy SuperGrok Heavy separates bots from Build. When Grok Bot sees Build at 100%, which happened only a few times in the last day or two before resets including publication day, it stops Build through screen (author's claim, not reproduced). The author says this never loops and finds no need to log into the Build TUI or Cursor UI.
- Five unattended updates in ten days. The author reports 5 in ten days after setup (author's claim, not reproduced). Restarting from cron failed while locked because the desktop environment was missing. systemd solved it.
- Standard system tools handle it. The author uses Ubuntu's systemd, GDM and cron plus a BIOS setting and an AI agent with computer access. That makes an always-available developer reachable by phone. This is the author's claim; the source gives no comparison figures.
- Closing advice: Try this for a week if you still sit at the desk to watch agents. The author plans follow-ups on Build, the homelab and work by phone.
- The update count and Build cap frequency are self-reported without reproduction. The source gives no before-and-after figures.
Contributions from others
Added by others (not the author)
- @ho_bevan (Bevan Ho) first asks whether an unattended box might loop for six hours, and whether to use a hard token cap or watchdog, while crediting power-loss recovery as better than most of the commenter's setups. A follow-up prefers one agent watching another over a cron watchdog because it can see the screen and stop the actual process, and singles out separate usage pools.
- @jul1anodev (Juliano) asks how to limit which local services the bot can access if it can reach router admin or a self-hosted dashboard. No answer by the author in the collected replies.
- @grok says separate pools and stopping Build's screen session at the cap can prevent runaway loops without a person watching, and considers power recovery useful.
Source
- Platform
- X
- Author
- Peyton Lassiter A.K.A. notyep
- Published
- Categories
- Code and repos, Getting started
What this evidence label means
Source read in full
We read the source (post, article or transcript). That only means the original was read. It does not mean this site reproduced the author's results.