AIDA Blog

How to Install a Self-Hosted AI Agent on a VPS (2026 Guide)

Installing a self-hosted AI agent on a VPS takes four ingredients: a small Linux server (about $5-15 CAD/month), Docker, an AI API key from a provider you choose, and the agent software itself. With a modern installer, the distance from "empty server" to "first conversation with your agent" is measured in minutes. This guide covers the decisions that matter before you run anything.

Step 1: Pick a server

A personal AI agent is light. The model does the heavy thinking at the API provider's end; your server runs the agent's logic, memory, and integrations.

SpecMinimumComfortable
RAM2 GB4 GB
CPU1 vCPU2 vCPU
Storage20 GB40 GB
OSUbuntu 22.04Ubuntu 24.04 or 26.04

Any mainstream VPS provider works - Hetzner, DigitalOcean, OVH, Oracle, Contabo. Pick a region near you for snappier chat. If you want to try before renting anything, agents like AIDA also run on a Windows or macOS machine with Docker Desktop - a zero-cost way to explore before committing to a server.

Running the language model itself locally (via Ollama) is a different project with different hardware needs. For a first agent, using an API key is cheaper, simpler, and gives you stronger models.

Step 2: Get an API key

Your agent needs a language model. With your own key you pay the provider's raw rates and can switch models anytime:

  • Anthropic (Claude) or OpenAI (GPT) - strongest general performance
  • Google (Gemini) - competitive pricing, large context windows
  • OpenRouter - one key that routes to 200+ models, convenient for experimenting

Typical personal-use spend is $5-30/month, billed directly by the provider with no middleman markup.

Step 3: Install Docker and the agent

On Ubuntu, Docker is one command (curl -fsSL https://get.docker.com | sh), and most 2026-era agents ship as Docker images so the install itself is a script that pulls the image, asks for your API key, and starts the service. AIDA's installer follows this pattern: run it, answer the prompts, and the agent is online - the step-by-step guide walks every screen, and no prior server experience is assumed.

What a good installer handles for you: pulling a pinned, verified image; generating configuration; setting the service to restart on reboot; and HTTPS for the web interface.

Step 4: Connect your accounts

An agent earns its keep through your real accounts - Gmail or Outlook, Google Calendar, Drive or OneDrive, Tasks. The safe pattern here is OAuth: you approve access on Google's or Microsoft's own consent screen, the agent stores a revocable token, and your password is never typed into anything. You can revoke that token from your Google or Microsoft account page at any moment.

Step 5: Lock the basics down

Self-hosting means the security housekeeping is yours. The essentials are short:

  1. Firewall: allow SSH (ideally key-only) and HTTPS; close everything else.
  2. HTTPS on the web interface - handled automatically if your agent sits behind a proxy like Caddy.
  3. Updates on purpose: update the agent when releases ship, and let Ubuntu apply unattended security patches.
  4. Least privilege: connect only the accounts you actually want the agent using.

Realistic timeline

  • Renting the VPS and pointing DNS (optional): 15-30 minutes
  • Docker + agent install: 5-15 minutes with a scripted installer
  • OAuth account connections: 10-20 minutes, mostly clicking consent screens
  • First useful automation (a morning briefing, inbox triage): the same evening

The era when self-hosting an AI assistant meant a weekend of YAML is over. The decisions above - server, model, what to connect - are the real work; the installation itself has become the easy part.

Try AIDA on your own server AIDA is a self-hosted personal AI agent - inbox triage, email, calendar, files and automations, running under your own API key. Start the 7-day free trial (no credit card) or see pricing.