how to run Aider or Goose on VPS
Learn how to setup Aider or Goose on your VPS to code from terminal using Ollama models. We cover tmux setup, model sizing, and how to keep work running.
Why run a coding agent on a VPS
Coding agent na tool wey dey read your codebase, write changes, and run commands to test dem, all inside terminal. To run one for VPS get three advantages over your laptop: e go keep working even if you disconnect, e go sit close to your code and your build tools, and e fit talk to model wey you host yourself. Start am inside tmux session so you fit close your laptop and pick the work back up later, na de same pattern as running Claude Code on a VPS with tmux.
Two terminal-based agents dey worth knowing. Aider na de terminal-native, git-first option: e dey auto-commit every change with sensible message, so your history go clean and every edit go reversible. Na one of de longest-established terminal coding agents, even though e release pace don slow down. Goose, from Block, wider: na Apache-2.0 agent wey get big extension ecosystem and support for many providers including local Ollama models, wey dem dey develop under Linux Foundation's Agentic AI Foundation (AAIF). Aider dey suit person wey get disciplined, git-centric workflow; Goose dey suit person wey want general assistant with wide plugin set.
What you need
You need VPS wey get git, tmux, and recent Python for Aider, or de Goose installer for Goose. And you need model: either hosted API key from provider like Anthropic or OpenAI, or local model wey Ollama on the same VPS dey serve. De self-hosted route dey keep your code for your own server and e no dey cost anything per token, but you go need enough memory for capable model.
Install and run Aider
Install Aider for isolated environment with pipx, wey dey come from apt because Ubuntu 24.04 dey block plain pip install outside virtual environment (PEP 668). Then run Aider inside your project, inside tmux session so e go survive if you disconnect:
sudo apt install pipx
pipx ensurepath
pipx install aider-chat
tmux new -s aider
cd ~/my-project
aiderOne version note: dis install dey work as e show for Ubuntu 24.04. For Ubuntu 26.04, e dey fail currently, because Aider's pinned dependencies include older numpy wey no fit build against 26.04's Python 3.14. De fix na to give Aider its own Python 3.12:
pipx install --python 3.12 --fetch-missing-python aider-chatpipx dey download standalone interpreter just for Aider, and de install go finish. Dis na symptom of Aider's slowed release pace; if e dey bother you, Goose na de more actively maintained pick.
Once e don start to run, detach from de session with Ctrl-b then d and de agent go keep working even if your laptop close; reattach later with tmux attach -t aider to read wetin e change. Aider dey read your repository, propose edits, apply dem, and commit every single one, and e fit pull extra files for context when change cover many files. Because every change na commit, to undo de agent na simple git revert, wey na de safety net wey make am easy to use. Goose dey install with im documented one-line script and e dey run similar way from terminal, dey drive tasks through im extensions:
curl -fsSL https://github.com/aaif-goose/goose/releases/download/stable/download_cli.sh | bashHosted model or self-hosted model
Hosted model dey give you best quality and e no need local hardware, but e dey cost money per token and your code dey go to de provider. Per-token costs dey add up faster than most people expect, because de agent dey re-send de whole conversation for every turn. De Claude Code breakdown of what a long agent session really spends on tokens dey apply for here too, because Aider and Goose dey bill de same way. Self-hosted model through Ollama dey keep everything for your server and e dey free to run once you don pay for hardware, but coding model wey good enough to be useful need real memory. Na dat trade-off you need to weigh: quality and convenience against privacy and cost.
If you go self-hosted, de practical question na which model fit your server. Size am before you download eight-gigabyte model onto box wey no fit hold am:
Safety: it edits files and runs commands
Coding agent no be passive. E dey rewrite files and e fit run build and test commands, so give am de same care wey you go give any process wey fit change your system. Three habits go cover most of de risk. Work inside git repository, so every change dey tracked and reversible, wey Aider dey do for you automatically. Run de agent as your ordinary unprivileged user, never as root, follow least-privilege users, so bad command no fit touch de whole system. And keep de box itself hardened, because coding VPS still be public server: key-only SSH, default-deny firewall, and de rest. De OpenClaw hardening guide dey take de same stance for more autonomous agent, and de principles dey carry over.
To wire coding agent into your own workflow, building an AI agent with Claude dey show how one model dey drive your tools; running Google's Gemini CLI on a VPS na another terminal option, and self-hosting OpenHands na de heavier autonomous route. De most-starred open project for dis space now get im own guide: running OpenCode on a VPS dey set am up with de same tmux and unprivileged-user pattern.
FAQ
Can I run a coding agent with a local model instead of a paid API?
Yes. Both Aider and Goose dey work with local models wey Ollama dey serve, so you fit run coding agent fully self-hosted with no per-token cost and no code dey leave your server. De catch na memory: model wey capable enough to write useful code need plenty RAM or VRAM, so size de machine to de model before you commit.
Aider or Goose, which should I use?
Pick Aider if your workflow dey terminal- and git-centric and you want de most mature, lowest-overhead option; e dey auto-commit every change so your history go stay reversible. Pick Goose if you want broader assistant wey get big extension ecosystem and support for many providers. Both dey run from terminal and both dey work with Ollama, so either one dey suit VPS.
How much memory do I need for a self-hosted coding model?
E depend on de model size and how much e quantized. Small quantized model fit run for few gigabytes, while stronger model want far more, and long context windows dey add to am. Use de sizing tool for above to estimate de memory wey a given model and context length need before you download am.
Is it safe to let an AI agent edit my code and run commands?
E dey manageable if you get right habits. Keep your work inside git repository so every edit na reversible commit, run de agent as unprivileged user instead of root, and harden de VPS as you dey do for any public server. Review de changes wey e commit instead of to trust dem blindly, especially any command wey e want run against your system.